When exactly do Arrows from Arrow indicators appear? How does it correspond to the indicator's buffer?

 

Hello,

I am trying to write an EA which places orders the bar after an Arrow from the

indicator appears on the chart.

The problem with it is, that there seems to be no identifiable deterministic rule

to know whether the Arrow shows or not:

1) I tried to count all ticks in the last bar which have indicator buffer != 0 and use a treshold (eg >50% of ticks)

But alas, this isn't identical to the arrow appearing

2) I tried to check for consecutive streaks of the indicator buffer != 0, but that does not work either.

Can someone please show me the source code of MT4 which reads the indicator buffer

or tell me the rule by which it is determined whether an arrow shows up on a bar?

Sometimes the Arrow flickers and vanishes away/shows up eventually.

Is it some sort of moving average?

(Example: the attached indicator)

Files:
jemmy2.mq4  6 kb
 

What determines when an arrow is show is the code in the Indicator you have posted . . . from your description it seems this Indicator will repaint the arrows (appear, disappear, appear).

Go through the indicator code and understand it then you will know why it does what it does.

Reason: