fxDreema

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

    Live testing

    Questions & Answers
    2
    29
    8185
    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.
    • N
      NonciAzzecco last edited by

      I have tested the KC2 ea live on Alpari and I faced very bad behaviors totally different from the backtest, forward test. It seems that the code generated behave diferntly in test and live. As you cab immagine this is a huge issue.

      This is the problem:
      at 00.30 the ea placed correctly the first order and close it 5 min later correctly.

      Than the mess started:
      the remainin order are placed without any logic and on top of this at 1:05 the ea placed an order 5 times bigger while the mm was fixed lot 0.1

      Now I know i can do programming and logic mistakes, but this errors was never discovered during the test phase. Never had an issue with buying a specific fixed lot.

      I have attched the log. After more or less 3 months I have a bad feeling regarding this EA it seems that behind a great idea there is not the geneartion of reliable code.

      Please show me I am wrong!

      2014.07.18 00:30:00 33985397 USDJPY buy in 0.01 101.132 56153524 0.00 0.00 0.00 866.52 Long position
      2014.07.18 00:35:00 33985504 USDJPY sell out 0.01 101.147 56153634 0.00 0.00 0.11 866.63 Position #56153524 closed
      2014.07.18 00:35:00 33985506 USDJPY sell in 0.01 101.147 56153639 0.00 0.00 0.00 866.63 Position #56153524 closed
      2014.07.18 00:40:01 33985645 USDJPY buy out 0.01 101.154 56153791 0.00 0.00 -0.05 866.58 Position #56153639 closed
      2014.07.18 00:40:01 33985648 USDJPY buy in 0.01 101.155 56153792 0.00 0.00 0.00 866.58 Position #56153639 closed
      2014.07.18 00:45:00 33985704 USDJPY sell out 0.01 101.164 56153852 0.00 0.00 0.07 866.65 Position #56153792 closed
      2014.07.18 00:45:00 33985706 USDJPY sell in 0.01 101.164 56153855 0.00 0.00 0.00 866.65 Position #56153792 closed
      2014.07.18 00:50:01 33985743 USDJPY buy out 0.01 101.181 56153896 0.00 0.00 -0.12 866.53 Position #56153855 closed
      2014.07.18 00:50:02 33985744 USDJPY buy in 0.01 101.181 56153897 0.00 0.00 0.00 866.53 Position #56153855 closed
      2014.07.18 00:55:02 33985795 USDJPY sell out 0.01 101.173 56153954 0.00 0.00 -0.06 866.47 Position #56153897 closed
      2014.07.18 00:55:02 33985796 USDJPY sell in 0.01 101.173 56153955 0.00 0.00 0.00 866.47 Position #56153897 closed
      2014.07.18 01:00:00 33985838 USDJPY buy out 0.01 101.160 56153995 0.00 0.00 0.10 866.57 Position #56153955 closed
      2014.07.18 01:00:00 33985839 USDJPY buy in 0.01 101.160 56154004 0.00 0.00 0.00 866.57 Position #56153955 closed
      2014.07.18 01:00:00 33985843 USDJPY buy in 0.01 101.161 56154005 0.00 0.00 0.00 866.57 Position #56153955 closed
      2014.07.18 01:00:00 33985844 USDJPY buy in 0.01 101.161 56154007 0.00 0.00 0.00 866.57 Position #56153955 closed
      2014.07.18 01:00:00 33985845 USDJPY buy in 0.01 101.161 56154008 0.00 0.00 0.00 866.57 Position #56153955 closed
      2014.07.18 01:00:00 33985848 USDJPY buy in 0.01 101.161 56154009 0.00 0.00 0.00 866.57 Position #56153955 closed
      2014.07.18 01:05:00 33985878 USDJPY sell out 0.05 101.158 56154050 0.00 0.00 -0.10 866.47 Position #56154004 closed
      2014.07.18 01:05:00 33985880 USDJPY sell in 0.05 101.158 56154052 0.00 0.00 0.00 866.47 Position #56154004 closed
      2014.07.18 01:10:00 33985917 USDJPY buy out 0.05 101.166 56154093 0.00 0.00 -0.29 866.18 Position #56154052 closed
      2014.07.18 01:10:00 33985918 USDJPY buy in 0.05 101.166 56154094 0.00 0.00 0.00 866.18 Position #56154052 closed
      2014.07.18 01:15:00 33985965 USDJPY sell out 0.05 101.143 56154144 0.00 0.00 -0.84 865.34 Position #56154094 closed

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

        Is there another EA working in parallel?

        I see 1 "Long position" at the top and all of the other rows in the log ends with "closed". Some screenshot maybe? 🙂

        1 Reply Last reply Reply Quote 0
        • N
          NonciAzzecco last edited by

          __Is there another EA working in parallel?

          I see 1 "Long position" at the top and all of the other rows in the log ends with "closed". Some screenshot maybe? :)[/quote:1x8uvvft]

          the same ea on a differnet chart with diffent activation time. Give me an email and tell me what do you wanna see. I will provide all the pics you will requuire

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

            Ok, I found weird behavious when closing positions. For some reason it tries to close a position more than once sometimes, which leads to multiple opposite positions. I'm still not sure why that happens, but I will fix it.

            1 Reply Last reply Reply Quote 0
            • N
              NonciAzzecco last edited by

              __Ok, I found weird behavious when closing positions. For some reason it tries to close a position more than once sometimes, which leads to multiple opposite positions. I'm still not sure why that happens, but I will fix it.[/quote:7eyk0ha3]

              I do not think this is the only reason should be something more subtle. Why the same issue does not pop up during test? Anyway waiting for you fidings.

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

                Oh damn, now I really dislike MT5 😮

                Here is the problem basically.

                MT5 sends trading request to the server with OrderSend() function, the same function is used to open and close positions. It sends the request and then it waits for a response from the server. Depending on the response (some code that means something) the EA decides what to do next. Everything should be synchronous, but it appears that it does not work that way... sometimes. While the communication between MetaTrader 5 and the server is synchronous, the way MetaTrader 5 handles it's local database appears to be asynchronous.

                Here is what happens basically.

                1. You have 1 position => PositionsTotal() returns 1
                2. You close that position, successfully, and the EA knows that
                3. Because there is an endless loop for "Close all positions", the EA checks PositionsTotal() again. And sometimes PositionsTotal() returns 1 even if there is no position anymore! Now the EA thinks that there is some position to be closed, and it actually tries to close the same position as before, because all it's data is still available to the EA, it's still not updated from MetaTrader 5. It will be... after some milliseconds, I think it depends on how slow is the PC at that moment.

                I found topic about this problem in mql5.com: http://www.mql5.com/en/forum/16492

                I knew that something like this happens for indicators, but I didn't expected MT5 to behave in such a weird way for it's positions. Now I have to find some way to trick this.

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

                  Why there are no problems in backtest - because the backtester is really synchronous, it can't be another way

                  1 Reply Last reply Reply Quote 0
                  • N
                    NonciAzzecco last edited by

                    __Why there are no problems in backtest - because the backtester is really synchronous, it can't be another way[/quote:3553akud]

                    ok, I understand you are working on that, but i did not understand how multiple closing on unexisting orders could drive to a new buyorder with random parameters. Anyway I will wait for your answer.

                    Is Mt4 better than Mt5? Really never taken in consideration such an option

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

                      Because there is no OrderClose() or PositionClose() function. Positions are closed with another opposite position with the same lot lot size.

                      I think I tricked it, now it should work fine.

                      I'm gonna say that I don't know why peope are using MT5 🙂 MT5 started in 2010 and years later most people and brokers still work on the previous version - MT4. Last year MetaQuotes even decided to update MT4 (finally updated this year), so now MT4 has all the positives from MT4 and MT5. Well, MT4 still has problems with it's history data anyway...

                      1 Reply Last reply Reply Quote 0
                      • N
                        NonciAzzecco last edited by

                        __Because there is no OrderClose() or PositionClose() function. Positions are closed with another opposite position with the same lot lot size.

                        I think I tricked it, now it should work fine.

                        I'm gonna say that I don't know why peope are using MT5 🙂 MT5 started in 2010 and years later most people and brokers still work on the previous version - MT4. Last year MetaQuotes even decided to update MT4 (finally updated this year), so now MT4 has all the positives from MT4 and MT5. Well, MT4 still has problems with it's history data anyway...[/quote:1fa1vzm8]

                        Ok thank you for your support. I can switch to mt4 with no problem if you can give some advice on how to fix, or at least limit, the history data issue. I have seen several post on this matter but I can not evaluate which is relavent uptodate or obsolete. Advice will be welcome.

                        I have chosen MT5 just because it was easier to backtest but if you recomend to stay with MT4 I will switch. Whats your call? 🙂

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

                          People use history data from other sources, some work with Ticks Data Suite, others with Tickstory (free). How to work with these... I don't know 🙂 Or delete all the history files and download the data again... this helps to cover some holes, but normally creates others.

                          1 Reply Last reply Reply Quote 0
                          • N
                            NonciAzzecco last edited by

                            __People use history data from other sources, some work with Ticks Data Suite, others with Tickstory (free). How to work with these... I don't know 🙂 Or delete all the history files and download the data again... this helps to cover some holes, but normally creates others.[/quote:3d0m9ta0]

                            Ok, is there any way to convert a fxdreema project from MT5 to MT4?

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

                              If the strategy itself can be converted, why not. You can copy-paste blocks, but then you will need to check them all, because there are some differences. Some blocks looks the same, but they are with different name in the database and such a block will not appear correctly (this is something that I should fix some day). And there are blocks with options designed only for MQL4/MQL5, and in this case you will need to change the strategy... probably.

                              The other way to copy project is for example to generate mq5 file, rename it to mq4 file and import it back again. It should create MQL4 project now. And again, blocks needs to be checked.

                              The best (and time consuming) is to recreate everything in MQL4, starting from scratch. Or this is how I normally do things... well, this takes time, but when I do that, I always fix something and I'm making it a little bit better 🙂

                              1 Reply Last reply Reply Quote 0
                              • N
                                NonciAzzecco last edited by

                                2014.07.21 14:50:00 34027293 EURUSD buy in 0.01 1,35147 56208471 0,00 0,00 0,00 865,34 Long position
                                2014.07.21 14:55:00 34027444 EURUSD sell out 0.01 1,35159 56208700 0,00 0,00 0,09 865,43 Position #56208471 closed
                                2014.07.21 14:55:00 34027445 EURUSD sell in 0.01 1,35159 56208702 0,00 0,00 0,00 865,43 Position #56208471 closed
                                2014.07.21 14:55:00 34027448 EURUSD sell in 0.01 1,35161 56208703 0,00 0,00 0,00 865,43 Position #56208471 closed
                                2014.07.21 14:55:00 34027449 EURUSD sell in 0.01 1,35161 56208705 0,00 0,00 0,00 865,43 Position #56208471 closed
                                2014.07.21 14:55:54 34027474 EURUSD buy out 0.03 1,35183 56208732 0,00 0,00 - 0,50 864,93

                                Same issue. The problem is not fixed: the first long and than the close i scorrect. The rest it is not!

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

                                  https://fxdreema.com/shared/ekaoCABkb

                                  I use this to test what is going on. It contains some blocks for messaging, but in general this closes everything at start and then creates a new position with size 0.1 lots. So everytime you run this EA it should close whatever is opened and create new position with 0.1 lots, not 0.2, 0.3 ot something else lots.
                                  Is this EA working like this on your side?

                                  1 Reply Last reply Reply Quote 0
                                  • N
                                    NonciAzzecco last edited by

                                    __https://fxdreema.com/shared/ekaoCABkb

                                    I use this to test what is going on. It contains some blocks for messaging, but in general this closes everything at start and then creates a new position with size 0.1 lots. So everytime you run this EA it should close whatever is opened and create new position with 0.1 lots, not 0.2, 0.3 ot something else lots.
                                    Is this EA working like this on your side?[/quote:nq1wk23w]

                                    I do not know. The EA was working on Live (real money) account. I definitely can not test your ea 🙂

                                    Alpari has recently changed to market order processing, that could be the issue. Weird that I am the only one with this issue. Nobody has a Live ea working on Alpari?

                                    I have opened a Mt4 account on alpari, but I am facing several issue with MT4: is hell damn slow in testing and backtesting, probably 1 to 50 compared to MT5

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

                                      I registered demo account and I tested this, it has problems before. But now it works for me as expected. Is there a chance that you use some old EA, generated before?

                                      There can be something else that I'm not aware of, MT5 always gives me surprises. Some screenshots maybe? It's a little bit confusing with text logs, MT5 is confusing anyway with it's deals and orders and positions 😕

                                      1 Reply Last reply Reply Quote 0
                                      • N
                                        NonciAzzecco last edited by

                                        __I registered demo account and I tested this, it has problems before. But now it works for me as expected. Is there a chance that you use some old EA, generated before?

                                        There can be something else that I'm not aware of, MT5 always gives me surprises. Some screenshots maybe? It's a little bit confusing with text logs, MT5 is confusing anyway with it's deals and orders and positions 😕[/quote:19q9bwri]

                                        Unfortunately I have the same strange behavior in placing orders with mt4: the ea is KC-Mt4 and the result in backtesting show this funny result. with fixed lot=0.1

                                        2014.07.22 19:53:10.431 1999.12.06 15:05 KC-MT4 EURUSD,M5: close #3 sell 0.10 EURUSD at 1.02340 sl: 1.07340 tp: 0.97340 at price 1.02288
                                        2014.07.22 19:53:10.431 1999.12.06 15:05 KC-MT4 EURUSD,M5: close #4 sell 0.01 EURUSD at 1.02340 sl: 1.07340 tp: 0.97340 at price 1.02288
                                        2014.07.22 19:53:10.431 1999.12.06 14:40 KC-MT4 EURUSD,M5: open #4 sell 0.01 EURUSD at 1.02340 sl: 1.07340 tp: 0.97340 ok
                                        2014.07.22 19:53:10.431 1999.12.06 14:40 KC-MT4 EURUSD,M5: open #3 sell 0.10 EURUSD at 1.02340 sl: 1.07340 tp: 0.97340 ok
                                        2014.07.22 19:53:09.992 1977.08.01 00:00 KC-MT4 EURUSD,M5: close #1 sell 0.10 EURUSD at 0.85650 sl: 0.90650 tp: 0.80650 at price 0.85088
                                        2014.07.22 19:53:09.992 1977.08.01 00:00 KC-MT4 EURUSD,M5: close #2 sell 0.01 EURUSD at 0.85650 sl: 0.90650 tp: 0.80650 at price 0.85088
                                        2014.07.22 19:53:09.992 1977.07.11 00:00 KC-MT4 EURUSD,M5: open #2 sell 0.01 EURUSD at 0.85650 sl: 0.90650 tp: 0.80650 ok
                                        2014.07.22 19:53:09.992 1977.07.11 00:00 KC-MT4 EURUSD,M5: Alert: You want to trade 0 lot, but your broker's minimum is 0.01 lot. The trade/order will continue with 0.01 lot instead of 0 lot. The same rule will be applied for next trades/orders with desired lot size lower than the minimum. You will not see this message again until you restart the program.
                                        2014.07.22 19:53:09.992 1977.07.11 00:00 KC-MT4 EURUSD,M5: open #1 sell 0.10 EURUSD at 0.85650 sl: 0.90650 tp: 0.80650 ok
                                        2014.07.22 19:53:09.964 1971.05.26 00:04 Custom indicator Keltner_Chanel EURUSD,M5: loaded successfully
                                        2014.07.22 19:53:09.962 KC-MT4 inputs: Risk=1; StopLoss=500; TakeProfit=500; Lot=0.1; TimeFilter=0; GoLong=0; GoShort=1; LongBandPeriod=288; LongDev=17.6; ShortBandPeriod=288; ShortDev=23.8; MagicStart=2040;
                                        2014.07.22 19:53:07.599 TestGenerator: current spread 18 used
                                        2014.07.22 19:53:07.597 Custom indicator Keltner_Chanel EURUSD,M5: removed

                                        Please note that this does not happen on long orders
                                        I am open to give you access to my pc in order to allow you to grab or details to trouble fix the issue.

                                        please contact me by email i guess that teamviewer or equivalent may work

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

                                          Ok, now I think there is something wrong with the strategy or with the broker. MT4 and MT5 are so different in the way they handle trades/positions, so I don't know how the same weird bug is possible. Which has not been reported for MT4, and you know that MT4 users are more than those in MT5. But maybe there is something, who knows.

                                          You can send me your TeamViewer details on PM. But I prefer to work on some demo, I don't want to be guilty of some losses while I'm doing checks :)))

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

                                          Online Users

                                          R
                                          M
                                          J
                                          E
                                          H
                                          M
                                          K

                                          21
                                          Online

                                          146.8k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors