Preventing Whipsaw using a Gradient Calculation

Continuing on from June 28th investigation… I extended the strategy to calculate the angle of the gradient for the moving averages and integrated this into the trading signals.

Initial tests over a small window (Dec 2010) show less loss trades – this is good news, but also some bad news.

Without gradient angle checking enabled

Here we see 3 loss trades, then a profit trade, then a loss trade.

With the gradient angle checking enabled

Here we see only two loss trades, but unfortunately no profit trade. The profit trade was not opened until too late, and turned into a loss trade.

Comparing the statistics for the period tested (01/12/2010 – 01/03/2011), we find the following.

Total profit/loss

-506.49

Total profit/loss

-387.36

Total profit of all trades

281.49

Total profit of all trades

33.66

Total loss of all trades

787.98

Total loss of all trades

421.02

 

 

   

 

Number of trades closed

35

Number of trades closed

11

Number of long trades

20 (57.1%)

Number of long trades

5 (45.5%)

Number of short trades

15 (42.9%)

Number of short trades

6 (54.5%)

Number of long profit trades

6 (60%)

Number of long profit trades

1 (100%)

Number of short profit trades

4 (40%)

Number of short profit trades

0 (0%)

Number of profit trades

10 (28.6%)

Number of profit trades

1 (9.1%)

Number of loss trades

25 (71.4%)

Number of loss trades

10 (90.9%)

While it is fantastic that our number of loss trades has gone from 25 to 10… our number of profit trades have gone from 10 to 1. However, for this period we did lose less money than we would have without the gradient checking strategy.

  • Perhaps we can optimize the angle or gradient periods to be used…
  • Additionally, looking at where the loss trades were opened, the fast moving average looks like it had a pretty flat angle then. Maybe we can use a combination of both gradient angles?

Posted in Backtesting, Research and tagged , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *