Why isn't break-even limit-order EA strategy actually break-even?

Hi guys,

I’m confused in the results I’m seeing in back-testing; I’ve got a strategy which is designed to be 100% break-even, which it achieves by betting against itself:

Each trade is actually a matching pair of buy/sells, with exactly opposite amounts and stop limits. This should be 100% break-even, but the test results show a completely linear loss, and indeed the results page shows 100% loss trades.

Here are some example trades:


order type              size    price   s/l    t/p
buy limit	1	0.10	1.29590	1.29589	1.29591	0.00	10000.00
sell limit	2	0.10	1.29592	1.29593	1.29591	0.00	10000.00
buy limit	3	0.10	1.29589	1.29588	1.29590	0.00	10000.00
sell limit	4	0.10	1.29593	1.29594	1.29592	0.00	10000.00

And the results:


                size    price   s/l      t/p
s/l	1	0.10	1.29589	1.29589	1.29591	-0.01	9999.99
s/l	2	0.10	1.29593	1.29593	1.29591	-0.01	9999.89
s/l	3	0.10	1.29588	1.29588	1.29590	-0.01	9999.97
s/l	4	0.10	1.29594	1.29594	1.29592	-0.01	9999.87

Have a missed something massively obvious?

Cheers, Paul.

Here’s an even more concrete example, with two opposing trades:

							size	price	s/l	t/p
1	2012.11.26 00:19	buy limit	1	0.10	1.29590	1.29585	1.29595	0.00	10000.00
2	2012.11.26 00:19	sell limit	2	0.10	1.29592	1.29597	1.29587	0.00	10000.00
3	2012.11.26 00:20	buy		1	0.10	1.29590	1.29585	1.29595	0.00	10000.00
4	2012.11.26 00:20	s/l		1	0.10	1.29585	1.29585	1.29595	-0.05	9999.95
5	2012.11.26 00:21	sell		2	0.10	1.29592	1.29597	1.29587	0.00	9999.95
6	2012.11.26 00:21	s/l		2	0.10	1.29597	1.29597	1.29587	-0.05	9999.90

It always happens 100% of the time when trades are placed like this.

I don’t know much about EAs but looking at the numbers they don’t match up, so it shouldn’t be expected to have perfect counter trading correct? In your second post, the buy limit and sell limit in 1 and 2 are 2 pipettes different, at 1.29590 and 1.29592. Then it looks like they’re both closed 5 pipettes negative, creating loss.

Have you considered slippage? You know a pip here, a pip there.

Not just slippage that will hurt you here, but also spread. This will kill you the whole time, you are paying 4 spreads every ‘trade’ - an open and close on each. Any strategy like this is great for your broker.

These are limit orders, so there is no slippage to worry about, and the same thing goes for the spread, I think?

Spread. If you took the same position in both directions, there is a negative expectancy from spread.