Problem backtesting an EA

Having a strange problem backtesting an EA I made in Meattrader 4’s strategy tester. It stops making trades after about 8 months, no matter what dates I test.

For example, I run it for 2008 to 2012. It will make trades for the first 8 months of 2008, but then then run no more trades all the way through til 2012. If I start the next test where the last one stopped trading (Aug 2008), it will trade for another 8 or 12 months, then stop again.

The only solution so far is to test 6 months at a time. But that’s not fixing the problem. Something is wrong here. Any ideas what it might be?

RainMan 1.1.zip (13.7 KB)

Nevermind. I downloaded history data from another source and now it works :slight_smile:

Aside from what you just encountered, here’s some more things to look out for in the future that would cause an issue with a backtest.

[ul]
[li] Unrealized loss maxes out usable margin, stopping any further trades.
[/li][/ul]

[ul]
[li] EA uses pending orders, and one is left open, mitigating any further trades.
[/li][/ul]

[ul]
[li] Incorrect date for start of test.
[/li][/ul]

[ul]
[li] Conflict in code that compiles correctly, but isn’t possible. usually in the < or > area, but sometimes order related.
[/li][/ul]

These are just a few I’ve encountered along the way, but are by far the most frequent offenders.

It’s tricky figuring out what went wrong sometimes, so thanks for the tips. Duly noted.