Hello,
I am trying to get the list of all S&P 500 stocks using Fetcher. There are two problems:
1) The algorithm only works in daily mode. When I try to use it in minute mode, I get an error, but there isn't any description of it: "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." I need to use the algorithm in minute mode when I actually do transactions.
2) When I use the algorithm in daily mode, it works, but on the logs, it says: "1970-01-01 null:null WARN Dropped 18 rows from fetched csv." Also, it only prints the total universe as being 455, even though my csv file contains 500 symbols.
import pandas as pd
import numpy as np
def initialize(context):
fetch_csv("https://dl.dropboxusercontent.com/u/77898006/constituents.csv", pre_func = preview, post_func = preview, universe_func = my_universe)
def preview(df):
log.info(' \n %s ' % df.head())
return df
def my_universe(context, fetcher_data):
sids = set(fetcher_data['sid'])
context.count = len(sids)
print 'total universe size: {c}'.format(c=context.count)
return sids
def handle_data(context, data):
log.info("Executed handle_data")
Any help in resolving this issue would be greatly appreciated.