Hello,

In the following backtest I'm not seeing any price or volume data for extended market hours and wondering if I'm missing something obvious? Data is filled forward, but then gaps when normal hours resume. This happens across other futures securities and time periods, so don't think it's a discrete data issue.

Grateful for any help, 

Rob

  1. from AlgorithmImports import *
  2. class FuturesContinuousContract(QCAlgorithm):
  3. def Initialize(self):
  4. self.SetCash(100000)
  5. self.SetStartDate(datetime.now() - timedelta(days=7))
  6. self.continuousContract = self.AddFuture(
  7. Futures.Indices.NASDAQ100EMini,
  8. Resolution.Hour,
  9. extendedMarketHours=True
  10. )
  11. self.symbol = self.continuousContract.Symbol
  12. def OnData(self, data):
  13. bar = data.Bars[self.symbol]
  14. self.Debug(f'{self.symbol} {self.Time} o {bar.Open} c {bar.Close} v {bar.Volume}')
  15. self.Plot("Price", "NASDAQ100EMini", self.Securities[self.symbol].Price)
+ Expand

Author

Rob Anderson

November 2022