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
Almost a week!!! no replies
This update seems to have some serious bugs specially with Strategy Tester. Hope will be resolved soon.
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.
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.
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 ?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 ?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.
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.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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
Please help me to fix it.
Regards