Hello,
I am trying to create a hedging strategy with multiple options.
Since I am barely starting, I have created a dictionary uNos (underlying and Options) whose kvp are symbols and symbol contracts.
My main issue is that the long puts stored in uNos are not being exercised in my exerciseContracts method.
Diego
Any help is greatly appreciated!
Varad Kabade
Hi Diego Munoz,
We do have a method to exercise an option! It is the ExerciseOption method.
This method places an exercise order and returns an order ticket
There isn't currently any further documentation on this method but we are working on changing that.
Best,
Varad Kabade
Diego Munoz
Hello @varad kababe can you show how this would work in a backtest?
Varad Kabade
Hi Diego Munoz,
We can add the above code inside the exerciseContracts method. Refer to the attached backtest. Note that the condition to exercise is never reached in the attached algorithm; we can check using a debug statement.
Best,
Varad Kabade
Diego Munoz
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!