Back

Extended market hours data error

I am developing an algorithm which heavily relies on the usage of after hours data, sepcifically in the second resolution. However, when attempting to backtest wiith after hours data, I get errors saying that there is no extended market data available. Is there no second resolution after hours data available? Note that I did set extendedMarketHours as true using:

"AddEquity(ticker,resolution,Market.USA,true,0m,true);"

Error is the following: "[stock] wasn't found in the TradeBars object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data."

Update Backtest








So after some more testing it appears as if a lot of stocks don't have extended after market hours data. And even the popular stocks that do have after market hours data, don't have actual data, i.e. the stocks price is the same every minute. Below is some data for AAPL's stock price during it's earnings report and the data appears to stay the same even though AAPL's stock clearly moved in the after hours of its earnings report.

Has anyone successfully worked with after market stock data or is it just not available in the data set? If it's not available in the data set, do you think that if I live trade the algorithm, Quantconnect will properly support my after hours algorithm?

 

0

- We do have afterhours data its just a misunderstanding on how to use the event handlers. You're not going to get trades at every single step premarket, you'll need to check if the data is actually in the dictionary. This is easy if there's only 1 symbol you're backtesting; since every event will have data; but if you have two there's no way to guarentee they will both have a trade.

 - Just a tip - don't log price data or the data vendors will block your account. Its against our terms of service.

If you'd like more assistance please share an algorithm and one of the team or community can help you.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed