I am currently working on scripting an EA. I came to the point, where I need to know, what exactly the indicator buffer stands for.
Here is an example:
The last variable "shift" indicates the indicator buffer. I couldn't find a proper definition yet.
I would be very happy, if you could help me.
Thanks a lot in advance!
shift is not the indicator buffer. They are totally different things and unrelated in this context.
shift is the bar index.
So, for MQL4:
shift 0 = the current bar
shift 1 = the previous bar
shift 2 = the bar before that
and so on.
You may be getting confused with iCustom.
Thanks a lot honest_knave!
I was confused because of the explanation of this variable:
[in] Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
That means then, I can pick up all the single values within an (e.g.) 20 day EMA using this shift function?
OK, I see what they have done there in the documentation, and I can see why it is confusing if you then read up on indicator_buffers.
This may help:
[in] Index of the value taken from the iMA buffer (shift relative to the current bar the given amount of periods ago).
To cut straight to your answer: Yes, you can e.g. the last 3 bars' 20 EMA values
thanks for your quick reply. That helps a lot!