fxDreema

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

    Add more than two variables

    Questions & Answers
    4
    13
    1802
    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.
    • J
      Jaychyke last edited by

      I have created 15 variables which are the ranges (High minus low) of each of the last 15 candles. Now i want to get the average of the 15 ranges, that is, to add all 15 variables and divide by 15. This average value should be added to the lowest low of the last 15 candles, or minused from the highest high of the last 15 candles. And I need to draw a line for each of the average range lines (two lines, one up and one down), and use them as a support or resistance.
      I only created the variables, I don't know how to preceed from there again. Someone please help!!

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @Jaychyke last edited by

        @jaychyke isn't it the ATR what you are trying to calculate? Something like ATR 15?

        I like to share my knowledge, but expect the others to contribute as well.

        J 1 Reply Last reply Reply Quote 0
        • J
          Jaychyke @trader.philipps last edited by

          @trader-philipps ATR? not necessarily. It's rather the average daily range ADR. But I want to customize it so I could use any timeframe and any number of previous candles. Hence my question. Many thanks for your reply.

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

            This is what you need to calculate each median value per candle and store it on each of your variables:

            0_1579807412683_01.png

            This is just for candle ID 1. You need to do the same for all other candles (from Id 2 to ID 15). Then you would need a custom code block calculating the average value of all those stored numbers. Sadly, I don't know hot that custom cose should be, sorry. 😞

            (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.

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

              You dont need individual variables for each candle, and that method is a bit difficult to scale anyway. First rule of coding is to never repeat yourself. (well thats what I have heard, it's not like I'm some professional coder)

              Use an array! You will have to study a bit, but you really cannot avoid some work given that goal.
              Google mql4 array for instructions.
              https://docs.mql4.com/array

              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

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

                Ok so I actually got very excited about this and figured out the whole thing:
                https://fxdreema.com/shared/UeNF7iqdb
                Seems to be working:
                0_1579814704313_f8a127c5-448e-45af-b440-2b564af6d9c9-image.png

                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

                J 2 Replies Last reply Reply Quote 0
                • J
                  Jaychyke @l'andorrà last edited by

                  @l-andorrà Many thanks for your suggestion. I wish I could do custom codes

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

                    @roar WOW! I can't believe this. Thanks a trilion. Let me check this out

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

                      @roar Very good work!!! Please may I ask if the calculation is based on the last 15 candles? Again, which names will the upper and lower lines be identified with by the EA: "upper bound" as named, or upper range as coded?

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

                        @jaychyke said in Add more than two variables:

                        Please may I ask if the calculation is based on the last 15 candles?

                        Yes it's 15 by default, but you can change it from inputs:
                        0_1579880672801_d3c418de-3d9d-4f84-a8a1-b98f7bce1f0d-image.png

                        Again, which names will the upper and lower lines be identified with by the EA: "upper bound" as named, or upper range as coded?

                        "Upper bound" is the name of that graphical object, "upper range" is the name of the numerical value the object is based on

                        0_1579880858059_a0da5ffd-692c-4c7e-a8f2-897ca34dabba-image.png

                        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

                        J 2 Replies Last reply Reply Quote 0
                        • J
                          Jaychyke @roar last edited by

                          @roar My platform is MT4. How do I copy your compilation as a part of my work in fxdreema, please. Let me know the steps. I'm not techophobic

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

                            @roar see what I've done so far, but the bot is not opening https://fxdreema.com/shared/1HWrUDuTc

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

                              @jaychyke Download the .mq4 and import it again to get the constants and variables done correctly.
                              Alternatively, just copy the blocks and set up these constants and variables manually:
                              0_1580157910176_a0bf4ea7-f920-44e5-8854-b52a049a3d25-image.png
                              0_1580157921686_5405e1a9-5c35-4e51-b656-a618ba0b313b-image.png

                              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

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

                              Online Users

                              S
                              S
                              L
                              E
                              M
                              A
                              H
                              S

                              17
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors