fxDreema

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

    On Trade issue

    Questions & Answers
    2
    28
    8358
    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.
    • fxDreema
      fxDreema last edited by

      I think there was a bug in "modify stops" some weeks ago, maybe because of that you needed to set TP.

      I am testing it now and I saw the problem 2-3 times, but then it disappeared and I don't know why 🙂

      1 Reply Last reply Reply Quote 0
      • J
        josecortesllobat last edited by

        Hello @fxDreema

        I am running your simple EA with one of my MT5 demo accounts and the behavior is the same as I got. When the #11 is closed, there is no SL move and the TP of the #12 has been changed to 0.00000. Take a loot at the picture

        0_1528393699385_OnTrade_1.jpg

        Then, we have different issues:

        • SL has not been modified as expected. There is no error logged in the journal. TP1 is 5 pips away from the OpenPrice and the broker does not have a minimum SL.

        • TP has been modified to 0.00000 as I got sometimes when "No change" option is set for "modify stops" block. For this reason I was using a variable to keep the TP of the trades unchanged.

        0_1528394331964_59663a99-0f06-4915-9e4a-462da0c1cf79-image.png

        Thanks for your support on this issue.

        1 Reply Last reply Reply Quote 0
        • J
          josecortesllobat last edited by

          Hi @fxDreema

          Here you have another example with different result

          0_1528470071519_OnTrade_2.jpg

          In this case the EA is running in a demo account of the same broker. It is not the same account than the one of the example above but it is supposed that both should have the same behavior.

          It seems that the EA behavior was as expected in three trades but not in the lastest one. I am running the EA alone. In the example above, the EA was added to an EAs portfolio in the same client. This could mean that the issue might be related to the broker or the platform. Because the code is the same in both cases but now we are getting better behavior.

          Anyway, it is good that @fxDreema is investigating the issue.

          Thanks

          1 Reply Last reply Reply Quote 0
          • J
            josecortesllobat last edited by

            Hi @fxDreema

            Here you have a new example with a behavior not as expected

            0_1528472034107_OnTrade_3.jpg

            Then, while you get the result of your investigation, it seems that the issue might be related to the broker &/or the platform because it seems as if the order to modify the SL after "Position closed" detection was not sent.

            Thanks

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

              Is the problem still present, because few days ago I uploaded some update? The problem was not very easy to investigate and I'm not sure what else could be wrong now. There was a problem in the function where I detect the type of "Trade" events. Basically I count the number of orders, deals and positions and decide whether something new was created or removed. MetaTrader 5 is unfortunately very very confusing and every time I feel that I'm hacking it instead of using the rules from its documentation. Everything is very strange. These problems happened because outside the Tester, when you are doing "modify" of a position, the count of orders changes few times... and this never happens in the Tester, something that I never knew.

              But for you, I think that you better make the EA with partial close instead of these rules.

              1 Reply Last reply Reply Quote 0
              • J
                josecortesllobat last edited by

                Hi @fxDreema

                Thanks for helping.

                I will compile again the EAs in order to check if the behavior is the same with the updates and I will let you know.

                Yes, I do. I am working in building a similar EA with the partial close.

                I encourage you to continue investigating the issue because I found very useful and easy to work with "OnTrade" section of the builder.

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

                  Today I uploaded few fixes again

                  1 Reply Last reply Reply Quote 0
                  • J
                    josecortesllobat last edited by

                    Thanks @fxDreema

                    I will compile again the EAs to check out their behavior.

                    Working with Partial Close works pretty well and I am getting similar results than using "OnTrade" conditions to move the SL.

                    Go on with your hard work improving the builder.

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

                    Online Users

                    J
                    A
                    Z
                    T
                    B
                    A

                    14
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors