Czy mozliwe jest umieszczenie tekstu centralnie na wykresie?
Mam taki kawalek kodu i chcialbym aby przy zmianie rozmiaru okna tekst byl wyswietlany zawsze centralnie w poziomie, jak to zrobic?
Kod: Zaznacz cały
#property indicator_chart_window
extern color TextColor = Black;
//----
int init()
{
ObjectCreate( "Text", OBJ_LABEL, 0,0,0,0,0,0,0);
ObjectSet( "Text", OBJPROP_CORNER, 0);
ObjectSet( "Text", OBJPROP_XDISTANCE, 400);
ObjectSet( "Text", OBJPROP_YDISTANCE, 12);
ObjectSetText( "Text", "", 25, "Arial", TextColor);
return(0);
}
//----
int deinit()
{
ObjectDelete("Text");
return(0);
}
//----
int start()
{
ObjectSetText("Text","text", 25, "Arial", TextColor );
return(0);
}
//+------------------------------------------------------------------+