Hi team,
This algorithm is simply intended to buy a fixed dollar amount of a 40 delta SPY LEAP once a month. I select the first expiry that is at least 380 days out, and then find the contract that is closest to 0.4 delta.
You can see that initially it found the right contracts, but over time the orders show that the selected contract drifted more and more ITM. Towards the end of backtest (Jun 2021) it is trading almost 70 delta calls instead of the intended 40. Am I not updating the universe correctly?
I can't figure out what's wrong.
I had to set the options universe filter to get (-10000, 10000) strikes because it seemed like the strikes were only chosen once in the beginning and that universe was never updated again. If I keep (-20, 20) strikes in the filter functions it fails to get closer to 40 delta.
Also for an algo that is meant to trade once a month, invoking OnData every minute seems excessive. Hence I added the check which skips rest of OnData compute if the current time is not 9:38am.
Thanks
Varad Kabade
Hi Abhijeet mulye,
In the above algorithm, when we select the contract with the latest expiry, only one contract satisfies this; thus, we see the larger deviation in delta values. In the attached backtest, the plot shows the difference between the number of options available before and after filtering for contracts with the latest expiry. If we remove this filter, there are contracts with delta values closer to 0.4.
Best,
Varad Kabade
Abhijeet Mulye
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!