Back

Options Trading

Hello,

Does anyone know how I can get the price of contracts on the day they are set to expire? For example, minute bar prices of a call option that has an expiration Friday 2018/01/26, on Friday 2018/01/26. 

The current setup in the documents does not allow it and returns the Thursday before expiration.  

Update Backtest








Hi Houman Dehghan,

Here is my attempt to get the price of the contract at the expiry.

  1. Use the delisting property to mark the expiration date (00:00 at expiry) - You need to specify the Time as the contract might appear in the delisting list more than once on the expiration date.
  2. Create an empty list to append the minute contract price (Bid/Ask Price or the bar information).
  3. When the length of the list exceeds the number of bars within a day, stop append the price then we will get a price list which contains only the price on the expiration date.
  4. Repeat the above steps each time we get a new contract in the portfolio. 

Please see the attached example for details

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 Jing Wu, 

Many thanks for your comment. Would this also work in the research platform? 

0

It would be easier in research notebook as you could request the options history directly.

qb.GetOptionHistory(symbol, date)
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.


Unfortunately that does not seem correct. I think there is a bug somewhere, I have attached the notebook. The function returns the previous day values instead, 2018-01-18 instead of 2018-01-19. 

0

I actually played around with the notebook a little bit, there are various days that come back empty. For example in the note book above if you try the Tuesday before expiration or even Wednesday it comes back empty. 

Has anyone experienced the same issue?

0

Please send bug reports to support@quantconnect.com

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