HI, i have taken a equity and a option asset.I want to sell put or sell call based on the condition how equity is performing based on 1st 2 bar graph of 30 min each.
THe problem i am facing is that i can not able to use both equity bar graph result and option contract.
I am attaching my code below.Any help/suggestion will be appreciated.
Rahul Chowdhury
Hi Akash,
There is a bug in the algorithm which prevents the algorithm from placing trades.
if ... and (self.openingBar.High>self.secondaryBar.Low>self.openingBar.High):
This if statement is never True because self.secondaryBar.Low can't be both higher and lower than self.openingBar.High.
I've replaced it with
if ... and (self.openingBar.High>self.secondaryBar.Low):
The algorithm now can place trades for options based on equity bar properties. If you have any other questions, please let me know!
Best
Rahul
Akash
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!