Download MetaTrader 5

Automatically end backtests/optimizations early?

To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
hatlle
68
hatlle 2012.10.21 14:26 

Is there a command which can forcefully stop a runthrough of a backtest or optimization pass from within the EA code?

Also, in MT4 there is an auxiliary list of optimization parameters for the inputs which will stop an optimization pass if a value is exceed. For example, maximum % drawdown can be set and the tester will automatically skip to the next pass if the current pass exceeds that value at any time.

I cannot even seem to find anything like this on the external tester controls either.

I keep hitting a problem when certain backtests end up with not enough money to open a trade, and so the backtest just sits there and goes painfully slowly until the end of the testing period. It does this even more slowly than it does int MT4! I have placed the entire contents of the OnTick() function into a conditional which checks to make sure there is enough money, but this barely speeds things up very much at all. Ideally it would be great to tell the backtest to stop straight away.

Dua Yong Rew
5422
Dua Yong Rew 2012.10.24 06:31  
hatlle:

Is there a command which can forcefully stop a runthrough of a backtest or optimization pass from within the EA code?

Also, in MT4 there is an auxiliary list of optimization parameters for the inputs which will stop an optimization pass if a value is exceed. For example, maximum % drawdown can be set and the tester will automatically skip to the next pass if the current pass exceeds that value at any time.

I cannot even seem to find anything like this on the external tester controls either.

I keep hitting a problem when certain backtests end up with not enough money to open a trade, and so the backtest just sits there and goes painfully slowly until the end of the testing period. It does this even more slowly than it does int MT4! I have placed the entire contents of the OnTick() function into a conditional which checks to make sure there is enough money, but this barely speeds things up very much at all. Ideally it would be great to tell the backtest to stop straight away.


Can try to check if your account have enough money to open a position else do a return,

this should be a workaround of your problem 

Slawa
Moderator
6840
Slawa 2012.10.29 14:02  
There is ExpertRemove function
Icarus
192
Icarus 2012.10.29 14:30  
hatlle:

Also, in MT4 there is an auxiliary list of optimization parameters for the inputs which will stop an optimization pass if a value is exceed. For example, maximum % drawdown can be set and the tester will automatically skip to the next pass if the current pass exceeds that value at any time.



Cant you use "continue", to skip to the next pass? I would like to know if there is a function to reffer to the %drawdown...

To add comments, please log in or register