fxDreema

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

    Lots multiplication problem

    Questions & Answers
    3
    42
    2374
    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.
    • C
      Crisfx last edited by

      Good evening everyone, I'm trying to understand how to open a second (third, fourth, etc.) trade when the first is at a loss but using a low multiplication, for example 1.1.

      I'm using "for each trade" and a variable that takes the trade lot and then multiplies it using a formula, but of course it keeps repeating the same size without multiplying it. If you start from 0.01 and multiply by 1.1 the result is 0.011 but is rightly rounded to 0.01. The 0.02 will never be opened since every time the digits from thousandths onwards will be lost.

      Does anyone know the way to do this?

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

        This will happen until you get to 0.1, check the last trade lot, if < 0.1 add 0.01 (or whatever number you find relevant), if => 0.1 multiply

        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
        • C
          Crisfx last edited by

          The point is that I would like to multiply, not add. When the multiplication occurs, for example 0.01 *1.1 = 0.011, there is a way to "write" the exact lot (which will then be rounded by the broker) but the expert will take into consideration the correct size for the next multiplication (with decimals)?

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

            Yes, but you cannot with such a small number from such a small lot. 1.011 would need to be at least 1.016 to = 1.02, so what I put is doing what you asked.

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

            C 1 Reply Last reply Reply Quote 0
            • C
              Crisfx @jstap last edited by

              @jstap Of course this is clear, the problem is by using this method from 0.01 you immediately go to 0.02. Instead, I would really like to respect the sequence by using a multiplication of *1.1 (or *1.2):

              Starting from 0.01: 0.011 / 0.0121 / 0.01331 / 0.014641, only at the fourth multiplication is 0.02 opened
              Starting from 0.02: 0.022 / 0.0242 / 0.02662 at the third multiplication 0.03 is opened and you can continue up to a starting size of 0.05, from then on it would multiply correctly.

              This is very useful for using low lots but continuing to lower the average entry price even with small capital.

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

                I am not sure you understand, the next up from 0.01, is 0.02, if you want 0.015 then you can not achieve this on Meta Trader (maybe some accounts use 0.000) but if so I do not know how to use, or what accounts that would be.

                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
                • A
                  ambrogio @Crisfx last edited by

                  @Crisfx the market has minimum tradable lots, you can see it in your broker's specifications. Almost all brokers do not have sizes lower than 0.01

                  Screenshot (83).png

                  1 Reply Last reply Reply Quote 0
                  • C
                    Crisfx last edited by

                    Of course, I know this, as I wrote in my second post the value will always be rounded up by the broker. I am interested in the expert making the calculation considering the "correct" number multiplied. By doing this, starting from 0.01 and multiplying *1.1, the expert will calculate the next lot at 0.011, the broker will open at 0.01, no problem. However, the expert will have to "know" that the correct lot according to the multiplication was 0.011 and multiply the next trade starting from this value.

                    By doing so, after opening 3 trades at 0.01 he will open the fourth trade at 0.02.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      ambrogio @Crisfx last edited by

                      @Crisfx ah ok, now i understand. You have to create a variable and use it like this (the variable will be reset when there are no trades)

                      1max.PNG

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        Crisfx @ambrogio last edited by

                        @ambrogio This is exactly what I was looking for, thank you very much!

                        A 1 Reply Last reply Reply Quote 0
                        • A
                          ambrogio @Crisfx last edited by

                          @Crisfx 👍

                          C 1 Reply Last reply Reply Quote 0
                          • C
                            Crisfx @ambrogio last edited by

                            @ambrogio I tried in the demo to simulate a crash/restart/update of MT4 when it already had trades in progress, the problem is that the correct multiplication does not continue:

                            Let's imagine we started from 0.01 and multiplied *1.1
                            1 trade 0.011 broker rounds to 0.01
                            2 trades 0.0121 broker rounds to 0.01
                            3 trades 0.01331 broker rounds to 0.01
                            4 trade 0.014641 broker rounds to 0.01
                            5 trades 0.0161051, the broker rounds to 0.02

                            If at this moment a crash or restart of MT4 occurs, the variable is lost and it starts again from 0.01.

                            1 Reply Last reply Reply Quote 0
                            • A
                              ambrogio last edited by

                              this is beyond my knowledge, I think jstap suggested something somewhere about global variables, I suggest you to do a search or tag him directly

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

                                You can use this, only check the lot before using, or use global variables: https://fxdreema.com/shared/AvGd9ic5c

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

                                C 1 Reply Last reply Reply Quote 0
                                • C
                                  Crisfx @jstap last edited by

                                  @jstap Where should these 2 blocks be added? The following error appears: 'Round_from' - undeclared identifier
                                  'Round_from' - undeclared identifier

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

                                    Show your project, but exactly how they are in my project

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

                                    C 1 Reply Last reply Reply Quote 0
                                    • C
                                      Crisfx @jstap last edited by Crisfx

                                      @jstap https://fxdreema.com/shared/h3ocNTZRc

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

                                        Did you save Round_from as a constant with a value? This needs to be the lot value you are correcting:
                                        image.png

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

                                        C 1 Reply Last reply Reply Quote 0
                                        • C
                                          Crisfx @jstap last edited by

                                          @jstap Ok I tried inserting the same constant that I use to open the first trade called "Lots" instead of "Round_from". I tried but the error is always the same, when I have to open another trade as specified as distant from the pips away block, the error appears that the minimum lot is 0.01 from the broker.

                                          https://fxdreema.com/shared/n5rwoqn4

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

                                            I get no error from this, it compiles as expected. Correct the crazy block numbers. What blocks are you trying to use it in? If I were you I would start from scratch, and get this working on a small project, then add other logic to it.

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

                                            C 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post

                                            Online Users

                                            V
                                            C
                                            K
                                            A

                                            23
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors