Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

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!

Posted
In case anyone is interested, I found a way to do this by using two OBJ_LABEL objects. The first contains the text I want displayed, the second uses the Webdings font 'g' character which is shaded rectangle that takes the entire character space. You can either set the Webdings object to a large font size for one large box or set a string of 'g's which gives you more flexibility in box shape.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...