ObjectCreate() not placing objects like it should

 

Hi, when used as mql5 in the following code why does Example 2 display objects on chart okay but, in Example 1 it does not?

int start()
{   
   datetime TIME = iTime(NULL,0,1);
   double PRICE = iOpen(_Symbol,_Period,1);
   string ART = "art "+TimeToString(TIME);
   string ART2 = "art2 "+TimeToString(TIME);

   if(PRICE>0.0)
   {
      // Example 1     
      ObjectCreate(0,ART,OBJ_ARROW,0,0,0); // ,TIME,PRICE
      ObjectSetInteger(0,ART,OBJPROP_ARROWCODE,233); 
      ObjectSetInteger(0,ART,OBJPROP_XDISTANCE,355); 
      ObjectSetInteger(0,ART,OBJPROP_YDISTANCE,247);
      ObjectSetInteger(0,ART,OBJPROP_COLOR,clrRed);
      ObjectSetInteger(0,ART,OBJPROP_WIDTH,3); 
   }
     
   if(PRICE>0.0)
   {
      // Example 2    
      ObjectCreate(0,ART2,OBJ_ARROW,0,TIME,PRICE);
      ObjectSetInteger(0,ART2,OBJPROP_ARROWCODE,233);
      ObjectSetInteger(0,ART2,OBJPROP_COLOR,clrRed);      
      ObjectSetInteger(0,ART2,OBJPROP_WIDTH,3);
   }

   return(0); 
}
 
Well... Think again.

Your first example Sets coordinates to what exactly?

You set them to zero.

Where on the chart is that?
 
An arrow is not a label. Your X/Y calls are meaningless/ignored.
 
William Roeder #:
An arrow is not a label. Your X/Y calls are meaningless/ignored.

In the mql4 version i wrote the following and it worked okay 

if(PRICE>0.0)
{
  // TP1 Arrow Colour Change & Tick      
   ObjectSetInteger(0,"tp1",OBJPROP_COLOR,TakeProfitColor);
   ObjectCreate("artp1",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("artp1",OBJPROP_XDISTANCE,xdist);
   ObjectSet("artp1",OBJPROP_YDISTANCE,47);
   ObjectSetText("artp1",CharToStr(252),16,"Wingdings",TakeProfitColor);
}

Using OBJ_LABEL worked with OBJPROP_XDISTANCE okay and using ObjectSetText() i was able to make the winding 252 appear

But ObjectSetText() i cant find in mql5? Thats the problem? When i use OBJ_LABEL I cant find a way to use the windings?   

On viewing https://www.mql5.com/en/articles/81 i can see ObjectSetText() but it looks like i use ObjectSetInteger but i cant see how to get the windings using ObjectSetInteger()?

Migrating from MQL4 to MQL5
Migrating from MQL4 to MQL5
  • www.mql5.com
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
Reason: