• Get access

Annoying visual tester issue (on history)

To add comments, please log in or register
Amir Yacoby
1421
Amir Yacoby  

When changing an input parameter in the source of an ea that is run thru meta-editor mql5 visual tester for history data, the old value still persists.

As an example, run this ea using visual tester run in mql5: 


input bool inpTest=true;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  }
Put a break point in return(INIT_SUCCEEDED) and watch the value of inpTest. Now change it's value or even change it's type like that:
input double inpTest=5.3;

Run again, stop at breakpoint and watch the value. It seems that the visual tester when run from editor has global variables for inputs and it does not assign them newly at each run.

*-in tester non-visual run from editor, this does not happen.
**-forgot to clarify - only for debug on history data (from metaeditor)


Enrique Dangeroux
683
Enrique Dangeroux  

I also have issues with inputs over the last 2 builds (official releases). I ended up using:

#define USE_INPUTS

#ifdef USE_INPUTS

	input int inMagic = 4;     // inMagic
	...
#else

	int inMagic = 4;     // inMagic
	...
#endif

Not the most elegant solution but has saved me from the agony.

To add comments, please log in or register