Hi Quants !
I would like to use the Moving Average Envelope. I have succeed to insert a Moving Average in my Algorithm but I don't find a way to insert an Upper Band and a Lower Band at x% of the Moving Average. I tried many things but none works.
Could you help me please :)
Thx
Douglas Stridsberg
Hey and welcome!
Take a look at the Indicator Extensions - assuming you're running Python, you should be able to use something like
UpperBand = IndicatorExtensions.Plus( MiddleBand, IndicatorExtensions.Times( MiddleBand, 0.5 ) )
I'm not at a terminal now so can't confirm syntax but I believe that should work. But it might not make sense to add "x% of the Moving Average" like you suggested, so be careful with what exactly you're adding.
Rodolphe Wisniewski
I tried that you said and it works ! Thx very much !
But now I have an another problem, I don't find the solution to plot these 2 bands on the graph of the SMA. I can only plot one of the 2 bands. So I tried to plot the 2 bands together on a graph (without the SMA) but it doesn't work also.
Here is what I have now :
Sorry to bother you, I'm new in the world of the programming language, I don't master it very well right now :)
Douglas Stridsberg
It's hard to see what's going on without seeing the rest of your code. What you've sent doesn't immediately look wrong.
Can you do an Attach Backtest in your next post perhaps? Feel free to cut out things you don't want to share, of course.
Michael Manus
There seems to be something like an indicator.
AccelerationBands
old forum posts:
https://www.quantconnect.com/forum/discussion/520/triple-moving-average-cross/p1
https://www.quantconnect.com/forum/discussion/394/displaced-moving-average-ribbon/p1
Halldor Andersen
Hi all.
To plot the upper and lower band, construct a Chart and add multiple series to the chart. Check out this documentation section on Charting for further information.
In the attached backtest I demonstrate how to construct lower and upper band using IndicatorExtensions.Times(), and how to plot the values of the upper and lower band.
Rodolphe Wisniewski
Thx it's perfect !!! Sorry, I had many exams, so I have stopped algorithms for some time :)
Rodolphe Wisniewski
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!