fxDreema

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

    ATR related lot size?

    Questions & Answers
    3
    7
    1868
    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.
    • F
      Frewster last edited by

      Hello,

      I am relatively new to the site so please excuse me if this has been answered, I have looked for a post like this but can not find it.

      I am looking to determine a lot size for each entry using the ATR value. The calculation looks like this

      ATR value x 1.5 = x
      100/x= lot size

      I have tried to used the Custom Value/Indicator/Adjust options on a pending order but I can not get it to open the correct size trade.

      If anyone could help that would be great!

      Cheers

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

        You need to use a variable in the calculation, follow these steps:

        1. Create the variable (you can choose the name, I just used "variable"):
          0_1550857492035_499d30d3-6055-4ef7-bfc5-642b6d737faa-image.png

        2. Modify your variable with "modify variables" block. Right-click in the field to select your variable. Put ATR in there, and then "adjust" the value by multiplying by 1.5. Then adjust the variable a second time, "variable" becomes 100/"variable"
          0_1550857678526_4f5f8ef4-ced6-4583-8437-d7bc9fd20119-image.png

        3. Use a variable lot size, again by right-clicking the field:
          0_1550857749526_25183a43-e488-4838-bbf3-05b5d22b68ab-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

        F fxDreema 3 Replies Last reply Reply Quote 0
        • F
          Frewster last edited by

          Awesome! Thank you so much. I love learning this stuff so I really appreciate your time.

          So we are basically creating a variable, doing the calculation then inserting the variable to where I need it!

          The only thing that I am sticking with is the adjusting the variable a second time. I am unsure how I get that box up to do the second adjustment.

          Thank you once again

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

            @roar

            Hey Buddy,

            I found a way to adjust the second time. Add a pass block, is that what you suggested I do?

            https://fxdreema.com/shared/CZ6xDk7Sc

            Cheers

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

              @roar

              Okay apologies for the updates, I found the tab to press to adjust the Variable again. Im just learning so there are stupid questions galore and commentaries of fumbling around!

              Cheers

              roar 1 Reply Last reply Reply Quote 1
              • roar
                roar @Frewster last edited by

                @frewster
                Yeah the adjust variables thingy pops up when you click the tab. You're a very fast learner, it took me a year to learn this lol 😄
                The white box means adjusting before the main block does its work,
                and the orange (or yellow) box is adjusting after the main block does its work. So, in this case we want to use the orange adjust

                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
                • fxDreema
                  fxDreema @roar last edited by fxDreema

                  By the way, there is one undocumented thing you can do in Adjust. Normally we start with +, -, * or / and the things we write in this field are put somewhere in the code after the value. For example, let's say the value is called ATR. Then we write + 0.1. At the end we have something like this:

                  ATR = ATR + 0.1
                  

                  ...where the ATR = ATR part is outside our reach, only the + 0.1 part is added.

                  One day I added new functionality. Let's write = $ + 0.1. Then the result will be the same:

                  ATR = ATR + 0.1
                  

                  but now we control the whole = ATR + 0.1 part. The dollar symbol is replaced with the variable that represents the indicator or whatever it is. In my example this is ATR. But let's make it different. Let's write = 2 * $ in Adjust. Then we will have something like this:

                  ATR = 2 * ATR
                  

                  Some example here: https://fxdreema.com/shared/UNvVIVJJ

                  The important thing here is to start with =. Some people doesn't even write + or - or whatever. By default, if the contents in Adjust doesn't start with +, -, *, / or =, then + is used.

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

                  Online Users

                  A
                  T
                  T
                  D
                  N
                  F

                  21
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors