NEGATIVE SHIFT
-
Hello friends, how can I implement a negative moving average shift.
My trial is in the link below
https://fxdreema.com/shared/vH7IaPABd -
Do you mean you want an input parameter for you to select the value of the MA's shift?
-
Not really, as you know the MA's default shift is 0, when is replace it with a negative value Example in the link below
https://fxdreema.com/shared/MDZzMFGMc
The MA stops working as expected. So I would like to know how to implement it so that it works with a negative shift. Otherwise welcome back from your holidays. -
@agitins you must pay attention to the candle ID. When you select a negative shift for the MA, candle ID 0 will have no value for the indicator. When shift is -3, the nearest value is found on candle ID 3.


-
Oh thanks Mr. so when I make the shift of -4, the action will take place at candle ID 3 IE from IDs 0,1,2 and 3. Right?
-
the number that goes in that box isn't a shift, that box is essentially asking, How many candles ago?
If you're typing a negative number it goes into the future, because the way fxdreema does the numbering system is the current candle being made is 0, the last completed candle is 1....and so forth.
-
@jsauter86 Ok thanks
-
@l-andorrà yes. that is my question
-
@len-1 You need to create a Constant (double type) with an initial value of 0. Then go to the Condition block and right select on the Shift box position. There you can select the constant to be positioned there.
-
Do you mean this has to be inputted before dragging it onto the MT4 screen?
-
@len-1 Yes, because it is a Constant, not a variable.