Indicator selects from terminal order list not strategy tester order list

 

Try this:

1. Create a new EA called “Dummy” using the default EA template. No coding needed if you have the default template. Compile it to produce Dummy.ex4.

2. Run the EA in the strategy tester in (every tick) visual mode with the speed turned down.

3. Compile the attached TestInd and drop TestInd.exe onto the (strategy tester) chart window.

4. The indicator output is written to the terminal window (unexpected, though as per the manual entry for Print()). Of course you need both terminal and tester window open in the "experts" pane.

5. The indicator is reading the order list from the terminal window, NOT the strategy tester. This is evident if there are trades in the terminal, but no executed trades in the strategy tester window.

Is there a fix or workaround? I am using build 509. Running out of hair …

//+------------------------------------------------------------------+
//|                                                        Dummy.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                      TestInd.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window

int start() {Print("There are ",OrdersTotal()," orders");}
 
Yes, it behaves like you describe. Everything that does not originate in the tested EA has no access to the testing sandbox. You may use iCustom() to invoke the indicator from within the tested EA.
 
Greevus:

5. The indicator is reading the order list from the terminal window, NOT the strategy tester. This is evident if there are trades in the terminal, but no executed trades in the strategy tester window.

Is there a fix or workaround? I am using build 509. Running out of hair …

The clue is in the name: Strategy Tester, it's not Indicator Tester. It is designed to test EAs, some Indicators will work some won't . . . this thread gives some additional info on what works and what doesn't: https://www.mql5.com/en/forum/143310/page2#753353

I asked the Service Desk if there were plans to address this issue in the changes being worked on for MT4, the reply was . . . "No, sorry. MT4 tester will not be improved in such way" you might want to make a similar suggestion, if enough people ask it might be addressed as it has been in MT5.

 
RaptorUK:

The clue is in the name: Strategy Tester, it's not Indicator Tester. It is designed to test EAs, some Indicators will work some won't . . . this thread gives some additional info on what works and what doesn't: https://www.mql5.com/en/forum/143310/page2#753353

I asked the Service Desk if there were plans to address this issue in the changes being worked on for MT4, the reply was . . . "No, sorry. MT4 tester will not be improved in such way" you might want to make a similar suggestion, if enough people ask it might be addressed as it has been in MT5.


Hi Guys,

Thanks again for the replies. This is one of those "it should work like this", which I guess is open to opinion. I would have thought that if i drop an indicator on a chart generated by the strategy tester, it would "see" everything as the EA would see. So now it is impossible to have an indicator show representations of the order status. So bizarre I thought it was a bug ...

Best

John

 
Greevus:


Hi Guys,

Thanks again for the replies. This is one of those "it should work like this", which I guess is open to opinion. I would have thought that if i drop an indicator on a chart generated by the strategy tester, it would "see" everything as the EA would see. So now it is impossible to have an indicator show representations of the order status. So bizarre I thought it was a bug ...

Please contact the Service Desk . . . one more voice might help.
 
RaptorUK:
Please contact the Service Desk . . . one more voice might help.


Hi RaptorUK,

I am happy to do that, but exactly how? Sorry to be thick, but can't find a service desk link?

Best,

John

 
Greevus:


Hi RaptorUK,

I am happy to do that, but exactly how? Sorry to be thick, but can't find a service desk link?

You can find instructions in this post: Service Desk
Reason: