Download MetaTrader 5

How to draw an arrow on the graph ?

To add comments, please log in or register
AYMERIC75
112
AYMERIC75  

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

Alain Verleyen
Moderator
33593
Alain Verleyen  

Hello,

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


This time, I edited it for you.

Alain Verleyen
Moderator
33593
Alain Verleyen  
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
Keith Watford
Moderator
10570
Keith Watford  

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.

Daniel Petrovai
440
Daniel Petrovai  
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

To add comments, please log in or register