Y_Distance Problem

 

Hello friends, today I get this error that I have never encountered before.

Two objects, with the same Y coordinates, remain positioned at a different distance from the margin.


What can this be due to? Same font, size, and position, but it's misaligned. Very thanks


   string LEVERAGE=(string)AccountInfoInteger(ACCOUNT_LEVERAGE);
   ObjectCreate(0,"Leverage",OBJ_LABEL,0,0,0);
   ObjectSetString(0,"Leverage",OBJPROP_TEXT,"Leverage:  1:"+ LEVERAGE );
   ObjectSetString(0,"Leverage",OBJPROP_FONT,"Arial Black");
   ObjectSetInteger(0,"Leverage",OBJPROP_COLOR,Color2);
   ObjectSetInteger(0,"Leverage",OBJPROP_CORNER,CORNER_LEFT_LOWER);
   ObjectSetInteger(0,"Leverage",OBJPROP_FONTSIZE,FontSize);
   ObjectSetInteger(0,"Leverage",OBJPROP_XDISTANCE,30 + DashBoard_X+300);// simplify this
   ObjectSetInteger(0,"Leverage",OBJPROP_YDISTANCE,15);
   ObjectSetInteger(0,"Leverage",OBJPROP_SELECTABLE,true);
   ObjectSetInteger(0,"Leverage",OBJPROP_SELECTED,true);
   ObjectSetInteger(0,"Leverage",OBJPROP_HIDDEN,false);
  
double day = Profits_Generados(PERIOD_D1,1440 * 60);
   string Generated_Profits = EA_Comment + "1";
   if(ObjectFind(Generated_Profits) == -1)
     {
      ObjectCreate(Generated_Profits, OBJ_LABEL, 0, 0, 0);
      ObjectSet(Generated_Profits, OBJPROP_CORNER, CORNER_LEFT_LOWER);
      ObjectSet(Generated_Profits, OBJPROP_XDISTANCE, 20+ DashBoard_X);
      ObjectSet(Generated_Profits, OBJPROP_YDISTANCE, 15);

     }
   ObjectSetText(Generated_Profits, "Profit Day: " + DoubleToStr(day, 2), FontSize, "Arial Black", Color2);
 
Check the anchor points.
 
Keith Watford #:
Check the anchor points.


Thank you sir Keith, that solved the problem. Although it is true that I do not understand what generated that problem.

Thank you very much for your help, it has been a pleasure, with the help of this type it is a pleasure to work