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.

  1. Should I be removing these data as stocks leave the universe upon rebalancing?
  2. Does self.AddData import the entire NASDAQ Datalink dataset or only ‘reach out’ to it when called to find the next incoming data? 
  3. If #3 is true, does the slow backtest speed come from this initial download? 
  4. Does this custom data avoid lookahead bias by only sending in data when the day is done (for daily data)?
  5. Lastly, can custom data only be called in OnData or can it be called in a scheduled event (BeforeMarketClose, etc.)?

 

Thanks,

 

Justin

Author