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
from AlgorithmImports import *
class FuturesContinuousContract(QCAlgorithm):
def Initialize(self):
self.SetCash(100000)
self.SetStartDate(datetime.now() - timedelta(days=7))
self.continuousContract = self.AddFuture(
Futures.Indices.NASDAQ100EMini,
Resolution.Hour,
extendedMarketHours=True
)
self.symbol = self.continuousContract.Symbol
def OnData(self, data):
bar = data.Bars[self.symbol]
self.Debug(f'{self.symbol} {self.Time} o {bar.Open} c {bar.Close} v {bar.Volume}')
self.Plot("Price", "NASDAQ100EMini", self.Securities[self.symbol].Price)
Louis Szeto
Hi Rob
Future’s extended market hour data is available for minute or denser resolution.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Rob Anderson
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!