I have a problem with the iCustom function of the gator oscillator (Gator.mq4) what oscillator code can be found anywhere.
The oscillator has 6 buffers, what values I want to query, to determine the color of the oscillator. My problem is, that when the oscillator turns from red to green in a bar, the same buffers show values different from zero, that in the case of red.
The correct would be - as I think - that in case of red the indicatorbuffer 1 (starting from 0) and indbuffer 4 values would be different from 0, and in case of green, the indbuffer 2 and indbuffer 5 values would be different from 0. This is correct sometimes, but not in every case (especially not, when the indicator changes color in one bar).
However, when I stop the program in such a point, it shows that it drawn green line (what should be drawn from the 2. and 5. buffer), and despite of it, as my Print() shows, that buffer values are 0, and only the indbuffer 1 and indbuffer 4 vales different from 0, what was at the case of red.
What is also strange, is that sometimes indbuffer 1,2,4,5 values are a littlebit different, from the indbuffer 0 and 3 values (and also the values printed on the chart), if I am right that those values should be one of these.
Could someone tell me please, what could be the reason?
Or as an alternative, how could I get the color values from not the Gator.mq4, but the iGator indicator?
Thank you in advance!
However, as I see now, the color can be get by also querying only the buffer 0 and 3 and the previous bar values of them, and comparing the changes..