fxDreema

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

    How to get the Average Value of the Indicator for nBars

    Questions & Answers
    3
    10
    258
    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.
    • D
      deathkid13 last edited by

      Hi guys, I need help to get the Average Value of the Indicator (e.g ATR) for nBars.

      Example:
      I need to get the Average Value of ATR for 20 Candles.

      You can suggest how to do it using Custom Code or Blocks.

      Thanks

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

        This should do it: https://fxdreema.com/shared/HRxqOvjzc

        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! 😊

        D 1 Reply Last reply Reply Quote 0
        • D
          deathkid13 @jstap last edited by

          @jstap thanks so much bro!!

          1 Reply Last reply Reply Quote 0
          • D
            deathkid13 last edited by

            @jstap hello bro, I just wanna ask about something on this code because i don't quite get it.on the For Loop, you put index on the end of iATR but on mt5 documentation it doesnt need candle index parameters but it works. Can you please enlighten me how this works? I don't get it from just the documentations

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

              it sets the atr variable to 0, then loops through and add us the value from the last number or candles in the candle range, then it takes this total number, and divides it by the number or candles in the range giving you the average number over the range.

              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! 😊

              D 1 Reply Last reply Reply Quote 1
              • D
                deathkid13 @jstap last edited by

                @jstap thank you sir! another question sir, what if my Range is based on time?? how do I get my average ATR for that range???

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

                  Try this https://fxdreema.com/shared/Wo2cpuU0e

                  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! 😊

                  l'andorrà 1 Reply Last reply Reply Quote 0
                  • l'andorrà
                    l'andorrà @jstap last edited by

                    @jstap Just curious. Shouldn't the 'Comment' block be connected BELOW the custom code in order to see the updated value of the variable every tick? Your current setting is showing the value of the previous tick instead.

                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

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

                      Comment blocks can be above or below, in fact any block works above or below, you just need to ensure what is above won't affect the block below. If a comment is below a no trade block, it won't work once a trade is placed, but above it will, it will work before the trade is open, and while it's open. Possibly it's 1 tick behind, but this is unnoticeable.

                      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 2
                      • l'andorrà
                        l'andorrà last edited by

                        Ok. Thanks.

                        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

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

                        Online Users

                        J
                        D
                        E

                        20
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors