Hello,
In the attached backtest, I have a buy trigger set up to fire when a stock breaks its high of day mark. It appears to work most of the time. But then starting at ‘2020-07-14 12:15:22,’ it starts buying way below its high of day mark. Do you know why that is? I'm not sure what I'm missing on this one
Thanks!
Sean
Varad Kabade
Hi S O'Keeffe,
This happens because our indicator period is 45 min. In the following backtest, we have logged the indicator value and close price when the condition to emit the Up signal occurs. We can see that algorithm is performing intently till 10:47:24; after that, there is no trigger till 12.15.22. so the max value at that time is not the max value at the later time. To resolve this, we recommend using a longer period for the Maximum indicator. Refer to the attached backtest.
Best,
Varad Kabade
S O'Keeffe
Hi Varad,
Ah OK the ‘self.max = Maximum(45*60) # 45 minutes’ line. I see thank you!
Sean
S O'Keeffe
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!