Q-Tribe,
I'm trying to load a signal file from a dropbox location. I get 5 of the rows and then -- fffttt -- choke. There's another 10 rows or so after that error.
And the error in the runtime does not reflect this logged error.
You might just fetch the file to see how simple it is.
1970-01-01DataReview:76INFO
EntryDate Symbol Side Quantity EntryPrice NetAmount ExitDate
0 20150317 ADP Buy 57 86.91 4953.87 20150407
1 20150317 ARE Buy 51 97.26 4960.26 20150407
2 20150317 BRCM Buy 111 44.56 4946.16 20150407
3 20150317 CAT Buy 63 79.35 4999.05 20150407
4 20150317 CR Buy 78 63.39 4944.42 20150407
1970-01-01null:nullWARNrequests/packages/urllib3/util/ssl_.py:79:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
End of logs.
Runtime error:
KeyError: 'symbol'
There was a runtime error on line 35.
And this is line 35 : universe_func = SetUniverse)
Here's the simple code that I was hoping would work (pulled mainly from the help file).
def initialize(context):
fetch_csv('https://dl.dropboxusercontent.com/u/217910322/Finance/TestSignals.csv',
date_column = 'EntryDate',
date_format = 'yyyymmdd',
pre_func = DataReview,
post_func = DataReview,
universe_func = SetUniverse)
def SetUniverse(context, fetcher_data):
my_stocks = set(fetcher_data['Symbol'])
context.count = len(my_stocks)
print 'total universe size: {c}'.format(c=context.count)
return my_stocks
def DataReview(df):
log.info(' %s ' % df.head())
return df