Hello to everyone.
I'm trying to retrieve the SHIFT value from inside the indicator source code.
Is there any manner to do that?
I explain my need: when the indicator is called by the EA using iCustom, we have MODE & SHIFT parameters.
From inside the source code of the Indicator, I need to know which is the Shift used by the EA to call the Indicator.
Anyone can help?
The shift is how many bars back you want the value from.
If you want the current value:
If you want the value 5 bars back:
Do you mean how do you find out the line index (mode)?
Thanks for writing.
I need to know FROM INSIDE the Indicator code which is the SHIFT used by the EA.
so if the EA makes this call:
You could look at Global Variables
i.e. your indicator saves the shift it is using to a GV, and your EA retrieves the GV value.
Do you mean if your EA does this:
You want your indicator to know "5"?
If so, you could look at Global Variables I suppose
Yes, exactly the contrary: I need that indicator must know the SHIFT used by the EA in the iCustom call...........
Indicator must know that the EA called it using "5" as SHIFT.
Probably a better way than GVs is to have another input parameter in your indicator for shift. You pass this value with the iCustom call.
int shift = 5;
Yes, if there's no reserved variable of MQL4 I'll do that way ......
Many thanks to you :)