Countertrend / Trend Following SP Trading System
This article features a trading system for the ES/SP futures that opens trading positions counter to the short term trend when the long term trend is also counter to the short term trend. Long positions are closed when the price exceeds a shorter term simple moving average and vice versa.
The trading system was built using BioComp Dakota to enable walk-forward adaptation of the system parameter values. The system was run using daily reverse adjusted SP futures data, provided by Pinnacle Data Corp., from Jan 1994. No trading signals were generated until Jan 1995 because the performance engine requires approximately one year of data before outputting trading signals.
The screen images that follow show the Dakota system settings that were used.
A description for each of the key trading system parameters follows:
- The Min Values Above/Below Last ranges from 4 to 9 trading days. For a long signal to be generated the n prior closes for the SP contract must be above the last close and vice versa. i.e. the market must be at a short term new low to go long or a short term new high to go short.
- The MA Trend Period ranges from 100 to 300 trading days and the Trend Threshold ranges from 0% to 5%. For a long position to be generated, the last close of the SP contract is required to be above the SMA or the last close is required to be within the threshold percentage of the SMA and vice versa. i.e. If the last close is within +-x% of the SMA then both long and short positions can potentially be output.
- The MA Exit Period ranges from 2 to 12 trading days. If the trading system is long and the last close exceeds the SMA then the position is closed and vice versa.
The Proportion of Perfect while In Position (PPIP) Equity Engine is selected and a 250 trading day Performance Lookback period has been set. The Trading Delay is set to 1 trading day. i.e. The system trades on the close of the trading day that follows the trading day that has just been processed. No commission or slippage was used. i.e. Results are frictionless.
The screen images that follow show the hypothetical trading results of running the system.
There are some prolonged flat periods in the equity curve and the system didn’t manage to capture some of the very significant declines. These criticisms aside, overall the equity curve is quite consistent and sure beats buy and hold.
The average trade period is 3.4 trading days, percent time in position is 31.4%, percent winning trades is 63% and the average winner is about equal to the average loser. If this trading signal was actually traded, versus contributing to a meta-system, then slippage and commission would have to be minimized. Given that the system signal is applied on the close of the next trading day, minimizing slippage is not difficult. Hopefully this article has given others some ideas to work with.
Regards,
James











