Hi everyone,
I want to use my own data so I tried fetch_csv code example here with the same data provided with this example, and I saved the same data on dropbox. however, I got the following error:
Something went wrong. Sorry for the inconvenience. Try using the
built-in debugger to analyze your code. If you would like help, send
us an email.Exception: Error parsing remote CSV data. There was a
runtime error on line 7.
(line 7 is where date_format = '%m/%d/%y')
at)
Could you help me figure out where went wrong?
Also does fetch_csv only accept dateformat as "%m/%d/%y"? how about "%Y/%m/%d"?
Thanks a lot
Here is the code and dropbox link:
def initialize(context):
# fetch data from a CSV file somewhere on the web.
# Note that one of the columns must be named 'symbol' for
# the data to be matched to the stock symbol
fetch_csv('https://www.dropbox.com/s/ef3aqzueaypdecq/dataTest.csv?dl=0',
date_column = 'Settlement Date',
date_format = '%m/%d/%y')
context.stock = symbol('NFLX')
def handle_data(context, data):
if 'Days To Cover' in data[context.stock]:
record(Short_Interest = data[context.stock]['Days To Cover'])