I'm editing an indi that prints the previous sessions High & Low & plots them as horizontal trendlines, I'm trying to edit the text that is associated with each line.
The changes I make to the ObjectSetText line don't seem to have any bearing on the format of the text, wondering what I'm doing wrong?
Currently the text defaults in colour to the MT4 'foreground' colour, and strangely the text size is quite big (about 10-12).
void drawTrendLine(string name, double time1, double time2, double price1, double price2, int thickness, color colour, int style, bool background, bool ray, string label = "")
if (ObjectFind(name) != 0)
ObjectCreate(name, OBJ_TREND, 0, time1, price1, time2, price2);
ObjectSet(name, OBJPROP_TIME1, time1);
ObjectSet(name, OBJPROP_TIME2, time2);
ObjectSet(name, OBJPROP_PRICE1, price1);
ObjectSet(name, OBJPROP_PRICE2, price2);
ObjectSetText(name, label, 4, "Arial", DimGray);
From the ObjectSetText() documentation:
For objects of OBJ_TEXT and OBJ_LABEL, this description is shown as a text line in the chart. Parameters of font_size, font_name and text_color are used for objects of OBJ_TEXT and OBJ_LABEL only. For objects of other types, these parameters are ignored.
Yes, besides trend line, put OBJ_TEXT or OBJ_LABEL and you will be able to change font and color of the text.
To add comments, please log in or register