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 ?
QUANTCONNECT COMMUNITY
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.
Welly Tambunan
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
- However i can't find the example on how to use it. Is there any sample around that ?
- I'm confused about how i can define the strike price and expiry date. Should i search thorugh the options chain first ? Or the methods will find it by itself.
- And how i can use limit order for that one ?
Thanks a lotRahul Chowdhury
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
Welly Tambunan
wow.. thanks a lot Rahul Chowdhury you're rock
i'm accepting the answer..
thanks
Welly Tambunan
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!