R&D Blog
Simple Moving Average Filter | Trading Strategy (Entry & Exit)
I. Trading Strategy
Source: Kaufman, P. J. (2013). Trading Systems and Methods. New Jersey: John Wiley & Sons, Inc. Concept: Trend following trading strategy based on Simple Moving Average (SMA) filters. Research Goal: To benchmark the Simple Moving Average (SMA) against the Hull Moving Average (HMA). Specification: Table 1. Results: Figure 1-2. Trade Filter: Long Trades: Fast_SMA[i − 1] > Slow_SMA[i − 1]. Short Trades: Fast_SMA[i − 1] < Slow_SMA[i − 1]. Index: i ~ Current Bar. Portfolio: 42 futures markets from four major market sectors (commodities, currencies, interest rates, and equity indexes). Data: 36 years since 1980. Testing Platform: MATLAB®.
II. Sensitivity Test
All 3-D charts are followed by 2-D contour charts for Profit Factor, Sharpe Ratio, Ulcer Performance Index, CAGR, Maximum Drawdown, Percent Profitable Trades, and Avg. Win / Avg. Loss Ratio. The final picture shows sensitivity of Equity Curve.
Tested Variables: Slow_SMA_Length, Fast_SMA_Index (Definitions: Table 1):
Figure 1 | Portfolio Performance (Inputs: Table 1; Commission & Slippage: $0).
STRATEGY | SPECIFICATION | PARAMETERS |
Auxiliary Variables: | Slow_SMA(Close, Slow_SMA_Length) is a “slow” simple moving average of the close price over a period of Slow_SMA_Length. Fast_SMA(Close, Fast_SMA_Length) is a “fast” simple moving average of the close price over a period of Fast_SMA_Length. Fast_SMA_Length = Fast_SMA_Index × Slow_SMA_Length. | Slow_SMA_Length = [60, 1000], Step = 20; Fast_SMA_Index = [0.2, 0.98], Step = 0.02; |
Setup: | N/A | |
Filter: | Long Signal: Fast_SMA[i − 1] > Slow_SMA[i − 1]. Index: i ~ Current Bar. Short Signal: Fast_SMA[i − 1] < Slow_SMA[i − 1]. Index: i ~ Current Bar. Mode: The 2-phase reversal system (long/short). | |
Entry: | Long Trades: A buy at the open is placed after a Long Signal. Short Trades: A sell at the open is placed after a Short Signal. | |
Exit: | Stop Loss Exit: ATR(ATR_Length) is the Average True Range over a period of ATR_Length. ATR_Stop is a multiple of ATR(ATR_Length). Long Trades: A sell stop is placed at [Entry − ATR(ATR_Length) * ATR_Stop]. Short Trades: A buy stop is placed at [Entry + ATR(ATR_Length) * ATR_Stop]. | ATR_Length = 20; ATR_Stop = 6; |
Sensitivity Test: | Slow_SMA_Length = [60, 1000], Step = 20 Fast_SMA_Index = [0.2, 0.98], Step = 0.02 | |
Position Sizing: | Initial_Capital = $1,000,000 Fixed_Fractional = 1% Portfolio = 42 US Futures ATR_Stop = 6 (ATR ~ Average True Range) ATR_Length = 20 | |
Data: | 42 futures markets; 36 years (1980/01/01−2016/06/30) |
Table 1 | Specification: Trading Strategy.
III. Sensitivity Test with Commission & Slippage
Tested Variables: Slow_SMA_Length, Fast_SMA_Index (Definitions: Table 1):
Figure 2 | Portfolio Performance (Inputs: Table 1; Commission & Slippage: $100 Round Turn).
IV. Benchmarking
We benchmark the base case strategy against alternatives:
Case #1: Slow_SMA_Length = 250; Fast_SMA_Index = 0.25 (Base Case).
Case #2: Slow_SMA_Length = 500; Fast_SMA_Index = 0.25.
Case #3: Slow_SMA_Length = 750; Fast_SMA_Index = 0.25.
Case #4: Slow_SMA_Length = 1000; Fast_SMA_Index = 0.25.
Fixed Fractional Sizing | Case #1 | Case #2 | Case #3 | Case #4 |
Net Profit ($) | 390,523,449 | 47,150,145 | 4,289,092 | 905,055 |
Sharpe Ratio | 0.93 | 0.67 | 0.35 | 0.20 |
Ulcer Performance Index (UPI) | 1.16 | 0.52 | 0.17 | 0.06 |
Profit Factor | 1.40 | 1.53 | 1.21 | 1.15 |
CAGR (%) | 18.06 | 11.71 | 5.01 | 1.97 |
Max. Drawdown (%) | (46.80) | (60.63) | (68.79) | (63.37) |
Percent Profitable Trades (%) | 36.67 | 36.19 | 30.85 | 28.21 |
Avg. Win / Avg. Loss Ratio | 2.43 | 2.70 | 2.70 | 2.92 |
Table 2 | Inputs: Table 1; Fixed Fractional Sizing: 1%; Commission & Slippage: $100 Round Turn.
V. Rating: Simple Moving Average (SMA) Filter | Trading Strategy
A/B/C/D
VI. Summary
(i) The Simple Moving Average (SMA) is less robust than the Hull Moving Average (HMA); (ii) Based on the above sensitivity tests, preferred SMA parameters are: 100 ≤ Slow_SMA_Length ≤ 600; 0.2 ≤ Fast_SMA_Index ≤ 0.5 (Figure 1-2).
Related Entries: Hull Moving Average Filter (Entry & Exit) | Zero Lag Moving Average Filter (Entry & Exit) | Bollinger Bands – Momentum Model (Setup) | Price Momentum Model (Benchmark)
Related Topics: (Public) Trading Strategies
CFTC RULE 4.41: HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.
RISK DISCLOSURE: U.S. GOVERNMENT REQUIRED DISCLAIMER | CFTC RULE 4.41
Codes: matlab/kaufman/sma