fxDreema

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

    Serious bug in this EA

    Bug Reports
    2
    7
    2596
    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.
    • isp00rt
      isp00rt last edited by isp00rt

      This EA I'm working with takes a random SL from one chart and then uses it for other charts.

      https://fxdreema.com/shared/nievS41Hc

      Look at this image:

      0_1532615034541_01.png

      The bottom trade was the first one to be opened with that stop level. As you can see its SL level was 'caught' I don't know why and then used in other two charts. However the EA worked well in all other charts. This is certainly a bug.

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

        Before everything else, make sure that you have "For each Trade" above everywhere you are using another pink block or that pink thing in Condition.

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

          I did it as you suggested but it doesn't work properly yet. This the new structure now:

          https://fxdreema.com/shared/oHOYeAtsc

          Now all 'pink' things have a 'For Each Trade' above except on blocks 12 and 13. I don't know why but they already work correctly. The problem now is that blocks 48 and 49 are not catching the price levels they should. It is true that no more alien SL levels are taken from other charts. Now they are caught from the current chart, but incorrectly.

          I show some examples. As you can see I added a comment block in which I show all relevant SL levels for the EA: the initial one, the one related to the MA and finally the one activated by the trail stop.

          First example:

          0_1532940381763_01.png

          Here the trailing stop value is exactly the same as the MA one. As the trail stop conditions were not met at this point, it should be 0 but I took the wrong value.

          Second example:

          0_1532940430711_02.png

          Similar situation, but in this case the value taken is the initial SL. As in the previous case, it should be 0.

          Third example

          0_1532940446442_03.png

          In this case the trailing stop effectively moves as required (upper red line), but the value caught is still the one corresponding to the MA.

          All blocks are functioning correctly except those planned to take the real value of the Trailing stop.

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

            Could you fix the problem? This problem still persists 😞

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

              Each Trailing stop block has a loop inside, it loads each existing trade and checks whether or not its SL needs to be moved. If you have 10 trades at the moment, it will check all of them. If you have 1 - it will check only that one. And if SL of some trade needs to be moved, it is moved. When the loop finishes and all trades are checked and their SL moves, then the orange output becomes active. But the orange output becomes active even if there are no trades in the loop at all. This output always passes, it's like that "Pass" block. Trailing stop just does its thing and doesn't care for the other blocks around.

              I think that you expect that block 23 would pass only when SL of the trade is moved. But remember, this block has it's own loop inside that is designed to work with multiple trades, it doesn't care if you have only 1. You can work with 1 trade at a time, but MetaTrader is still capable of putting 10s and 100s of trades, so the Trailing stop block is designed with that in mind. That's why it has (each trade) in its name, this means that the block does something over each trade. And because it can move SL of 1, 2, 3... or 0 trades, and in any case it will do its job, the output is not related to any trade. The output is used only to be able to connect multiple blocks.

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

                Take a look at this example that shows how to make simple trailing stop out of pink blocks:
                https://fxdreema.com/demo/mt4-loop-trailing-stop

                In this case we have 3 blocks. The blue Trailing stop block is like all 3 pink blocks combined + more. The situation is something like this, imagine that the blue rectangle is a "Trailing stop (each trade)" block:
                0_1533493239827_82f32459-609b-4f27-a9a7-29cfaeb24fbe-image.png

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

                  Thank you very much for your explanation. Now I understand it much better. I will try what you suggest.

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

                  Online Users

                  M
                  P
                  R
                  S
                  E
                  M
                  P
                  C

                  20
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors