How to draw an arrow on the graph ?

 

Hi,

I would like my EA to draw an arrow on the graph when there is a signal of buy. I use Ichimoku for the signal...

int start()
{
   if (senkouA>=senkouB && Bid > senkouA && Chikou_value> Bid)
   {
      if (Tenkan_value==Kijun_value)
      {
         draw an arrow ??????????????????????????????????,
      }
   }
   if (senkouA<=senkouB && Bid > senkouB && Chikou_value> Bid)
   {
      if (Tenkan_value==Kijun_value)
      {
         draw an arrow ??????????????????????????,
      }
   }
}
Any idea ?

Aymeric

 

Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

 
AYMERIC:

Hi,

I would like my EA to draw an arrow on the graph when there is a signal of buy. I use Ichimoku for the signal...

Any idea ?

Aymeric

https://book.mql4.com/functions/objects
 

I posted some example code in YOUR thread at https://forum.mql4.com/62487

So I assume that you have read it and that code includes drawing arrows.

 
AYMERIC:

Hi,

I would like my EA to draw an arrow on the graph when there is a signal of buy. I use Ichimoku for the signal...

Any idea ?

Aymeric


As GumRai posted earlier, use his code to instruct your ea too draw arrows :

   if (senkouA>=senkouB && Bid > senkouA && Chikou_value> Bid)
   {
      if (Tenkan_value==Kijun_value)
      {
         //draw an arrow ??????????????????????????????????,
       string name="FXX_IchiupArrow"+(string)Time[0];
       if(ObjectFind(0,name)!=0)
          {
          ObjectCreate(name,OBJ_ARROW_UP,0,Time[0],Low[index]-(Period()*Point*2));// Time[0] since you are talking about current bar
          ObjectSet(name,OBJPROP_COLOR,ArrowColour);
          ObjectSet(name,OBJPROP_WIDTH,ArrowSize);
          ObjectSetInteger(0,name,OBJPROP_ANCHOR,ANCHOR_TOP);
          }
      }
   }

Give it a name, a color, size and that's that.

And if you don't understand or not sure about how and why, ask if you want to learn

Cheers

Reason: