Version 5.00 build 4410 21 Jun 2024 (is there a bug?) || Waiting for Update[2] | Strategy tester freezes in visual testing mode | it works if visual mode is switched off

 

Note for Moderator: I had a post earlier with same issue (https://www.mql5.com/en/forum/469030), however I deleted it since matter was resolved when I just transferred the files to different location. I am not sure if the earlier post is still there or not!!!

I am creating this new post[2], as the problem has started again today, when I tried to backtest.

Attached are the screenshots, though this EA is working without any error in live chart.

Since Sat 22 Jun, I am having this problem, which I thought will be resolved by Monday when I have Brokers data. However it still continues.

I have tried to search the forum with "Waiting For Update" and "Strategy Tester Waiting For Update" key words (including my old post of about an year before), but could not find any solution.

The problem seems to be in my EA, because when I run 'Example EA' from MQL they work without any problem. In non visual mode this AlgoNK also works without this problem.

Can I be guided, how to find out what is wrong in my AlgoNK?

Below is log from ...MetaQuotes\Terminal\73B7A2420D6397DFF9014A20F1201F97\Tester\logs

DL      0       15:01:15.258    Tester  Cloud servers switched off
OO      0       15:02:10.754    Tester  "AlgoNK\AlgoNK.ex5" 64 bit
FH      0       15:02:10.807    Core 1  agent process started on 127.0.0.1:3000
KO      0       15:02:10.807    Core 1  connecting to 127.0.0.1:3000
NH      0       15:02:11.315    Core 1  connected
IP      0       15:02:11.324    Core 1  authorized (agent build 4410)
EK      0       15:02:11.332    Tester  XAUUSD,M15 (Pepperstone-Demo): visual testing of Experts\AlgoNK\AlgoNK.ex5 from 2024.06.15 00:00 to 2024.06.24 00:00
FK      0       15:02:11.361    Core 1  common synchronization completed
EP      0       15:02:11.529    Tester  quality of analyzed history is 100%
NJ      2       15:07:07.472    Core 1  disconnected						it was disconnected early this time after several attempts, the longest was 30 minutes
GD      0       15:07:07.474    Core 1  connection closed
RESULT FROM log file "...\MetaQuotes\Tester\73B7A2420D6397DFF9014A20F1201F97\Agent-127.0.0.1-3000\logs\20240625.log" written
RR      0       15:35:11.695    Tester  "AlgoNK\AlgoNK.ex5" 64 bit EG      0       15:35:11.728    Core 1  agent process started on 127.0.0.1:3000 DP      0       15:35:11.728    Core 1  connecting to 127.0.0.1:3000 CE      0       15:35:12.247    Core 1  connected QD      0       15:35:12.264    Core 1  authorized (agent build 4410) HL      0       15:35:12.279    Tester  XAUUSD,M15 (Pepperstone-Demo): testing of Experts\AlgoNK\AlgoNK.ex5 from 2024.06.15 00:00 to 2024.06.24 00:00 PO      0       15:35:12.328    Core 1  common synchronization completed RD      0       15:35:12.451    Tester  quality of analyzed history is 100% RR      0       15:35:13.630    Core 1  MetaTester 5 started on 127.0.0.1:3000 RH      0       15:35:13.630    Core 1  cloud network mode is off OR      0       15:35:13.630    Core 1  initialization finished JK      0       15:35:13.630    Core 1  login (build 4410) PD      0       15:35:13.630    Core 1  45796 bytes of account info loaded CQ      0       15:35:13.630    Core 1  1478 bytes of tester parameters loaded JD      0       15:35:13.630    Core 1  15044 bytes of input parameters loaded FQ      0       15:35:13.630    Core 1  9236 bytes of symbols list loaded (1398 symbols) RN      0       15:35:13.630    Core 1  expert file added: Experts\AlgoNK\AlgoNK.ex5. 241661 bytes loaded HF      0       15:35:13.630    Core 1  26484 Mb available, 330 blocks set for ticks generating IP      0       15:35:13.630    Core 1  initial deposit 5000.00 USD, leverage 1:100 PH      0       15:35:13.630    Core 1  successfully initialized EQ      0       15:35:13.630    Core 1  247 Kb of total initialization data received RI      0       15:35:13.630    Core 1  Intel Xeon  E3-1245 v3 @ 3.40GHz, 32520 MB IO      0       15:35:13.630    Core 1  XAUUSD: symbol to be synchronized RK      0       15:35:13.630    Core 1  XAUUSD: symbol synchronized, 3720 bytes of symbol info received PD      0       15:35:13.630    Core 1  XAUUSD: load 27 bytes of history data to synchronize in 0:00:00.002 RS      0       15:35:13.630    Core 1  XAUUSD: history synchronized from 2016.01.04 to 2024.06.24 IP      0       15:35:13.630    Core 1  XAUUSD,M15: history cache allocated for 34993 bars and contains 34376 bars from 2023.01.03 01:00 to 2024.06.14 23:45 PP      0       15:35:13.630    Core 1  XAUUSD,M15: history begins from 2023.01.03 01:00 RK      0       15:35:13.630    Core 1  XAUUSD,M15 (Pepperstone-Demo): 1 minutes OHLC ticks generating KO      0       15:35:13.630    Core 1  XAUUSD,M15: testing of Experts\AlgoNK\AlgoNK.ex5 from 2024.06.15 00:00 to 2024.06.24 00:00 started with inputs: RO      0       15:35:13.630    Core 1    = FK      0       15:35:13.630    Core 1    = JG      0       15:35:13.630    Core 1    = LM      0       15:35:13.630    Core 1    CPR_Session=2 JH      0       15:35:13.630    Core 1    CPR_Period=16408 QI      0       15:35:13.630    Core 1    CPR_PivotMethod=2 QP      0       15:35:13.630    Core 1    CPR_Lookback=10 PK      0       15:35:13.630    Core 1    CPR_Draw=true DF      0       15:35:13.630    Core 1    = PN      0       15:35:13.630    Core 1    RevBars_DojiPct=0.05 EI      0       15:35:13.630    Core 1    RevBars_PeriodMA=55 JF      0       15:35:13.630    Core 1    = NQ      0       15:35:13.630    Core 1    = JP      0       15:35:13.630    Core 1    VWMA_MAPeriodFast=21 EH      0       15:35:13.630    Core 1    VWMA_MAPeriodMid=55 JO      0       15:35:13.630    Core 1    VWMA_MAPeriodSlow=200 RF      0       15:35:13.630    Core 1    VWMA_AppliedPrice=0 HK      0       15:35:13.630    Core 1    VWMA_MAMethod=1 PS      0       15:35:13.630    Core 1    = EL      0       15:35:13.630    Core 1    ATR_MAPeriod=13 LD      0       15:35:13.630    Core 1    = PP      0       15:35:13.630    Core 1    = DL      0       15:35:13.630    Core 1    = JG      0       15:35:13.630    Core 1    RVOL_MAPeriod=21 RI      0       15:35:13.630    Core 1    RVOL_ThldHI=1.2 QO      0       15:35:13.630    Core 1    RVOL_ThldLO=0.8 PF      0       15:35:13.630    Core 1    TSV_SumPeriod=13 DG      0       15:35:13.630    Core 1    TSV_MAPeriod=7 KP      0       15:35:13.630    Core 1    TSV_AppliedPrice=1 MG      0       15:35:13.630    Core 1  2024.06.15 00:00:00   MultiSymbol EA will process [1] Symbols PO      0       15:35:13.630    Core 1  XAUUSD,H1: history cache allocated for 8756 bars and contains 8601 bars from 2023.01.03 01:00 to 2024.06.14 23:00 FL      0       15:35:13.630    Core 1  XAUUSD,H1: history begins from 2023.01.03 01:00 MF      0       15:35:13.630    Core 1  XAUUSD,Daily: history cache allocated for 382 bars and contains 375 bars from 2023.01.03 00:00 to 2024.06.14 00:00 OP      0       15:35:13.630    Core 1  XAUUSD,Daily: history begins from 2023.01.03 00:00 KI      0       15:35:13.630    Core 1  XAUUSD,M5: history cache allocated for 104900 bars and contains 103048 bars from 2023.01.03 01:00 to 2024.06.14 23:50 MF      0       15:35:13.630    Core 1  XAUUSD,M5: history begins from 2023.01.03 01:00 RN      0       15:35:13.630    Core 1  XAUUSD,M1: history cache allocated for 523895 bars and contains 514634 bars from 2023.01.03 01:00 to 2024.06.14 23:54 MM      0       15:35:13.630    Core 1  XAUUSD,M1: history begins from 2023.01.03 01:00 LO      0       15:35:13.630    Core 1  2024.06.21 23:54:59   Custom Perfromance Metric = 0.000 RD      0       15:35:13.630    Core 1  final balance 5000.00 USD PQ      0       15:35:13.630    Core 1  OnTester result 0               // ... there is only Volume Profile / CPR lines to draw on chart as objects NL      0       15:35:13.630    Core 1  XAUUSD,M15: 26930 ticks, 450 bars generated. Environment synchronized in 0:00:00.068. Test passed in 0:00:01.299. OI      0       15:35:13.630    Core 1  XAUUSD,M15: total time from login to stop testing 0:00:01.367 (including 0:00:00.068 for history data synchronization) FJ      0       15:35:13.630    Core 1  503 Mb memory used including 39 Mb of history data, 64 Mb of tick data GO      0       15:35:13.630    Core 1  log file "C:\Users\anilh\AppData\Roaming\MetaQuotes\Tester\73B7A2420D6397DFF9014A20F1201F97\Agent-127.0.0.1-3000\logs\20240625.log" written HJ      0       15:35:13.635    Core 1  connection closed

Please help me to fix it.

Regards

Waiting for Update | Strategy tester freezes in visual testing mode | it works if visual mode is switched off
Waiting for Update | Strategy tester freezes in visual testing mode | it works if visual mode is switched off
  • 2024.06.24
  • Anil Varma
  • www.mql5.com
Hello friends Since Sat I am having this problem, which I thought will be resolved by Monday when I have Brokers data. However it still continues...
 

Almost a week!!! no replies

This update seems to have some serious bugs specially with Strategy Tester. Hope will be resolved soon.

 
Anil Varma #:

Almost a week!!! no replies

This update seems to have some serious bugs specially with Strategy Tester. Hope will be resolved soon.

There is no problem with the 4410 Strategy Tester in visual mode.

 
Anil Varma:

The problem seems to be in my EA, because when I run 'Example EA' from MQL they work without any problem. In non visual mode this AlgoNK also works without this problem.


If you are actually sure that the issue only occurs with an specific EA, you need to debug it. Place breakpoints where the code could be freezing until you find the real problem. Since there're no trades executed, the problem is probably at the OnInit function. There may be a loop that never breaks, for example, but that is something that we cannot help you further without the source code.

 
Alain Verleyen #:

There is no problem with the 4410 Strategy Tester in visual mode.

Thanks Alain

 
Emanuel Cavalcante Amorim Filho #:


If you are actually sure that the issue only occurs with an specific EA, you need to debug it. Place breakpoints where the code could be freezing until you find the real problem. Since there're no trades executed, the problem is probably at the OnInit function. There may be a loop that never breaks, for example, but that is something that we cannot help you further without the source code.

Thanks Emanuel for guidance. May I request you to share link of some good articles on how to debug?

The EA work most of the time and when I change the testing dates, sometime it works and sometime it gives me Waiting for Update, and then next day it starts working without any changes in the EA code. This is strange behavior I am unable to understand.

Also on live chart EA is running without any problem. Also wondering, if EA has problem then how come it works without error in live chart and not in tester!!!

I will try out your suggestion to check OnInit() to locate loops, if that might cause problem.

 

Hi Emanuel

I was even able to backtest in Profiling mode, and for the same period Visual Mode is giving "Waiting for Update" error.

I have incorporated suitable code to catch if any OnInit() error, and none was found. Debugging also on OnInit() of EA (and all related class used) did not point anything about error.

Totally stuck with it.

The Symbol is not show in Market Watch, could this be the problem ?
Files:
20240702_01.png  293 kb
 
Anil Varma #:

Hi Emanuel

I was even able to backtest in Profiling mode, and for the same period Visual Mode is giving "Waiting for Update" error.

I have incorporated suitable code to catch if any OnInit() error, and none was found. Debugging also on OnInit() of EA (and all related class used) did not point anything about error.

Totally stuck with it.

The Symbol is not show in Market Watch, could this be the problem ?
 I don't know if it is "the" problem, but it's a problem for sure.
 
Anil Varma #:

Hi Emanuel

I was even able to backtest in Profiling mode, and for the same period Visual Mode is giving "Waiting for Update" error.

I have incorporated suitable code to catch if any OnInit() error, and none was found. Debugging also on OnInit() of EA (and all related class used) did not point anything about error.

Totally stuck with it.

The Symbol is not show in Market Watch, could this be the problem ?

That's weird and could be part of the issue you're facing. If I were you, I would do the following steps:


1 - Divide all the code that's inside the OnInit function into functions like:

int OnInit()
{
        DoSomething();
        LoadSomething();
        CallSomething();

        return INIT_SUCCEEDED;
}


2 - Place a breakpoint at each of these functions - just click at the line at press F9. Also, place a breakpoint at the very first line inside the OnTick function.

3 - Now, press Ctrl+F5 and start the debugging process.

Whenever a breakpoint is hit, press F10 to step over to the next line. If it doesn't jump to the next line, than something inside that function is causing your EA to hang. For example: 

You've set a breakpoint at DoSomething()LoadSomething() and CallSomething(). The breakpoint at DoSomething was hit, so you press F10 to jump to the next line; then, the breakpoint at LoadSomething was hit, so you press F10 to step over to the next line; at this point, the breakpoint at CallSomething was never hit. So you know now that LoadSomething has a piece of code that is causing the EA to hang there.

If you go through all breakpoints inside OnInit and it returns INIT_SUCCEEDED, then the next regular step of the EA would be to execute the OnTick function (and thus hit the breakpoint at OnTick). If it doesn't, there's something after the successful return of OnInit and before the call of the first tick event handler that is causing the EA to wait there - my guess would be that there's a custom indicator hanging somehow. It has happened to me exactly this: one of my indicators was returning an 'array out of range', but I couldn't figure out what it was, since the problem was between the end of OnInit and the beginning of the first tick.

 

@Emanuel Cavalcante Amorim Filho

Thanks a lot for such a detailed explanation to debug process.

Let me try these steps and see if I can catch the problem area in the code. Will revert back with the outcome.

 
Emanuel Cavalcante Amorim Filho #:

Hi Emanuel

I did tried the steps mentioned by you, and can say they are really worth. At least now I know what to look in when running the debug.

Though I still failed to pinpoint exactly where the problem code is, including the check for INIT_FAILED in the EA's OnInit() seems to have helped me out and currently not getting the "Waiting for Update" issue.

//+-----------------------------------------------------------------------------------------------------------------------------+
//| EXPERT:       OnInit() Initialization Function
//+-----------------------------------------------------------------------------------------------------------------------------+
int OnInit() {

        //+---------------------------------------------------------------------------------------------------------------------------+
        //| SET UP EXPERT CLASS(s) FOR EACH TRADABLE SYMBOL FROM sSymbolArray
        //+---------------------------------------------------------------------------------------------------------------------------+
                // CONVERT string TradeSymbols variable to the symbol string 'AND' populate TradedSymbols[]
                mSymbolsCount = StringSplit(InpTradeSymbols, '|', TradedSymbols);

                ArrayResize(cExperts,mSymbolsCount);
                for(int i = 0; i < mSymbolsCount && !IsStopped(); i++) {
                        // Set the each symbol expert class, as well pass in TradeSymbols[] for calculating Correlation Coefficient at CStrageyBase level
                        cExperts[i] = new CExpertBase(TradedSymbols[i],TradedSymbols,RiskPortfolio,RiskPosition,ATR_MAPeriod,
                                                                                                                                                RevBars_DojiPct,RevBars_PeriodMA);
                        // Set the indicator(s) parameter values for the symbol
                        SetIndicatorParameters(i);
                        // Initialize each symbol's Expert class
                        if(cExperts[i].OnInit() == INIT_FAILED) {
                                string vMethod = "[" + TradedSymbols[i] + "] " + __FUNCTION__;
                                PrintFormat("%s: cExperts.OnInit() failed for [%s] and returned INIT_FAILED",vMethod,TradedSymbols[i]);
                                return(INIT_FAILED);
                        }
                }
                return(INIT_SUCCEEDED);

} // END of function OnInit()

Let me monitor the issue for another couple more days (it is naughty and comes back). Will keep you posted on the progress.

Once again big THANKS A LOT for helping and sparing your time to resolve it.

Regards.