Hi
Not sure where to post this so here goes:
fetch_csv has 2 uses, fetching signals and stock data.
stock info can be accessed through data.fetcher_assets
data.fetcher_assets is not populated if one fetches signals after stock data
4a and 4b.
In 4a, fetch_csv(signals) before fetch_csv(stocks) results in data.fetcher_assets being populated.
In 4b, fetch_csv(signals) after fetch_csv(stocks) results in data.fetcher_assets not being populated.
4a. Example in this setup, data.fetcher_assets is populated
#Pseudocode.
#Replace signalFile and stockDataFile with urls to formatted csv files
def initialize(context):
#Fetching example signal file
fetch_csv(signalFile,
symbol = "colName")
#Fetching example stock file
fetch_csv(stockDataFile)
schedule_function(at_market_open, date_rule=date_rules.every_day(), time_rule=time_rules.market_open(hours=1))
def at_market_open(context, data):
#We get stuff that is in data.fetcher_assets
print(data.fetcher_assets)
pass
4b. Example in this setup, data.fetcher_assets is NOT populated. Note order of fetch_csv
#Pseudocode
#Replace signalFile and stockDataFile with urls to formatted csv files
def initialize(context):
#Fetching example stock file
fetch_csv(stockDataFile)
#Fetching example signal file
fetch_csv(signalFile,
symbol = "colName")
schedule_function(at_market_open, date_rule=date_rules.every_day(), time_rule=time_rules.market_open(hours=1))
def at_market_open(context, data):
#We get []
print(data.fetcher_assets)
pass