TL;DR. An EMA of a corrected price: each value plus its change over the last half-period. The correction cancels most of the EMA's built-in delay, so the line sits on top of price in a trend, at the price of running past it when the trend turns.
What it measures
- Trend with most of the lag removed. An EMA trails price by about half its period. The ZLMA adds that much recent change to the input first, so the average lands close to where price is now.
- Speed, not smoothness. The correction doubles the latest move, so the line reacts as fast as a much shorter average while keeping the longer one's period.
- A relative of DEMA and Hull. DEMA and the Hull Moving Average remove lag by combining averages; the ZLMA removes it before averaging.
Formula
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Period | 10 | 1 to 500 | The EMA length. The lag correction looks back (period − 1) / 2 bars, rounded down. |
| Source | Close | Close, Open, High, Low, HL2, HLC3, OHLC4 | Which value of each bar is averaged. HL2 is (high + low) / 2, HLC3 adds the close and divides by 3, OHLC4 averages all four. |
Recommended periods
- 10 to 20 (fast): Entry triggers that should react within a bar or two of a move.
- 30 to 50 (medium): A trend line that keeps up with intraday swings.
- 100 and up (slow): A trend filter that still turns noticeably sooner than an EMA of the same period.
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| ZLMA | Numeric | Always | The average of the corrected price, in price units, drawn over the candles. Comparable directly to price and to any other average. |
How to read it
- Price above a rising ZLMA: an up state, confirmed with little delay.
- Price below a falling ZLMA: the mirror, a down state.
- ZLMA beyond price at a turn: the correction projected the old move forward. The overshoot is the cost of the speed; it fades over the next half-period.
- ZLMA crossing an EMA of the same period: the newest bars have moved away from the average's centre, an early sign of a turn.
Best in, worst in
Best in clean trends, where reacting at once to a new leg pays for the occasional overshoot.
Worst in choppy sessions: the doubled recent change makes the line swing as much as price, and a crossover rule on it trades every wiggle.
Three setups
1. ZLMA over EMA
Add a ZLMA(20) and an EMA(20) and a Crossover node reading them: ZLMA crossing above the EMA for longs, below for shorts. The two share a period, so the cross marks the moment the recent bars pull away from the average.
2. Fast trigger inside a slow filter
Enter long when price crosses above a ZLMA(10), but only while price is above an EMA(100) (a Comparison ANDed into the entry). The slow line keeps the fast one on the trend's side.
3. Trailing exit on the ZLMA
Hold a long while price stays above a ZLMA(30); exit through Set Exit Condition when price falls below it. The ZLMA's speed gets you out near the turn instead of several bars after it.
Common mistakes
- Treating it as a smoother line. It is faster, not smoother. If noise is the problem, a ZLMA makes it worse.
- Ignoring the overshoot. A rule that enters when price touches the ZLMA after a turn may be entering against the new move.
- Tuning the period too finely. A rule that works at ZLMA(21) and fails at 20 or 22 has found noise (overfitting in trading).
A ZLMA averages price plus its recent change: an EMA without most of its delay, paid for with an overshoot at every turn.