fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    "Draw Text" block - Text placement by "X coordinate" and "Price"

    Questions & Answers
    2
    2
    2032
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      safv6 last edited by

      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

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        This block creates one of these objects:
        https://docs.mql4.com/constants/objectc ... t/obj_text
        https://docs.mql4.com/constants/objectc ... /obj_label

        In 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

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        Online Users

        H
        E
        J
        S
        W

        16
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors