How can I recognise programmatically when an up/down arrow is drawn on a chart?

 

I know how to draw an object arrow on the chart, which I usually do like this:

      ObjectCreate(0,"prevHigh",OBJ_ARROW_DOWN,0,Time[0],High[highestCandle]);  
      ObjectSetInteger(0, "prevHigh", OBJPROP_COLOR, clrRed);

Now I have an indicator that draws up/down arrows on the chart as seen in the image below. How can I when for example a Magenta down arrow has been drawn and the candle (index) at which it is drawn?

Please note that the arrows don't appear in the Charts object list.


Imgur
Imgur
  • 2020.04.10
  • imgur.com
Post with 1 views.
 
Jackery:

Now I have an indicator that draws up/down arrows on the chart as seen in the image below. How can I when for example a Magenta down arrow has been drawn and the candle (index) at which it is drawn?

Please note that the arrows don't appear in the Charts object list.


Maybe they are not objects, but buffers. If so use iCustom().

 
Keith Watford:

Maybe they are not objects, but buffers. If so use iCustom().

The indicator file is a .ex4 I'm not too certain how to go about this using iCustom(). I would really appreciate some more details to how to go about this.

 
Jackery:

The indicator file is a .ex4 I'm not too certain how to go about this using iCustom(). I would really appreciate some more details to how to go about this.

Look up iCustom in the documentation.

 
Jackery:

I know how to draw an object arrow on the chart, which I usually do like this:

Now I have an indicator that draws up/down arrows on the chart as seen in the image below. How can I when for example a Magenta down arrow has been drawn and the candle (index) at which it is drawn?

Please note that the arrows don't appear in the Charts object list.


This method of drawing is not possible to detect using an expert adviser. 

You need to use indicator_plot and plot_set_property to do that. Then you can read buffer values changes to detect presence of arrows. 

Dm for help.

 
There are two types of arrows.
  1. Buffers of type arrow. View (Alt+V) → Data Window (Control+D) If you see your "main indicator" and a value where there is an arrow, then read the buffer, (using iCustom) and do what you want with it.
    You should encapsulate your iCustom calls to make your code self-documenting.
              Detailed explanation of iCustom - MQL4 programming forum

  2. Otherwise, it is drawing arrow objects. Charts (Alt+C) → Objects → Objects List (Control+B).
    Find the corresponding object and find the naming pattern. Then you can get all appropriate objects and their values.
              Object Functions
Nelson Wanyama: This method of drawing is not possible to detect using an expert adviser. 
Of course, you can detect either type.
 
Nelson Wanyama:

This method of drawing is not possible to detect using an expert adviser. 

...
Of course it's possible. Though not so easily that using iCustom and buffers.
 
It is possible. Using objects on chart. But that is not the most efficient way to do it. 
 
Nelson Wanyama:
It is possible. Using objects on chart. But that is not the most efficient way to do it. 
Right, but when you have only an ex4/ex5 for which you need to get the signals, you don't have choice.
 
Nelson Wanyama:

This method of drawing is not possible to detect using an expert adviser. 

You need to use indicator_plot and plot_set_property to do that. Then you can read buffer values changes to detect presence of arrows. 

Dm for help.

You have disabled your DM

Reason: