Back

Short Vertical Credit Put Spread

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 ?

 

 

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.


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 

  1. However i can't find the example on how to use it. Is there any sample around that ?
  2. 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.
  3. And how i can use limit order for that one ?
Thanks a lot
0

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

1

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.


wow.. thanks a lot Rahul Chowdhury you're rock 

i'm accepting the answer..

thanks

0

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