Zero Lag Moving Average Filter | Trading Strategy (Entry & Exit)
I. Trading Strategy
Developer: John Ehlers and Ric Way. Source: Ehlers, J., Way, R. (2010). Zero Lag (well, almost). Concept: Trend following trading strategy based on moving average filters. Research Goal: To verify performance of the Zero Lag Moving Average (ZLMA). Specification: Table 1. Results: Figure 1-2. Trade Filter: Long Trades: Zero Lag Moving Average (ZLMA) crosses over Exponential Moving Average (EMA). Short Trades: Zero Lag Moving Average (ZLMA) crosses under Exponential Moving Average (EMA). 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.
Exponential Moving Average (EMA): Alpha = 2 / (Look_Back + 1); EMA[i] = Alpha × Close[i] + (1 − Alpha) × EMA[i − 1]; Index: i ~ Current Bar. Zero Lag Moving Average (ZLMA): Alpha = 2 / (Look_Back + 1); ZLMA[i] = Alpha × (EMA[i] + Gain × (Close[i] − ZLMA[i − 1])) + (1 − Alpha) × ZLMA[i − 1]; Index: i ~ Current Bar. Variable Gain (from the ZLMA formula): If the variable Gain is zero, the ZLMA becomes just an EMA. If the Gain is sufficiently large, the ZLMA tracks the price for all practical purposes (i.e. minimum lag and minimum smoothing). Therefore, we seek a value of Gain that is a satisfactory compromise. To get the least amount of error (Error = Close[i] − ZLMA[i]), a loop searches for the best value of Gain by varying the Gain variable from the lower Gain_Limit to the upper Gain_Limit. The default value for the variable Gain_Limit is 5 (this value is further researched in the next blog entry).
Long Signal: ZLMA[i] crosses over EMA[i], and 100*Least_Error / ATR[i] > Threshold Index: i ~ Current Bar. Short Signal: ZLMA[i] crosses under EMA[i], and 100*Least_Error / ATR[i] > Threshold Index: i ~ Current Bar. Note: Error = Close[i] − ZLMA[i]. The Least_Error is an error for the best value of Gain found via a loop which runs bar-by-bar from the lower Gain_Limit to the upper Gain_Limit. In the original paper, the Least_Error is not normalized by the ATR (Average True Range) but by a closing price. This is not adequate for tests on continuous futures contracts and therefore the original formula was adjusted. Mode: The 2-phase reversal system (long/short).
Threshold = [0, 200], Step = 5;
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.
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].
Ehlers, J., Way, R. (2010). Zero Lag (well, almost):
All smoothing filters and moving averages have lag. It’s a law. The lag is necessary because the smoothing is done using past data. Therefore, the averaging includes the effects of the data several bars ago. In this article we show you how to remove a selected amount of lag from an Exponential Moving Average (EMA). Removing all the lag is not necessarily a good thing because with no lag the indicator would just track out the price you are filtering. That is, the amount of lag removed is a tradeoff with the amount of smoothing you are willing to forgo.
VI. Rating: Zero Lag Moving Average Filter | Trading Strategy
The trading strategy based on the Zero Lag Moving Average does not perform significantly better than the strategy based on the Hull Moving Average or some other alternatives.
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.