Hi All-
I've noticed adding NASDAQ Datalink custom data using self.AddData for a universe of 50 stocks has slowed my backtests to a crawl. I'm accessing Fred data (short interest) and add this data for each incoming stock in OnSecuritiesChanged. I have a few questions based on what I've learned and seen using this method.
- Should I be removing these data as stocks leave the universe upon rebalancing?
- Does self.AddData import the entire NASDAQ Datalink dataset or only ‘reach out’ to it when called to find the next incoming data?
- If #3 is true, does the slow backtest speed come from this initial download?
- Does this custom data avoid lookahead bias by only sending in data when the day is done (for daily data)?
- Lastly, can custom data only be called in OnData or can it be called in a scheduled event (BeforeMarketClose, etc.)?
Thanks,
Justin