Download MetaTrader 5

Please help with code:)

To add comments, please log in or register
Marta.Toren
91
Marta.Toren  
   void arr()
  
{
   string up_arrow=TimeCurrent();
   datetime time=TimeCurrent();
   double lastOpen[1];
   int close=CopyClose(Symbol(),Period(),0,1,lastOpen);

   if(close>0&&iBarShift(NULL,0,time_l)>0)
     {
      ObjectCreate(0,up_arrow,OBJ_ARROW,0,0,0,0,1);
      ObjectSetInteger(0,up_arrow,OBJPROP_ARROWCODE,136);
      ObjectSetInteger(0,up_arrow,OBJPROP_TIME,time); 
      ObjectSetDouble(0,up_arrow,OBJPROP_PRICE,lastOpen[0]);
      ObjectSetInteger(0,up_arrow,OBJPROP_COLOR,White);     
      ChartRedraw(0);  
      time_l=TimeCurrent();   
      
     }}

Hi, I would like to draw an arrow, but I can't(
Thanks in advance:)

Mohammad Hossein Sadeghi
1119
Mohammad Hossein Sadeghi  
Marta.Toren:

Hi, I would like to draw an arrow, but I can't(
Thanks in advance:)

Maybe the arrow color is the same as chart background, so it is invisible?
Yohana Parmi
3547
Yohana Parmi  
Marta.Toren:

Hi, I would like to draw an arrow, but I can't(
Thanks in advance:)


Hi Marta,

You did it :)




void arr()
{
   string up_arrow=TimeToString(TimeCurrent());
   ........

   if(close>0&&iBarShift(_Symbol,_Period,time_l)>0)
   {
      .......
      ObjectSetInteger(0,up_arrow,OBJPROP_COLOR,clrDarkOrange);     
      .......   
   }
}


To add comments, please log in or register