fxDreema

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

    BUG (On Trade Event)

    Bug Reports
    2
    15
    3018
    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.
    • O
      owneroxxor last edited by

      Dreema, look at this: http://prntscr.com/al8toa

      My EA is working perfectly. But, when I put anything on the "On Trade Event", it crashes, right in the close of the first trade it makes:
      http://prntscr.com/al8v9l

      What I wanna do is a Money withdraw after every order closed. This "money withdraw" would simulate de comissions paid into the backtests.

      Know something better to do this? Can we fix this bug?

      ty

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

        Wow, this error shows some Assembly code! This was bug in the MQL4/MQL5 compiler. I updated it and not it should work. But because they also changed the way files are compiled (now metaeditor.exe is used instead of a standalone mql.exe file), I expect other problems when compiling files 🙂

        1 Reply Last reply Reply Quote 0
        • O
          owneroxxor last edited by

          Nice! the assembly bug is gone.
          Now got a new one, look at this: http://prntscr.com/alkfib

          Ok, when some position get closed by the "Close positions" blue box into somewhere into by "On Tick Event", it activates the Screenshots's purple block "Position Closed" on the "On Trade Event" tab and it gets traced by the pink line and the withdraws are made perfectly.

          BUT, when the positions gets closed by a STOP LOSS, it does not activates the the "Position Closed" box, and it does not make the withdraws of the comissions. Look: http://prntscr.com/alk8ff

          The "Position Closed" purple block is not recognizing Stop-loss closed positions.

          Can be fixed or made in another way?

          ty

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

            What information do you have here: http://prntscr.com/aln6cn

            At least on backtesting, this works for me - https://fxdreema.com/shared/QiVNz2cbc

            1 Reply Last reply Reply Quote 0
            • O
              owneroxxor last edited by

              http://prntscr.com/alpc1g

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

                Ok, I need glasses 8-)

                Anyway. It's had for me to say what is wrong. It appears to be working for me - http://prntscr.com/alpk13 I don't know... look for errors in the log?

                1 Reply Last reply Reply Quote 0
                • O
                  owneroxxor last edited by

                  Dude, help me, I really think there is something going wrong here.

                  Looking at this SS, we se two stop-losses trade happening at the same day: http://prntscr.com/alqjim

                  The first stop-loss trade did not pass the "Position Closed" block. But the second did. 😮
                  You can see the blue dot that shows that the "On Trade event" tab got activated correctly, but, somehow, the just the second trade got passed in the "Position Closed" block. 😐

                  Btw, no other SL positions passed the "Position Closed" block after this succesfull one 😮

                  How could it be explained? 😮

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

                    Is it working for something like EURUSD?

                    1 Reply Last reply Reply Quote 0
                    • O
                      owneroxxor last edited by

                      Dude, help me, I really think there is something going wrong here.

                      Looking at this SS, we see two stop-losses trades happening at the same day: http://prntscr.com/alqjim

                      The first stop-loss trade did not pass the "Position Closed" block. But the second did. 😮
                      You can see the blue dot that shows that the "On Trade event" tab got activated correctly, but, somehow, the just the second trade got passed in the "Position Closed" block. 😐

                      Btw, no other SL positions passed the "Position Closed" block after this succesfull one 😮

                      How could it be explained? 😮
                      Last edited by owneroxxor on Tue Mar 29, 2016 11:06 pm, edited 1 time in total.

                      1 Reply Last reply Reply Quote 0
                      • O
                        owneroxxor last edited by

                        I don't know if it could work on FOREX currencies.

                        1 Reply Last reply Reply Quote 0
                        • O
                          owneroxxor last edited by

                          I think I got it. After any position get closed by a stop-loss, in my "On tick Event" there is a routine that: once there is less than two orders into the graph, it CANCELS all the current pending orders and create two new. What happens is that just before the "On trade Event" which makes the withdrawal after the stopped position, the EA executes this routine that cancels the pending order that remained, and I think the "Position Closed" box on the "On trade Event" doesnt recognize CANCELED orders as a trigger. So the block doesnt pass. Am I right in saying this?

                          1 Reply Last reply Reply Quote 0
                          • O
                            owneroxxor last edited by

                            Ok, the routine is causing the "BUG". When I disable it, it works. BUT, still not right, because I need this routine working.
                            So I tried to just wipe that "Position Closed" box and put a "For each closed order" loop right after the "PASS" block, but with a "Once per position" box inside it, to prevent it from withdrawaling the same last position all times "On trade Event" tab gets activated. Logically it should work all times it see's a fresh new closed position on the Foreach Loop that is not a CANCELED one (Check Profit Condition Box). but look: 😐
                            http://prntscr.com/alry5u

                            how to overcome this?

                            The "Once per position/order" box is causing this, btw.

                            ty

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

                              OnTrade() runs multiple times and this is normal for MT5. Even if something simple as closing a position happens, you know, this results in some deals and orders, many things. For each ot these "Pass" will run. That's why the events must be filtered.

                              I guess that something is going on because of the strange symbol. I don't even know what this WDO$ is. I am working with EURUSD most of the time. If you can give me demo account or something like that, so I can check it out...

                              1 Reply Last reply Reply Quote 0
                              • O
                                owneroxxor last edited by

                                Why the symbol? lol The symbol is ok. WDO$ mean, W-web DO-dollar $-all historical. Well I made it out using "Turn off/on" blocks. Anyway. I tryed to use the "Once per position/order" twice in 2 regions of my EA, none of them worked, returning that ugly error. Just for you 2 know.

                                Thanks. 😉

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

                                  I don't know what I was looking... I will fix that error

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

                                  Online Users

                                  P
                                  C
                                  E
                                  K
                                  M

                                  14
                                  Online

                                  146.7k
                                  Users

                                  22.4k
                                  Topics

                                  122.6k
                                  Posts

                                  Powered by NodeBB Forums | Contributors