Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
sorry i dint get u...what ur saying...can u please explain me clear...
i want -3, -2, -1,1, 2, 3 ma_shift by coding....please gave an example on code....
Thank you.
The Bars on your chart have a number The latest bar still open is bar 0
The Bar before has number 1
To calculate the value of your shifted EMA there has to be a line with a value at that point
In your picture the line is shited with -2
for bar 0 and for bar 1 the line doesn't reach those points on chart so we get there no value for your shifted EMA
You are calculating the values for bar 0 There is no value if the line is shifted with a value < 0...
calculating bar 0 MA_shift -2
calculating bar 1 MA_shift -2
The last input is for the bar you are calculating
See picture with negative shift you move the line to the past and current bar has that way no value