Hi:
I'm trying to create this code, but after reading documentation and tutorials, it seems that I'm missing something. Code is built but no single spread is bought, so I would thank some help.
This is my initialization
def initialize(self):
self.set_start_date(2019, 1, 1)
self.set_end_date(2019, 4, 1)
self.set_cash(100000)
index = self.add_index("SPX", Resolution.HOUR).symbol
option = self.add_index_option(index, "SPXW", Resolution.HOUR)
option.SetFilter(-120, +10, 60, 80)
self._symbol = option.symbol
What I want to do is use the combo_limit_order to buy 1 spread every Monday with the following characteristics:
- The expiration date must be between 78 and 84 DTE
- The BullPut spread must be 20 points wide
- The short Put strike must be 80 points below the underlying. The long Put strike must be 100 points below the underlying
- The bullput spread must be closed when 35 days before expiration
How could I create this?
Thanks
Mia Alissi
Sources: Index Option Bull Put Spread Algorithm, Bull Put Spread - QuantConnect.com, Index Option Bear Put Spread Algorithm, Index Option Bull Call Spread Algorithm, Bull Call Spread - QuantConnect.com
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.
Prudencio
Thanks.
Could you help me also with the logic to
Regards
Prudencio
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!