Page 1 of 1

Moving average only starts plotting lates than expected

Posted: Jun 27 2018
by Automeq
If I plot a sma 3 periods in a daily chart it only starts plotting on bar #7 instead of bar #4
5.JPG
(57.65 KiB) Downloaded 527 times
Properties are with auto-detect (but if I chose zero the result is the same)
6.JPG
(46.8 KiB) Downloaded 527 times
X-time scale parameters is like this:
7.JPG
(42.25 KiB) Downloaded 527 times

I think this is something related with some kind of wrong parameter but I can't find where.

Re: Moving average only starts plotting lates than expected

Posted: Jun 27 2018
by TJ
It has to do with MaxBarsBack.

The chart will only start calculating indicators and plotting after a sufficient number of bars has been loaded.

Re: Moving average only starts plotting lates than expected

Posted: Jun 27 2018
by Automeq
I suspected that when I read the link about it:
https://www.multicharts.com/trading-sof ... _Detection

But I didn't understand if this was changeable. I tried User Specified = 0 but there was no change.

The truth is that a sma(3) of Close only needs 3 bars to be calculated. Any way of starting have it on the third bar ?

Re: Moving average only starts plotting lates than expected

Posted: Jun 28 2018
by Svetlana MultiCharts
Hello, Automeq,

If MaxsBarsBack value is less than the study requires for calculation (User Specified = 0), then the value shall be auto detected.
In order to plot Moving Average from the 4th bar, please select User Specified = 3 for the Max number of bars study will reference parameter.

Re: Moving average only starts plotting lates than expected

Posted: Jun 28 2018
by Automeq
Hello, Automeq,

If MaxsBarsBack value is less than the study requires for calculation (User Specified = 0), then the value shall be auto detected.
In order to plot Moving Average from the 4th bar, please select User Specified = 3 for the Max number of bars study will reference parameter.
Two points (still regarding moving average(3):

- If I change User Specified = 3 it only starts plotting on bar #4. But on bar #3 there is already enough information to calculate it (and if I change User Specified = 2, it goes back to start plotting on bar #8 so it's not a solution).

- We're not supposed to be changing the parameter User Specified of moving average each time we change the periods. Imagine. Now I have mov(9), then I try 200, then I try 100 and so on. It's not logic to be changing the User Specified parameter every time we change the mov avg. We need to rely on auto-detect for that.

A moving average 3 periods is possible to be calculated in bar #3.
And a moving average 9 on bar #9.
And a moving average 200 on bar #200

Why isn't working like this when autodetect is selected ?
Why delaying the calculation of the moving average more than what has to be ?
Sounds like a malfunctioning of the software to me, unless there is an explanation for this behaviour which I'm not foreseeing.

Re: Moving average only starts plotting lates than expected

Posted: Jun 29 2018
by Svetlana MultiCharts
Automeq,

MaxsBarsBack value shall be equal to the number of bars back the study needs to reference for calculation. E.g. if MaxBarsBack = 3 the study references 3 bars back starting from the 4th bar. If the study referenced back from the 3th bar inclusively – it would see 2 bars back and nothing instead for the 1st bar.

MultiCharts doesn’t look inside the code of the strategy and determine the exact number of bars required for calculation. That’s why this value is autodetected (if the corresponding parameter is selected or if user specified value is incorrect). The selection starts from 0, then 6, then 12 and so on, until the study is not calculated.

Please find the additional information about Auto-detect of MaxBarsBack down this link: viewtopic.php?f=1&t=47578&p=111062#p111062