fxDreema

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

    Calculating ADR in pips Wrong for JPY Pairs

    Questions & Answers
    2
    6
    991
    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.
    • B
      btrader last edited by

      Hi,
      I'm creating an EA that uses ADR (average daily range) in it's strategy. I'm using the ATR for the daily candle to calculate this which is working fine.
      I need the ADR figure in pips though and have worked out how to do that but my calculations dont work with JPY pairs as the digits are differnt.
      This is the calculation I'm using.
      0_1613560618633_c391bf85-c65f-48b8-9a36-31bc2a830581-image.png
      Basically I get the ATR10 for the daily and *10,000. The raw ADR is shown on the chart and becomes a pip amount with my calculation. All good on pairs that have 5 digits.
      0_1613560721085_58fbbfa6-2ceb-47a5-b82d-0f462c4c00c1-image.png
      With any JPY pair however with 3 digits the ADR raw is higher so my calculation is out. Need to be ATR * 1,000 NOT 10,000.
      0_1613560889044_fd944a6b-5837-4b76-9529-f541f36ac370-image.png
      Is there a way to correct this or an easier way to achieve what I want?
      Maybe an IF ESLE or something block I can use to store that variable differently by detecting if its an XXXJPY pair?

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @btrader last edited by roar

        @breakertrader why do you need pips? Simplest way would be to work with raw values

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        B 1 Reply Last reply Reply Quote 0
        • B
          btrader @roar last edited by

          @roar I need an inpu to set a target which is an amount of pips but based off ADR.
          i.e. half the ADR10 value if 50 would be 25.

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @btrader last edited by roar

            @breakertrader Digits() function returns the amount of decimals of the pair, so we can convert any point amount to raw value multiplying by MathPow(10,-Digits())

            For example, 10 point to raw price: 10*MathPow(10,-Digits())
            Then you can just use 1 pips = 10 points as a final calculation.
            Works with all symbols.

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

            B 1 Reply Last reply Reply Quote 0
            • B
              btrader @roar last edited by

              @roar So how would I implement that in the project?
              https://fxdreema.com/shared/xZfhyTE4e
              The modify variables there saves the ADR as a pip amount. Not sure how to use your formula, not a coder and just working visually with the system. 🙂

              1 Reply Last reply Reply Quote 0
              • B
                btrader last edited by

                Anyone coming across this in the future I found the solution.
                Searched for this but couldnt find it and stumbled across it while reading tutorials. 🙂
                https://fxdreema.com/forum/topic/11003/atr-value-to-pips-tutorial/2
                Handles JPY calculations perfectly.

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

                Online Users

                A
                N
                S
                E
                A
                M
                T
                M
                A
                E
                K

                24
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors