If pixel is what you need, here's a workaround using font labels. It's from Clock indicator by P4L.
PS: The letter 'g' in Webdings font is a rectangle.
// inside start() CreateBackground("BgroundGG","ggggggggggggggggggggg",BgroundFontSize,Corner,DisplayNudgeX-5,DisplayNudgeY-4); // function int CreateBackground (string backName, string text, int Bfontsize, int LabelCorner, int xB, int yB) { if(ObjectFind(backName) == -1){ ObjectCreate(backName, OBJ_LABEL, 0, 0, 0, 0, 0);} ObjectSetText(backName, text, Bfontsize, "Webdings"); ObjectSet(backName, OBJPROP_CORNER, LabelCorner); ObjectSet(backName, OBJPROP_BACK, false); ObjectSet(backName, OBJPROP_XDISTANCE, xB); ObjectSet(backName, OBJPROP_YDISTANCE, yB ); ObjectSet(backName, OBJPROP_COLOR, BgroundColor); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There's no way to set the background color of a text object (OBJ_LABEL or OBJ_TEXT) that I can find. A workaround would be to draw an OBJ_RECTANGLE with background property set true. This is all well and good when these objects are in a fixed location on the chart. I want to be able to specify screen loaction in the EA parameters to move the box/text objects - the problem is that text objects use pixel offsets for placement and rectangle object uses a time/price to determine screen location. Does anyone have an algorithm to convert time/price to pixels (or vice-versa)? Can it even be done using only MQL4 syntax? I don't see any built-in functions/properties to get it done.
Thanks!