Tester Visual Mode opens a single indicator window endlessly

 

I have no idea why EA is behaving this way in visual mode. Plus it dumps this error message too:

failed market sell 0.03 EURUSD.a [Market closed]
Error opening order : 10018 Market is closed
 
Wilson Wong: I have no idea why EA is behaving this way in visual mode. Plus it dumps this error message too:

Your EA is very badly coded and continuously opening new indicator handles. You should only initialise indicator handles in OnInit() and not in OnTick().

Also, you are not checking the trading session times before placing orders and that is why you are getting "Market Closed" errors.

If you want further guidance then you will have to show your code.

 
Fernando Carreiro #:

Your EA is very badly coded and continuously opening new indicator handles. You should only initialise indicator handles in OnInit() and not in OnTick().

Also, you are not checking the trading session times before placing orders and that is why you are getting "Market Closed" errors.

If you want further guidance then you will have to show your code.

You are right, the codes are certainly not optimized on MQL5 since they are "ported" over from MQL4 with my "freshly acquired" knowledge of MQL5 with lots of trial and error. This EA has a special ability to test combinations of indicators and facilitate addition of more new indicators to find the "effectiveness" of indicator combinations. I eyed the "multi-core" capabilities of MQL5 to speed up testing hence I ventured here. The EA was coded in MQL4 to call indicators directly from functions in multiple .mqh header files. My crude patching added "indicator handles" in place right where MQL4 codes were asking for indicators inputs. So as i understand your comment, the codes would have to be re-arranged so indicator handles are all to be placed in OnInit().

On checking the "trading session" that is certainly a valuable input to me. I will try to incorporate that into my codes.

 
Wilson Wong #: You are right, the codes are certainly not optimized on MQL5 since they are "ported" over from MQL4 with my "freshly acquired" knowledge of MQL5 with lots of trial and error. This EA has a special ability to test combinations of indicators and facilitate addition of more new indicators to find the "effectiveness" of indicator combinations. I eyed the "multi-core" capabilities of MQL5 to speed up testing hence I ventured here. The EA was coded in MQL4 to call indicators directly from functions in multiple .mqh header files. My crude patching added "indicator handles" in place right where MQL4 codes were asking for indicators inputs. So as i understand your comment, the codes would have to be re-arranged so indicator handles are all to be placed in OnInit(). On checking the "trading session" that is certainly a valuable input to me. I will try to incorporate that into my codes.

I suggest you first learn to code in MQL5 properly before trying to convert such a complicated EA from MQL4. MQL5 can very different.

Reason: