Backtesting/Optimization Stop Out

 

I am running Windows XP x64 OS and when I optimize my EA program using a year backtest, it stops within 1 week.

What would cause the optimation to initiate a premature Stop Out?

 

Maybe you don't have a years worth of data on the time frame you are trying to test ? have you checked on a chart in the time frame you are testing ?

 

My optimization data setting is from 2011.01.01 to 2012.01.01 and my chart data is from 1999.01.04 to the present.

 
What messages do you get in the journal when the run finishes ?
 

Journal messages:

2012.08.18 10:16:55 2011.01.07 07:05 Tester: order #62 is closed [last entry]

2012.08.18 10:16:55 2011.01.07 07:05 1ma__atr: stopped because of Stop Out

2012.08.18 10:16:55 2011.01.07 06:25 1ma__atr EURUSD,M5: committing 13412 of 13997.72 (95.82%) & risking -747.24 (3.49%) to gain 1350.78

2012.08.18 10:16:55 2011.01.07 06:25 1ma__atr EURUSD,M5: open #62 sell 4.79 EURUSD at 1.29861 sl: 1.30017 tp: 1.29579 ok



 
Rudii:

Journal messages:

2012.08.18 10:16:55 2011.01.07 07:05 Tester: order #62 is closed [last entry]

2012.08.18 10:16:55 2011.01.07 07:05 1ma__atr: stopped because of Stop Out


You got a Margin call.
 

That is interesting since my Stop Loss was set at 1.30017 which would have resulted in a loss of $747.04.

However, the program executed a stop at 1.29990 resulting in a loss of $617.91.

The high Bid for that 2011.01.07 07:05 bar was 1.29993.

Why would backtesting cease to continue till my testing stop date od 2012.01.01 since the account had $13,997.72 before the trade?

 
Rudii:

That is interesting since my Stop Loss was set at 1.30017 which would have resulted in a loss of $747.04.

However, the program executed a stop at 1.29990 resulting in a loss of $617.91.

The high Bid for that 2011.01.07 07:05 bar was 1.29993.

Why would backtesting cease to continue till my testing stop date od 2012.01.01 since the account had $13,997.72 before the trade?

Maybe you have a very low leverage account so the margin requirement is very high . . .
 
Rudii: 2012.08.18 10:16:55 2011.01.07 07:05 1ma__atr: stopped because of Stop Out

  1. Once you are stopped out, that test is over.
  2. Not only do you need to calculate margin required to open. You need to calculate the available margin at the most unfavorable excursion (i.e. SL) to avoid a margin call/stop out. See my code.
Reason: