From the February 01, 2010 issue of Futures Magazine • Subscribe!

2010: A trader's odyssey


The triple moving average crossover system is an advanced variation of the classic dual moving average system. This variation adds a third moving average to address problems relating to cycle phase, which sometimes results in your being 180-degrees out of phase with the market. You will buy every top and sell every bottom. This is the flaw in a dual moving average system when you use a pair of moving averages set at 50% and 100% of the dominant cycle.

The triple moving average crossover system needs its parameters optimized to work best. If done across a broad basket of diversified markets, a profitable and robust combination can be found. Using our simple optimization, we set on the following moving average lengths: six for the shortest average, 16 for the medium one, and 80 for the longest. The simple code for our system is in “Three times average.”


The Relative Strength Index (RSI) is probably J. Welles Wilder’s best-known indicator. However, the use of the term “relative strength” is confusing. Most relative-strength calculations compare a stock against an index, such as comparing Intel (INTC) to the Semiconductor or $SOX index. Wilder’s RSI compares a stock’s gains to its losses over a set period of time. The resulting RSI graph usually is presented in a panel above or below the price chart.

The formula for RSI is:

RSI = 100 – [100/1 + RS]

RS = (average of N-period up closes)/(average of N-period down closes)

RSI provides meaningful information on a chart of any length, from five minutes to monthly. The value of N in the RS formula is the number of periods used in the calculation. Wilder suggested 14 periods as the default, but traders commonly use nine- to 21-period RSIs today.

The traditional use for RSI is an oscillator to show overbought or oversold values, or to identify divergence between RSI and price. However, RSI also can be used as a trend-following indicator. When it crosses above a given level, we buy. When it crosses below a given level, we sell. This also is a simple stop-and-reverse system. Our results reflect an eight-period RSI, 75 as a buy level and 35 as a sell level (see “Relative matters”).


Each of these methods has its qualities. Channel breakout makes similar profits on the long and short side; the other two systems make more on the short side than the long side. Year-by-year performance is correlated, but not always the same. If we can use advanced technologies to combine these three trading strategies, the resulting system should be better than any of these individual approaches.

Our first step is to create an array function that simulates each system. The function will return the defined flags based on the inputs and price data. The flags are 1 (long) or -1 (short). The function code is similar to the system code. However, where the system code includes a buy or sell order, the function code defines the function TrendComponent3Feb10 as 1 or -1.

Because our functions return bar arrays, the value will remain what the previous value of the function was if we don’t set a new value on that bar.

These simple values, 1 and -1, work much better for combining the system than the actual indicator values. Although arguments can be made that the actual indicator values may include information that the simple integers do not, the practical result often is curve-fitting and confusion, no matter how advanced the neural network or kernel regression — or the researcher applying it.

Besides the system components, we need inputs that are predictive of our desired output functions. Suppose we want to process the output so that the -1 and 1 gets turned off and is set to 0, or flat, based on various conditions. Introducing a 0 to the neural network can create a problem, however. Assume our neural network is using the hyperbolic tangent function, which ranges from -1 to 1. This means that if the value is 0 for an input, no learning takes place because 0 times anything is 0. This creates a problem. If 30% of the input values are 0 for a given input, the neural network will not train correctly.

Due to this, we will develop an input that ranges from -3 to 3. The output will be based on when the three systems would have had us long or short, but we will filter out positions based on hindsight or human expertise. This will give us a target that will produce much better results than any of the three systems, if we can create a model that learns the target.

<< Page 2 of 4 >>
comments powered by Disqus
Check out Futures Magazine - Polls on LockerDome on LockerDome