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 ?
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Asking for advice on backtesting vertical credit put spreads in QuantConnect.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
Short Vertical Credit Put Spread
Welly Tambunan | June 2020
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 ?
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
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.
QuantConnectâ„¢ 2025. All Rights Reserved
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 lotThe 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
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!