I ran 3600 combinations of slow/fast SMA crossings to find good signals for a 12 year period on QQQ. The results showed returns as high as 170+%. A scatter plot of the results is attached.Pete
--
You received this message because you are subscribed to the Google Groups "talibpython" group.
To post to this group, send email to talib...@googlegroups.com.
--
import urllib2
import urllib
import numpy as np
from datetime import datetime
urldata = {}
urldata['q'] = ticker = 'JPM' # stock symbol
urldata['x'] = 'NYSE' # exchange symbol
urldata['i'] = '60' # interval
urldata['p'] = '1d' # number of past trading days (max has been 15d)
urldata['f'] = 'd,o,h,l,c,v' # requested data d is time, o is open, c is closing, h is high, l is low, v is volume
url_values = urllib.urlencode(urldata)
url = 'http://www.google.com/finance/getprices'
full_url = url + '?' + url_values
req = urllib2.Request(full_url)
response = urllib2.urlopen(req).readlines()
getdata = response
del getdata[0:7]
numberoflines = len(getdata)
returnMat = np.zeros((numberoflines, 5))
timeVector = []
index = 0
for line in getdata:
line = line.strip('a')
listFromLine = line.split(',')
returnMat[index,:] = listFromLine[1:6]
timeVector.append(int(listFromLine[0]))
index += 1
# convert Unix or epoch time to something more familiar
for x in timeVector:
if x > 500:
z = x
timeVector[timeVector.index(x)] = datetime.fromtimestamp(x)
else:
y = z+x*60 # multiply by interval
timeVector[timeVector.index(x)] = datetime.fromtimestamp(y)
tdata = np.array(timeVector)
time = tdata.reshape((len(tdata),1))
intradata = np.concatenate((time, returnMat), axis=1) # array of all data with the properly formated times