Back

Trading options in extended market hours

I'm running into an issue trying to call self.AddOptionContract() for anything traded after hours, like SPY and IWM. Here's the log for a couple trades I'm trying to simulate:

2020-04-06 16:00:37 : No data loaded for SPY 200409C00267000 because there were no tradeable dates for this security.
2020-04-06 16:00:43 : No data loaded for UVXY 200417P00047000 because there were no tradeable dates for this security.
2020-04-06 16:02:15 : No data loaded for IWM 200515P00107000 because there were no tradeable dates for this security.

As far as I can tell, this data exists in QC from AlgoSeek, but AddOptionContract() doesn't seem to add the underlying or contract with extendedMarketHours set to True (source).

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.


Hey Tabrez,

Although it may be possible to trade options after hours in the market, it's not possible to so on QuantConnect. Also keep in mind that the vast majority of options on U.S. stocks trade during normal market hours.

Best
Rahul

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.


Hi Tabrez,

I ran into this earlier as well.  If you are running the lean framework locally you can go to your market hours database ( look at "data-folder" setting in config.json ) and create a new entry named "Option-usa-SPY", for example, if SPY is the underlyer.  Make sure the end time extends to 16:15:00.  Definitely not the best solution, but works for me so thought I would share.

0

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