Hi All,
I want to start backtesting my spread put options in QC. Is there any tricks or example on how to do this ?
Any built-in method i could use ?
Hi All,
I want to start backtesting my spread put options in QC. Is there any tricks or example on how to do this ?
Any built-in method i could use ?
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.
Jack Simonson Hi Jack,
Thanks for answering the questions previously. :)
I found this cool method for creating spread
https://www.quantconnect.com/lean/documentation/topic27730.html
Hey Welly,
1) Here is an example that uses OptionStrategies.Straddle.
2) You define the strikes based on the current price of the underlying and the expiration based on the current algorithm.Time.
3) By default the OptionStrategies execute as market orders. You can change their OrderType and OrderPrice by editing each OptionLeg in the strategy. Check out OptionStrategy.cs to learn more about how OptionStrategies are structured.
straddle = OptionStrategies.Straddle(self.option_symbol, strike, expiry)
for leg in straddle.OptionLegs:
leg.OrderType = OrderType.Limit
leg.OrderPrice = ...
I've also attached an example of implementing a put spread manually without using OptionStrategies.
Best
Rahul
wow.. thanks a lot Rahul Chowdhury you're rock
i'm accepting the answer..
thanks
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!