Download MetaTrader 5
To add comments, please log in or register
Create interesting Forum topics concerning the automated trading!
Teeva Franssen
516
Teeva Franssen 2015.04.15 15:45 

I keep getting this error message when trying to test my EA:


LabelCreate: failed to create text label! Error code = 4200 

 

Any idea how to fix this? 

Eduard Vavrin
843
Eduard Vavrin 2015.04.15 15:51  

Hello.

Attach here your source code please to let us solve the problem.

Teeva Franssen
516
Teeva Franssen 2015.04.15 16:23  
Toster:

Hello.

Attach here your source code please to let us solve the problem.

Here:

 

//+------------------------------------------------------------------+
//| Create a text label                                              |
//+------------------------------------------------------------------+
bool LabelCreate(const long              chart_ID=0,               // chart's ID
                 const string            name="Label",             // label name
                 const int               sub_window=0,             // subwindow index
                 const int               x=0,                      // X coordinate
                 const int               y=0,                      // Y coordinate
                 const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER, // chart corner for anchoring
                 const string            text="Label",             // text
                 const string            font="Arial",             // font
                 const int               font_size=8,              // font size
                 const color             clr=clrWhite,             // color
                 const double            angle=0.0,                // text slope
                 const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER, // anchor type
                 const bool              back=false,               // in the background
                 const bool              selection=false,          // highlight to move
                 const bool              hidden=true,              // hidden in the object list
                 const string            tooltip="\n",             // sets the tooltip
                 const long              z_order=0)                // priority for mouse click

 

 {
      string namep = "Lbl_prm_"+IntegerToString(i);
      string namev = "Lbl_val_"+IntegerToString(i);
      LabelCreate(0,namep,0,paramsX,locationY,CORNER_LEFT_UPPER,m_DynamicInfoParams[i]);
      LabelCreate(0,namev,0,valuesX,locationY,CORNER_LEFT_UPPER,"");
      locationY+=12;
     }

   LabelCreate(0,"Lbl_pos_0",0,350, 0,CORNER_LEFT_UPPER,"","Ariel",10);
   LabelCreate(0,"Lbl_pos_1",0,350,15,CORNER_LEFT_UPPER,"","Ariel",10);
   LabelCreate(0,"Lbl_pos_2",0,350,29,CORNER_LEFT_UPPER,"","Ariel",10);

 

Eduard Vavrin
843
Eduard Vavrin 2015.04.15 17:00  

Please attach entire file. There are some mistakes in compilation of code you wrote.

Biantoro Kunarto
13770
Biantoro Kunarto 2015.04.16 15:21  
muplayer2000:

I keep getting this error message when trying to test my EA:


LabelCreate: failed to create text label! Error code = 4200 

 

Any idea how to fix this? 

That error id show that the object already exists

4200

ERR_OBJECT_ALREADY_EXISTS

Biantoro Kunarto
13770
Biantoro Kunarto 2015.04.16 15:25  

You can add this command :

      
   if ( ObjectFind(0,"Lbl_pos_0") < 0 )
      LabelCreate(0,"Lbl_pos_0",0,350, 0,CORNER_LEFT_UPPER,"","Ariel",10);
   
   if ( ObjectFind(0,"Lbl_pos_1") < 0 )
      LabelCreate(0,"Lbl_pos_1",0,350,15,CORNER_LEFT_UPPER,"","Ariel",10);
   
   if ( ObjectFind(0,"Lbl_pos_2") < 0 )
      LabelCreate(0,"Lbl_pos_2",0,350,29,CORNER_LEFT_UPPER,"","Ariel",10); 

But I also wonder, do you mistype the font name "Ariel" ? I think the font name is "Arial".

Teeva Franssen
516
Teeva Franssen 2015.04.29 05:01  
biantoro:

You can add this command :

But I also wonder, do you mistype the font name "Ariel" ? I think the font name is "Arial".

Thank you mate
/
To add comments, please log in or register