Strategy Tester not working!!!

 

Dear All

I had recently needed to reinstall MQL5 Platform and facing a problem with Strategy Tester. It keeps on showing 'Waiting for Update' and no data is processed.

I have downloaded M1 data for more than a year and testing only recent 3 months.

Attached the screen shot and tester initialization output. The tester hangs out and I have to force close it through Window's Task Manager.

I have failed to understand what is wrong. Support from the Forum is highly appreciated.

2023.04.24 18:28:35.146 MetaTester 5 started on 127.0.0.1:3000
2023.04.24 18:28:35.151 cloud network mode is off ... !!! IS THIS CAUSING PROBLEM, if yes how to rectify it
2023.04.24 18:28:35.151 initialization finished
2023.04.24 18:28:35.436 login (build 3661)
2023.04.24 18:28:35.450 template file tester.tpl added. 557702 bytes loaded
2023.04.24 18:28:35.457 4412 bytes of account info loaded
2023.04.24 18:28:35.457 1478 bytes of tester parameters loaded
2023.04.24 18:28:35.457 23748 bytes of input parameters loaded
2023.04.24 18:28:35.459 24283 bytes of symbols list loaded (1214 symbols)
2023.04.24 18:28:35.460 expert file added: Experts\ArunFX\Experts\ArunFX.ex5. 348941 bytes loaded
2023.04.24 18:28:35.472 28296 Mb available, 353 blocks set for ticks generating
2023.04.24 18:28:35.472 calculate profit in pips, initial deposit 5000, leverage 1:100
2023.04.24 18:28:35.474 successfully initialized
2023.04.24 18:28:35.474 470 Kb of total initialization data received
2023.04.24 18:28:35.474 Intel Xeon  E3-1245 v3 @ 3.40GHz, 32520 MB
2023.04.24 18:28:35.532 US30: symbol to be synchronized
2023.04.24 18:28:35.533 US30: symbol synchronized, 3720 bytes of symbol info received
2023.04.24 18:28:35.533 US30: history synchronization started
2023.04.24 18:28:35.535 US30: load 23 bytes of history data to synchronize in 0:00:00.001
2023.04.24 18:28:35.535 US30: history synchronized from 2022.01.03 to 2023.04.21
2023.04.24 18:28:35.622 US30,M5: history cache allocated for 96429 bars and contains 73182 bars from 2022.01.03 01:00 to 2022.12.30 23:50
2023.04.24 18:28:35.622 US30,M5: history begins from 2022.01.03 01:00
2023.04.24 18:28:35.624 US30,M5 (Pepperstone-Demo): 1 minutes OHLC ticks generating
2023.04.24 18:28:35.624 US30,M5: testing of Experts\ArunFX\Experts\ArunFX.ex5 from 2023.01.01 00:00 to 2023.04.23 00:00 started with inputs:
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   STF_ATRPeriod=10
2023.04.24 18:28:35.624   STF_ATRMultiple=1.0
2023.04.24 18:28:35.624   STM_ATRPeriod=11
2023.04.24 18:28:35.624   STM_ATRMultiple=2.0
2023.04.24 18:28:35.624   STS_ATRPeriod=12
2023.04.24 18:28:35.624   STS_ATRMultiple=3.0
2023.04.24 18:28:35.624   Band_MAPeriod=21
2023.04.24 18:28:35.624   Band_SDOut=2.1
2023.04.24 18:28:35.624   Band_SDInn=0.75
2023.04.24 18:28:35.624   Band_ThldOB=1.0
2023.04.24 18:28:35.624   Band_AppliedPrice=8
2023.04.24 18:28:35.624   Band_MAMethod=3
2023.04.24 18:28:35.624   HullMA_Period=32
2023.04.24 18:28:35.624   HullMA_Divisor=2.0
2023.04.24 18:28:35.624   HullMA_AppliedPrice=8
2023.04.24 18:28:35.624   SARStep=0.02
2023.04.24 18:28:35.624   SARStepMax=0.2
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   HullBBSL_MAPeriod=32
2023.04.24 18:28:35.624   HullBBSL_Divisor=2.0
2023.04.24 18:28:35.624   HullBBSL_AppliedPrice=1
2023.04.24 18:28:35.624   HullBBSL_Deviation=2.0
2023.04.24 18:28:35.624   HullBBSL_Risk1=0.75
2023.04.24 18:28:35.624   HullBBSL_Risk2=1.5
2023.04.24 18:28:35.624   HullBBSL_Risk3=2.5
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   ER_MAPeriod=13
2023.04.24 18:28:35.624   ER_ThldNoise=0.2
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   MFI_MAPeriod=10
2023.04.24 18:28:35.624   MFI_OnBBPeriod=40
2023.04.24 18:28:35.624   MFI_OnBBSD=2.0
2023.04.24 18:28:35.624   MFI_ThldOB=0.95
2023.04.24 18:28:35.624   SMFI_MFIPeriod=10
2023.04.24 18:28:35.624   SMFI_Stoch1Period=5
2023.04.24 18:28:35.624   SMFI_EMAPeriod=3
2023.04.24 18:28:35.624   SMFI_ThldOB=90.0
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.624   ATR_Period=13
2023.04.24 18:28:35.624   NATR_ThldHigh=0.1
2023.04.24 18:28:35.624   NATR_ThldStrong=0.2
2023.04.24 18:28:35.624   RATR_Period=21
2023.04.24 18:28:35.624   =
2023.04.24 18:28:35.646 2023.01.01 00:00:00   LicenseCheck: Time Limited Copy, License Use will Expire on [2023.04.27 18:28]
2023.04.24 18:28:35.646 2023.01.01 00:00:00   [US30] CATRBreakOut::CATRBreakOut Param_iSAR step[0.020] maxStep[0.200]
2023.04.24 18:28:35.748 US30,M1: history cache allocated for 480502 bars and contains 364270 bars from 2022.01.03 01:00 to 2022.12.30 23:54
2023.04.24 18:28:35.748 US30,M1: history begins from 2022.01.03 01:00
2023.04.24 18:28:35.966 US30,M15: history cache allocated for 32171 bars and contains 24422 bars from 2022.01.03 01:00 to 2022.12.30 23:45
2023.04.24 18:28:35.966 US30,M15: history begins from 2022.01.03 01:00
2023.04.24 18:28:36.047 US30,H1: history cache allocated for 8046 bars and contains 6109 bars from 2022.01.03 01:00 to 2022.12.30 23:00
2023.04.24 18:28:36.047 US30,H1: history begins from 2022.01.03 01:00
2023.04.24 18:28:36.125 US30,Daily: history cache allocated for 339 bars and contains 258 bars from 2022.01.03 00:00 to 2022.12.30 00:00
2023.04.24 18:28:36.125 US30,Daily: history begins from 2022.01.03 00:00
2023.04.24 18:30:41.528 stopped by user
2023.04.24 18:30:41.531 prepare for shutdown
2023.04.24 18:30:51.532 tester agent shutdown started
2023.04.24 18:30:51.532 shutdown tester machine
 
2023.04.24 18:28:35.450 template file tester.tpl added. 557702 bytes loaded
Remove this template.
 
Alain Verleyen #:
Remove this template.

@Alain Verleyen Thanks for such a quick response.

I did removed the template (however I have been using template with indicators in past and working without any problem, before reinstall).

Still does not process the data, however hanging issue is resolved. 

 
I ran into an issue over the weekend when I was running the strategy tester. I needed to delete the tester/log files from appdata/roaming/metaquotes/tester/%yourMT5longstringofnumberscharactersacct%/agent/logs. After deleting them it started working again. 
 
Anil Varma #:

@Alain Verleyen Thanks for such a quick response.

I did removed the template (however I have been using template with indicators in past and working without any problem, before reinstall).

Still does not process the data, however hanging issue is resolved. 

2023.04.24 18:28:35.472 calculate profit in pips, initial deposit 5000, leverage 1:100

Is it the same after disabling this option ?

Is it the same without Visual mode ?

Is the EA running normally on a live chart ?

 
Anil Varma #:

@Alain Verleyen Thanks for such a quick response.

I did removed the template (however I have been using template with indicators in past and working without any problem, before reinstall).

Still does not process the data, however hanging issue is resolved. 

Have you checked your EA with the profiler to find out if and where it looses time?

Do you use Comment() or Print() to check which part needs how much time?

 
Neal D Collenburg Jr #:
I ran into an issue over the weekend when I was running the strategy tester. I needed to delete the tester/log files from appdata/roaming/metaquotes/tester/%yourMT5longstringofnumberscharactersacct%/agent/logs. After deleting them it started working again. 
@Neal D Collenburg Jr


Hi Neal, tried but did not helped in my case.

 
Anil Varma #:

Thanks for your answers to my questions.
 
Anil Varma:

Dear All

I had recently needed to reinstall MQL5 Platform and facing a problem with Strategy Tester. It keeps on showing 'Waiting for Update' and no data is processed.

I have downloaded M1 data for more than a year and testing only recent 3 months.

Attached the screen shot and tester initialization output. The tester hangs out and I have to force close it through Window's Task Manager.

I have failed to understand what is wrong. Support from the Forum is highly appreciated.

Here is my start of an optimization in the cloud: See how long it took from start of the optimization (20:40)  to the first result (20:45):

OP      0       20:40:08.968    Tester  Cloud servers switched on
RJ      0       20:40:18.321    Tester  Experts\TestEA Opti.ex5 on EURCHF,H1 from 2021.01.02 00:00 to 2023.04.01 00:00
ND      0       20:40:18.321    Tester  EURCHF: history data begins from 2018.08.17 00:00
IN      0       20:40:18.321    Tester  EURCHF: ticks data begins from 2021.01.04 00:00
LI      0       20:40:18.322    Tester  genetic optimization started
NL      0       20:40:18.322    MQL5 Cloud Europe       connecting to agent1.mql5.net:443
KD      0       20:40:18.323    MQL5 Cloud Europe 2     connecting to agent3.mql5.net:443
IM      0       20:40:18.323    MQL5 Cloud USA  connecting to agent2.mql5.net:443
MD      0       20:40:18.323    MQL5 Cloud USA 2        connecting to agent4.mql5.net:443
ES      0       20:40:18.348    MQL5 Cloud Europe       connected
KD      0       20:40:18.410    MQL5 Cloud Europe 2     connected
DM      0       20:40:18.411    MQL5 Cloud Europe       authorized (server build 3661)
NI      0       20:40:18.452    MQL5 Cloud USA 2        connected
PF      0       20:40:18.452    MQL5 Cloud USA  connected
QP      0       20:40:18.580    MQL5 Cloud Europe 2     authorized (server build 3661)
IG      0       20:40:18.688    MQL5 Cloud USA 2        authorized (server build 3661)
CM      0       20:40:18.697    MQL5 Cloud USA  authorized (server build 3661)
PD      0       20:40:18.697    Tester  MQL5 Cloud Europe selected for genetic computations with ping 23 ms
KH      0       20:40:18.697    MQL5 Cloud Europe 2     connection closed
OM      0       20:40:18.698    MQL5 Cloud USA  connection closed
IR      0       20:40:18.698    MQL5 Cloud USA 2        connection closed
LF      0       20:40:18.887    MQL5 Cloud Europe       common synchronization completed
KO      0       20:40:18.917    MQL5 Cloud Europe       genetic pass (0, 0, 256) started
LQ      0       20:40:19.366    MQL5 Cloud Europe       EURCHF: history for 1993 year synchronized
QK      0       20:40:19.366    MQL5 Cloud Europe       EURCHF: history for 1994 year synchronized
RM      0       20:40:19.366    MQL5 Cloud Europe       EURCHF: history for 1995 year synchronized
OG      0       20:40:19.366    MQL5 Cloud Europe       EURCHF: history for 1996 year synchronized
PI      0       20:40:19.366    MQL5 Cloud Europe       EURCHF: history for 1997 year synchronized
FS      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 1998 year synchronized
EE      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 1999 year synchronized
KO      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2000 year synchronized
LQ      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2001 year synchronized
MK      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2002 year synchronized
NM      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2003 year synchronized
OG      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2004 year synchronized
PI      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2005 year synchronized
QS      0       20:40:19.367    MQL5 Cloud Europe       EURCHF: history for 2006 year synchronized
CE      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2007 year synchronized
RO      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2008 year synchronized
QQ      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2009 year synchronized
IK      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2010 year synchronized
JM      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2011 year synchronized
GG      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2012 year synchronized
HI      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2013 year synchronized
ES      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2014 year synchronized
FE      0       20:40:19.368    MQL5 Cloud Europe       EURCHF: history for 2015 year synchronized
DO      0       20:40:19.369    MQL5 Cloud Europe       EURCHF: history for 2016 year synchronized
CQ      0       20:40:19.369    MQL5 Cloud Europe       EURCHF: history for 2017 year synchronized
RK      0       20:40:19.369    MQL5 Cloud Europe       EURCHF: history for 2018 year synchronized
FR      0       20:40:19.369    MQL5 Cloud Europe       EURCHF: history synchronization completed [827 Kb]
HF      0       20:40:19.369    MQL5 Cloud Europe       EURCHF: 827.83 Kb of history processed in 0:00:00.000
CE      0       20:40:19.635    MQL5 Cloud Europe       EURCHF: ticks synchronized already [43 bytes]
KM      0       20:40:50.635    MQL5 Cloud Europe       EURUSD: history for 1971 year synchronized
KG      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1972 year synchronized
LI      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1973 year synchronized
QS      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1974 year synchronized
RE      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1975 year synchronized
OO      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1976 year synchronized
PQ      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1977 year synchronized
EK      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1978 year synchronized
FM      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1979 year synchronized
HG      0       20:40:50.636    MQL5 Cloud Europe       EURUSD: history for 1980 year synchronized
HI      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1981 year synchronized
IS      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1982 year synchronized
JE      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1983 year synchronized
CO      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1984 year synchronized
DQ      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1985 year synchronized
EK      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1986 year synchronized
FM      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1987 year synchronized
OG      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1988 year synchronized
PI      0       20:40:50.637    MQL5 Cloud Europe       EURUSD: history for 1989 year synchronized
MS      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1990 year synchronized
NE      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1991 year synchronized
KO      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1992 year synchronized
LQ      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1993 year synchronized
QK      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1994 year synchronized
RM      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1995 year synchronized
OG      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1996 year synchronized
PI      0       20:40:50.638    MQL5 Cloud Europe       EURUSD: history for 1997 year synchronized
FS      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 1998 year synchronized
EE      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 1999 year synchronized
KO      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2000 year synchronized
LQ      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2001 year synchronized
MK      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2002 year synchronized
NM      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2003 year synchronized
OG      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2004 year synchronized
PI      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2005 year synchronized
QS      0       20:40:50.639    MQL5 Cloud Europe       EURUSD: history for 2006 year synchronized
KI      0       20:40:50.641    MQL5 Cloud Europe       EURUSD: history synchronization completed [1143 Kb]
GN      0       20:40:50.641    MQL5 Cloud Europe       EURUSD: 1.12 Mb of history processed in 0:00:00.000
EL      0       20:40:51.135    MQL5 Cloud Europe       EURUSD: ticks synchronized already [43 bytes]
QJ      0       20:45:14.598    MQL5 Cloud Europe       XAUUSD: ticks synchronization started
OS      0       20:45:14.598    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202112.tkc" download
CO      0       20:45:15.613    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202111.tkc" download
OH      0       20:45:17.643    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202110.tkc" download
RE      0       20:45:19.673    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202109.tkc" download
KQ      0       20:45:21.702    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202108.tkc" download
NJ      0       20:45:23.731    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202107.tkc" download
IF      0       20:45:24.747    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202106.tkc" download
NS      0       20:45:27.791    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202105.tkc" download
RL      0       20:45:29.824    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202104.tkc" download
LH      0       20:45:32.865    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202103.tkc" download
IE      0       20:45:35.910    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202102.tkc" download
GN      0       20:45:37.940    Tester  XAUUSD: "bases\MetaQuotes-Demo\ticks\XAUUSD\202101.tkc" download
IH      0       20:45:40.984    MQL5 Cloud Europe       XAUUSD: ticks downloading completed
NF      0       20:45:41.017    MQL5 Cloud Europe       XAUUSD: ticks synchronization completed [19158 Kb]
EO      0       20:45:41.225    MQL5 Cloud Europe       genetic pass (0, 3) returned result 0 in 0:04:22.347 (PR 80)
OK      0       20:45:45.763    MQL5 Cloud Europe       genetic pass (0, 9) returned result -1.581062 in 0:04:34.017 (PR 80)
JK      0       20:45:46.533    MQL5 Cloud Europe       genetic pass (0, 5) returned result -56.109463 in 0:03:19.983 (PR 88)
KE      0       20:45:47.811    MQL5 Cloud Europe       genetic pass (0, 6) returned result -70.316986 in 0:03:20.682 (PR 88)
MP      0       20:46:36.561    MQL5 Cloud Europe       genetic pass (0, 26) returned result -113.893730 in 0:06:02.754 (PR 78)

Maybe you were just too impatient?

 
Carl Schreiber #:

Here is my start of an optimization in the cloud: See how long it took from start of the optimization (20:40)  to the first result (20:45):

Maybe you were just too impatient?

@Carl Schreiber Sorry for late reply, as was struggling the the issued to resolve.

I was not impatient :) and allowed more than 20 minutes to see if any result are out.

However I have given up on this, as when I tried another class that one is working without any problem.

It seems while making changes to my files (as I lost them before reinstalling MQL5) might be causing the issue. What I have realized that it does not go to the OnTick() method and hangs before that.

Debug also did not gave any fruitful results.

Would be great to know how to check if an class is initialized properly with 'constructor' method.

Here is the code, of the class. May be expert can point out error. The complete code can not be attached and there are too many dependencies. So just by looking code, if some error can be traced than it could be helpful.

#include "..\\..\\Base\\BaseStrategy.mqh"
struct SBreakOut {
        bool                    breakOut;
        datetime        boTime;
};

//+-----------------------------------------------------------------------------------------------------------------------------+
//| CLASS:                      CATRBreakOut
//| STRATEGY:           1) ATR BreakOut [Quantra/QuantInsti Intraday Trading Strategy]
//+-----------------------------------------------------------------------------------------------------------------------------+
class CATRBreakOut : protected CBaseStrategy {

public:
                // PARAMETRIC CONSTRUCTOR METHOD
                CATRBreakOut(string pSymbol,double pRiskPerSymbol,double pRiskPerTrade,SMagicNo &sMagicATRBO,SParam_iHullMA &Param_iHullMA,
                                                                 SParam_iBand &Param_iBand,SParam_iER &Param_iER,SParam_iNATR &Param_iNATR,SParam_iRVOL &Param_iRVOL,
                                                                 SParam_iSAR &Param_iSAR);
                // DEFAULT DESTRUCTOR
         ~CATRBreakOut();

                void                                                                    OnTick();
private:
                int                                                                     mMagicATRBO;
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| TRIGGER TO STORE ATR BREAKOUT
        //+---------------------------------------------------------------------------------------------------------------------------+
                SBreakOut                                                       mBreakOutM15,                                   mBreakOutM05;
                // To get values on index[0]
                SiHullMA                                                        tHullH01[1];
                SiBand                                                          tBandH01[1];
                SiMFI                                                                   tSMFIH01[1];
                CENUM_TREND                                             HMATriggerH01;
                CENUM_TREND                                             HMATriggerM15;
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| POSITION ENTRY METHODs
        //+---------------------------------------------------------------------------------------------------------------------------+
                void                                                                    CheckNewPosition(void);
                bool                                                                    BreakOutLong(void);
                bool                                                                    BreakOutShort(void);
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| ORGANIC EXIT METHODs
        //+---------------------------------------------------------------------------------------------------------------------------+
                void                                                                    TrailOrganicExit(void);
                bool                                                                    TrailExit_Long(void);
                bool                                                                    TrailExit_Short(void);

                bool                                                                    GetTrailSLLong(double &pTrailSL);
                bool                                                                    GetTrailSLShort(double &pTrailSL);

                void                                                                    TrailTP(void);
                bool                                                                    TrailTP_Long(void);
                bool                                                                    TrailTP_Short(void);
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| REFRESH STRATEGY VARIABLES AND BUFFERS
        //+---------------------------------------------------------------------------------------------------------------------------+
                void                                                                    RefreshBufferD01();
                void                                                                    RefreshBufferH01();
                void                                                                    RefreshBufferM15();
                void                                                                    RefreshBufferM05();
                void                                                                    RefreshBufferM01();

}; // END of Class declaration
//+-----------------------------------------------------------------------------------------------------------------------------+
//| METHOD:       CATRBreakOut()
//| APPLICATION:  PARAMETRIC CONSTRUCTOR METHOD
//+-----------------------------------------------------------------------------------------------------------------------------+
CATRBreakOut::CATRBreakOut(string pSymbol,double pRiskPerSymbol,double pRiskPerTrade,SMagicNo &sMagicATRBO,
                                                                                                         SParam_iHullMA &Param_iHullMA,SParam_iBand &Param_iBand,SParam_iER &Param_iER,SParam_iNATR &Param_iNATR,
                                                                                                         SParam_iRVOL &Param_iRVOL,SParam_iSAR &Param_iSAR)
        : CBaseStrategy(pSymbol,pRiskPerSymbol,pRiskPerTrade) {

    string vMethod = "[" + (string)mSymbol + "] " + (string)__FUNCTION__;
                PrintFormat("%s Param_iNATR periodNATR[%.2f] periodRATR[%.2f] thldHigh[%.2f] thldStrong[%.2f]",vMethod,Param_iNATR.periodNATR,Param_iNATR.periodRATR,Param_iNATR.thldHigh,Param_iNATR.thldStrong);
                //PrintFormat("%s Param_iSAR step[%.3f] maxStep[%.3f]",vMethod,Param_iSAR.step,Param_iSAR.maxStep); ... This one printed

                // INSTANTIATE STRATEGY VARIABLEs
                mMagicATRBO              = sMagicATRBO.breakOut;
    mDigits                      = (int)SymbolInfoInteger(pSymbol,SYMBOL_DIGITS);
                mComment                         = "";
                mCount                           = 8;                                                                                                                                           // GET 'n' NUMBER OF BARS

                k                                                        = 1;                                                                                                                                           // FREQUENTLY USED FOR BAR INDEX
                mSLMultipleATR = 0.50;                                                                                                                          // ADDITIONAL BUFFER AT ATR MULTIPLE ON HIGH OR LOW PRICES
                mPriceTP                         = 0.00;                                                                                                                                // EXIT STRATEGY: TRAIL EXIT OR HIT TRAIL STOP LOSS

                ZeroMemory(mBreakOutM05);                                                                                                                       ZeroMemory(mBreakOutM15);

                IsNewBarM01();
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| INSTANTIATE CLASS(s)
        //+---------------------------------------------------------------------------------------------------------------------------+
    // SET INDICATORS THRESHOLD LIMITS
                SetThld_iER(Param_iER.thldNoise);
                SetThld_iNATR(Param_iNATR.thldHigh,Param_iNATR.thldStrong);
        SetThld_iRVOL(Param_iRVOL.thldHI,Param_iRVOL.thldLO);
    //SetThld_iSMFI(Param_iSMFI.thldOB);

                // INDICATOR HANDLE TIMEFRAME: WE SET TIME FRAME ARRAY LOWEST TO HIGHER PERIODs
                //TFCount[5] = mTFD01;
                // Note [4] left for PERIOD_H04, in case used in future
                //TFCount[3] = mTFH01;
                TFCount[2] = mTFM15;
                TFCount[1] = mTFM05;
                TFCount[0] = mTFM01;

                // INSTANTIATE INDICATOR CLASS(s) FOR ALL FOUR TIME FRAME WITH THE LOOP
                for(int i = 0; i <= 2; i++) {

                        // Indicators not required parameter values, except symbol and time frame
                        cHA[i]   = new CiHAshi(mSymbol,TFCount[i]);

                        // Indicators for applying filters
                        cER[i]   = new CiEfficiencyRatio(mSymbol,TFCount[i],Param_iER.maPeriod,Param_iER.thldNoise);
                        cNATR[i] = new CiNATR(mSymbol,TFCount[i],Param_iNATR.periodNATR,Param_iNATR.periodRATR,Param_iNATR.thldHigh,Param_iNATR.thldStrong);
                        cRVOL[i] = new CiRVOL(mSymbol,TFCount[i],Param_iRVOL.maPeriod,Param_iRVOL.thldHI,Param_iRVOL.thldLO);

                        // Indicators for the STRATEGY
                        cHMA[i]  = new CiHullMA(mSymbol,TFCount[i],Param_iHullMA.maPeriod,Param_iHullMA.maDivisor,Param_iHullMA.appliedPrice);
                        cBand[i] = new CiBand(mSymbol,TFCount[i],Param_iBand.maPeriod,Param_iBand.sdOut,Param_iBand.sdInn,Param_iBand.appliedPrice,
                                                                                                                Param_iBand.maMethod,Param_iBand.thldOB);
                        //cSMFI[i] = new CiSMFI(mSymbol,TFCount[i],Param_iSMFI.mfiPeriod,Param_iSMFI.stoch1Period,Param_iSMFI.emaPeriod,
                        //                                                                                      Param_iSMFI.thldOB);

                        // Indicators for Stop Loss and / or Target Profit
                        cATR[i]  = new CiATR(mSymbol,TFCount[i],Param_iNATR.periodNATR);
                        cSAR[i]  = new CiSAR(mSymbol,TFCount[i],Param_iSAR.step,Param_iSAR.maxStep);
                }

} // End of CONSTRUCTOR Method CATRBreakOut()
//+-----------------------------------------------------------------------------------------------------------------------------+
//| METHOD:       ~CATRBreakOut()
//| APPLICATION:  DECONSTRUCTOR METHOD
//+-----------------------------------------------------------------------------------------------------------------------------+
CATRBreakOut::~CATRBreakOut() {

                // remove indicator class pointers
                for(int i = 0; i < _TFCount; i++) {

                        // Indicators not required parameter values, except symbol and time frame
                        delete cHA[i];

                        // Indicators for applying filters
                        delete cER[i];
                        delete cNATR[i];
                        delete cRVOL[i];

                        // Indicators for the STRATEGY
                        delete cHMA[i];
                        delete cBand[i];
                        //delete cSMFI[i];

                        // Indicators for Stop Loss and / or Target Profit
                        delete cATR[i];
                        delete cSAR[i];
                }

} // End of DECONSTRUCTOR Method ~CATRBreakOut()
//+-----------------------------------------------------------------------------------------------------------------------------+
//| METHOD:       OnTick()
//| APPLICATION:  TRADE OPERATIONS OF THE STRATEGY
//+-----------------------------------------------------------------------------------------------------------------------------+
void CATRBreakOut::OnTick(void) {

        string vMethod = "[" + (string)mSymbol + "] " + (string)__FUNCTION__;
                PrintFormat("%s Entered OnTick()",vMethod);

                if(IsNewBarM15()) {
                        RefreshBufferM15();
                        PrintFormat("%s [M15] CTR BeakOut[%s]",vMethod,NATRM15[k].nctrBreakOut); ... did not print
                        if(NATRM15[k].nctrBreakOut) {
                                Draw_SignalM15(LONG,"M15 ATR BO");
                        }
                }

                if(IsNewBarM05()) {
                        RefreshBufferM05();
                        PrintFormat("%s [M05] CTR BeakOut[%s]",vMethod,NATRM05[k].nctrBreakOut); ... did not print
                        if(NATRM05[k].nctrBreakOut) {
                                Draw_SignalM15(SHORT,"M05 ATR BO");
                        }
                }

                if(IsNewBarM01()) {
                        RefreshBufferM01();

                        // CLASS INTERNAL METHOD TrailOrganicExit() HAVE IN BUILT IN CONTROLS FOR SUB STRATEGY MAGIC NUMBERS
                        if(cPositionInfo.TotalByMagic(mSymbol,mMagicATRBO) > 0) {
                                //TrailTP();
                                TrailOrganicExit();
                        }
                        // CHECK IF ANY NEW POSITION CAN BE OPENED
                        if(cPositionInfo.TotalByMagic(mSymbol,mMagicATRBO) <= 0) {
                                CheckNewPosition();
                        }
                }

} // End of method OnTick()
 
Anil Varma #:

@Carl Schreiber Sorry for late reply, as was struggling the the issued to resolve.

I was not impatient :) and allowed more than 20 minutes to see if any result are out.

However I have given up on this, as when I tried another class that one is working without any problem.

It seems while making changes to my files (as I lost them before reinstalling MQL5) might be causing the issue. What I have realized that it does not go to the OnTick() method and hangs before that.

Debug also did not gave any fruitful results.

Would be great to know how to check if an class is initialized properly with 'constructor' method.

Here is the code, of the class. May be expert can point out error. The complete code can not be attached and there are too many dependencies. So just by looking code, if some error can be traced than it could be helpful.

Sorry but this from your log:

2023.04.24 18:28:36.125 US30,Daily: history begins from 2022.01.03 00:00
2023.04.24 18:30:41.528 stopped by user

are two minutes (18:28 .. 18:30) and not 20 minutes.