ObjectSetInteger(0, ObjName, OBJPROP_ALIGN, ALIGN_CENTER); ALIGN_LEFT , ALIGN_RIGHT Nothing has changed.

 
void ShowBS(string CodeName, int BarIndex)
{   
    datetime targetTime = iTime(NULL, Period(), BarIndex);
    ObjectCreate(0, CodeName, OBJ_TEXT, 1, targetTime, 9);
    ObjectSetInteger(0, CodeName, OBJPROP_COLOR, clrYellow);
    ObjectSetInteger(0, CodeName, OBJPROP_FONTSIZE, 8);
    ObjectSetString(0, CodeName, OBJPROP_FONT, "Arial");
    ObjectSetInteger(0, CodeName, OBJPROP_ALIGN, ALIGN_CENTER);
    //ObjectSetInteger(0, CodeName, OBJPROP_ALIGN, ALIGN_LEFT);
    //ObjectSetInteger(0, CodeName, OBJPROP_ALIGN, ALIGN_RIGHT);
    ObjectSetString(0, CodeName, OBJPROP_TEXT, "Dj");
    ChartRedraw();
}

Plot "Dj" correctly on SubWindows.But can not ALIGN Text by ALIGN_CENTER or ALIGN_LEFT or ALIGN_RIGHT.

How to do ?

Thank you

 

OBJPROP_ALIGN can only be applied to OBJ_EDIT and ChartScreenShot().

https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property

For the OBJ_EDIT object ("Edit") and for the ChartScreenShot() function, you can specify the horizontal alignment type using the values of the ENUM_ALIGN_MODE enumeration.

 
Vladislav Boyko #:

OBJPROP_ALIGN can only be applied to OBJ_EDIT and ChartScreenShot().

It really solved the problem. Thanks.
This website uses cookies. Learn more about our Cookies Policy.