"Draw Text" block - Text placement by "X coordinate" and "Price"
-
Hi Radoslav,
I have a question about text placement. Would it be possible to have an fxd EA place a text on the left side of the chart (text placement by X coordinate), right on the green dotted trade line (text placement by price)? I was trying to achieve this using the "Draw Text" block, but it seems my only options are to use either "text placement by time and price", OR "text placement by X and Y coordinates", but not a combination of the two. You see, I'd like to have the text's X coordinate fixed to have the text on the left, no matter the timeframe or zoom factor, but at the same time, the Y coordinate should actually be (slightly above/below) the trade's open price.
Any suggestions would be highly appreciated!
Thanks again and please keep up the good work
Best regards,
Saf
-
This block creates one of these objects:
https://docs.mql4.com/constants/objectc ... t/obj_text
https://docs.mql4.com/constants/objectc ... /obj_labelIn both cases you have X and Y.
- OBJ_LABEL - this object is placed at absolute position over the chart - X and Y are pixel offsets from the upper left corner. You can move the candles, you can zoom in and zoom out... this does not change the position. The spread meter on the bottm is made out of such type of objects.
- OBJ_TEXT - coordinates have absolute position from the candles perspective - X is the Time at which the candle exists and Y is the price. If you move candles, all texts move with the candles, just like all the other arrows.
As you can see, these are two different worlds. I don't know how to find the X/Y offset as pixels from the upper left corner of the chart if the object is OBJ_TEXT