I have an indicator on my trading platform that I am trying to replicate for backtesting. In this indicator, I compare 2 moving averages to determine trend. I want to be able to identify the crossover point to enter a trade, but I can't figure out how to do that here. I've read a lot of forums and documentation and can't seem to find a way to do that. I'm not sure consolidating and using a rolling window is the answer, but if it is, I can't figure out how to make it work.
Jack Potzauf
Hello Tom,
I linked and algo that I think might be of use to you, it uses a consolidator (which is not really a requirement, but I like to be able to control the resolution of data and request historical data). In the example that I have provided it uses two Exponential Moving Averages, a 6 period and a 12 period. If the 6 period is greater than or equal to the twelve period it could provide an uptrend signal and if the 6 period is less than the 12 period then vice-versa. If an uptrend is signaled a green triangle will be plotted on the SPY chart and a red triangle if a downtrend is signaled. Let me know if you have any other questions.
Tom Royce
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!