fxDreema

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

    Partial TP

    Questions & Answers
    3
    11
    2966
    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.
    • M
      martin 1 last edited by

      Hello Coders,

      I tried to use the "close (psrtially)". There I have a problem.

      For example: open position 0.33 lots - close 50% = 0.165 lots to close

      In this case I am getting an error because 0.165 lots cant be traded.

      How can I round the lot size?

      Best regards,
      Martin

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

        I think you are asking how Not to round the lot size, but I am afraid this is impossible, because there is something called Lot Step and means that there is a minimum step for the lot sizes. If the lot step is 0.01, then you can trade 0.16 or 0.17, but not 0.165.

        1 Reply Last reply Reply Quote 0
        • M
          martin 1 last edited by

          Hello FXDreema,

          I had an older version of an ea made by FXDreema. It worked fine.

          For example: close (partially) = 50% - position 0.33 lots - close 0.17 lots and still open position 0.16 lots

          After a new compiling it works in a differend way - it tries to close 0.165 lots and this is impossible because of the lot step.

          Have you changed something..... maybe an update?

          I will change it and dont use the close (partially) box.

          Maybe you can take a look at this.

          Best regards,
          Martin

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

            I made this: https://fxdreema.com/shared/lkWMP1hAd
            And this is the result for me: 0_1545070229403_3f8af002-c4ff-460a-b8b9-d7848027407f-image.png

            What are you working at - MT4 or MT5? Can you give me similar simple example that can show me the problem on my MT?

            1 Reply Last reply Reply Quote 0
            • M
              martin 1 last edited by

              Hello FXDreema,

              thank you for your message. I am working with MT5 netting mode.

              0_1545073943583_1ba4b90a-394e-4e80-95cc-763952448d53-image.png

              I took your example and have the same problem. It opens 0.33 lots ...... tries to close 0.165 lots...... after opening additional 0.33 lots it can close 0.33 lots.

              Best regards,
              Martin

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

                What is the volume step for this symbol?

                1 Reply Last reply Reply Quote 0
                • M
                  martin 1 last edited by

                  Hi,

                  the step is 0.01 but the box calculates 0.001.

                  I have found a solution. I calculate the right lot size and close the order separatelly.

                  Best regards,
                  Martin

                  E 1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    Well, the EA is programmed to see the lot step and round the number if needed. I don't even remember someone with this problem before. I wonder why it happens to you

                    1 Reply Last reply Reply Quote 0
                    • E
                      eklonsousa @martin 1 last edited by

                      @martin-1 @fxDreema

                      I`m facing the same issue as described here .

                      could you help me with this?

                      @fxDreema said "the EA is programmed to see the lot step". I'm working with several instruments as Forex Pais, Comoddities and index...
                      Some lot step are 0.10, another 0.50....
                      And I'm getting a lot of "Invalid volume" while partial close.
                      And the parcial close % depends of each instrument. Some are 50%, others 65%. Others 88%.
                      I mean...I need to find a way to get this partial close working.

                      Could you please help me?

                      Thank you so much!

                      1 Reply Last reply Reply Quote 0
                      • M
                        martin 1 last edited by

                        Hi,

                        I solved the problem with an own calculation of the lot size to close.

                        Use Cusom mql code: mathround

                        Best regards,
                        Martin

                        E 1 Reply Last reply Reply Quote 0
                        • E
                          eklonsousa @martin 1 last edited by

                          @martin-1 Great, Martin!

                          Please, could you share an example using mathround code?

                          Thank you so much!

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

                          Online Users

                          B
                          A
                          T
                          M
                          E
                          C

                          19
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors