EA insert arrow?

 

I am trying to let EA inserts arrow if certain circumstance occurs. The code I use is


   if(.......)
      {
      ObjectCreate("Down ",OBJ_ARROW,0,0,0);
      ObjectSet("Down ",OBJPROP_ARROWCODE,234);
      }
But nothing is inserted on the screen...? any help?
 
Don't you need a time and date, and price? Like this:
ObjectCreate("Down", OBJ_ARROW, 0, D'2004.02.20 12:30', 1.0045)
That's what I would try, reading the documentation...
https://docs.mql4.com/objects/ObjectCreate
 
ThomasB:
Don't you need a time and date, and price? Like this:
ObjectCreate("Down", OBJ_ARROW, 0, D'2004.02.20 12:30', 1.0045)
That's what I would try, reading the documentation...
https://docs.mql4.com/objects/ObjectCreate
Yes, this is correct, you have to give coordinates to objects, where x-axis is time and y-axis is price.
 
Thanks a lot.
I got it now right.
I thought if I put 0 in the arrow coordinates, it draws the arrow at the current coordinates (current time and price).

is there a code to change the color of the arrow ?
 
ObjectCreate ("Arrow",OBJ_ARROW,0,TimeCurrent(),Bid);
ObjectSet ("Arrow",OBJPROP_COLOR,White);

It is written nicely in the documentation. I recommend you to read the description of all object functions, before starting to work with objects...
Reason: