Back

How can I retrieve/track an option's price bought by the algo, for every next minute, to set exit criterias

Hi,

The attached algo buys an ATM put or a call 3 minutes after the open, depending on the price action. I can print/debug the ask price for the ATM contract at this time and it matches with the fill price. But once I reach my exit criteria, I try to print the new current option bid/ask price, but it keeps giving me the price information of when the trade was entered. If you look at the logs, the first trade enters at 5.2, when the exit criterias are met, the price printed is still ask= 5.2 while the fill price is 8.4

My question is: how can I refresh the bid/ask price of an option and print it every minute, considering the option symbol is known, since the algo bought it during the entry signal. 

The goal is to track these latest prices to setup my exits criteria, i.e: if I bought at 5.2, I wanna exit at 0.5*entry or 1.5*entry. You will notice that currently then entry/exits are based on the stock movement and not the option value. 

Any help will be greatly appreciated.   

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.


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