Moving average from an upper time frame
Here is the chart:
That is right!
for(i = 0; i <limit; i++)
{
MavgUpperWindow[i] = iMA(NULL, upperTF, Period_MovingAverage, 0, MODE_SMA, PRICE_CLOSE,
i);
}
In fact, the time at i in MavgUpperWindow[i] is not the time at i in iMA(NULL,
upperTF, Period_MovingAverage, 0, MODE_SMA, PRICE_CLOSE, i) !!!!
The line is draw on this time axis !
ref below:
int i,ind ; int limit=Bars; int mm = upperTF /Period()+1; double dd; for(i=limit*Period()/upperTF ; i>=0; i--) { ind = iBarShift(NULL, Period(), iTime(NULL,upperTF ,i)) ; dd = iMA(NULL, upperTF, Period_MovingAverage, 0, MODE_SMA, PRICE_CLOSE, i); for (int j=0; j<mm; j++) SATLBuffer2[ind+j] = dd; }
@DXdCn
Thank you!
I thinked that this where the solution. Very nice.
@DXdCn
Thank you!
I thinked that this where the solution. Very nice.
Can you please send me this code?
Hello, I have build a Moving Average Solution that is also works in the Strategietester Modus, this Indicator above you dont can use it in the strategietestermodus!
And with my indicator you can also show the Movingaverag in different ways and set from different Timeframes like 7 or 32 :-).
Hi,
I tried to draw two moving averages, one from the actual TF and one from the upper TF, but the values in the charts are completly false.
In the M1 Chart, must I have for the upper TF (blue line) the same values as from the M5 chart (red line), and this isnt so.
Have you an explanation, or I have a bug?