Detect arrows and issue an alert

Martin Friedrich
15

Hello everyone,

I need help for a small script to indicated of arrows. I've an indicator which generation my arrows and I don't know the buffer to detect this in a script for a alert message.


Unfortunately, I haven't found anything suitable in the forum.


Thank you for your support.

Martin

pennyhunter
705
pennyhunter  
Martin Friedrich:

Hello everyone,

I need help for a small script to indicated of arrows. I've an indicator which generation my arrows and I don't know the buffer to detect this in a script for a alert message.


Unfortunately, I haven't found anything suitable in the forum.


Thank you for your support.

Martin

So you want to write a script that gives you an alert when your buffer shows an arrow... on the current bar or what? Why not make it an indicator?

Martin Friedrich
15
Martin Friedrich  
It works as an indicator, but for this I still have to recognize that an arrow has just been generated and in which direction. And currently I don't know how to recognize that.
pennyhunter
705
pennyhunter  
Martin Friedrich #:
It works as an indicator, but for this I still have to recognize that an arrow has just been generated and in which direction. And currently I don't know how to recognize that.
A DRAW_ARROW buffer contains 0.0 where there will be no arrows and some price where there will be arrows, then there is an Arrow shift so the arrows will not be plotted directly on the candles but slightly above/below.
Then there will be a line PlotIndexSetDouble(plot_index,EMPTY_VALUE,0.0) which replaces all the zeros in the buffer by the empty value number which is a very large number so you won't have the zeros plotted.
So basically you want all the bar indexes where the Arrow buffer is not zero and the prices in there.

I suggest you look at the code of MQL5/Indicators/Examples/Fractals, it has got to do with Arrows. There you can see the number of the buffer that stores the data that is used for arrows. You can save a copy of it and play around with that to see how it behaves on the chart. Then you look up the parts of the code in the documentation. That might give you an idea of what you are looking for.
Abdullah Alrai
86147
Indicator Buffers
Indicator Buffers
  • www.mql5.com
This EA will detect the buffers values of any indicator you want. Just type its name in the EA settings.