fxDreema

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

    take profit modified into martingale strategy

    Questions & Answers
    3
    3
    169
    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.
    • A
      angelo2 last edited by angelo2

      good evening guys, some information. Can anyone decipher this for me on fxdreema? Thank you

      tp=NormalizeDouble(last_open(OP_BUY)+(TakeProfitPointPOINTX),Digits);

      this is the take profitt for strategy martingala

      @l-andorrà
      @fx-dreema

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

        The normalised double part will just remove extra 0's by the number of digits in the pair/asset, using the last buy open price added to the take profit distance. Not sure what POINTX is, on FX you can add code, but might be better to recreate. TakeProfitPointPOINTX might be the name of a variable

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

        1 Reply Last reply Reply Quote 0
        • J
          JamieCisneros last edited by

          The code you provided calculates the take profit price for a strategy using the Martingale approach. Here’s a breakdown:
          NormalizeDouble() ensures that the value is within the allowed range of double values in MQL4/MQL5.
          last_open(OP_BUY) gets the Open price of the last opened buy order.
          TakeProfitPointPOINTX is a constant that represents the take profit value in points.
          Digits is the number of decimal places used for the symbol’s price.
          Calculation:
          The take profit price is calculated by adding the TakeProfitPointPOINTX value (in points) to the Open price of the last buy order and then normalizing the result to ensure it’s within the allowed range.

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

          Online Users

          A
          A
          L
          G
          N
          S
          E
          S

          18
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors