VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime

DeMarker (DeM): Tom DeMark's oscillator built from highs and lows

The DeMarker indicator, usually shortened to DeM, is a momentum oscillator from Tom DeMark that looks at highs and lows instead of closes. On each bar it asks whether price reached above the previous high and whether it dropped below the previous low, then turns the balance of those two pushes into a line on a bounded scale. This page explains how that construction differs from close-based oscillators, why it responds quickly when ranges expand, where traders misread it, and how a strategy generator can test it on your own contracts.

FamilyMomentum
Also known asDeM, DeMarker indicator
Output shapeBounded oscillator with a midlineBuilt from highs and lows, not closes
In AlphaPrimeBuilt-in generator familyLevel, zone, pattern and component conditions

What it measures

DeMarker is a momentum oscillator built on bar-to-bar extension. Instead of tracking where each bar closed, it tracks how far the market managed to reach beyond the bar before it: upward through the previous high, downward through the previous low. When buyers keep lifting the high and sellers rarely press the low, the line climbs toward the top of its panel; when the opposite holds, it sinks toward the bottom. The halfway mark is the balance point, where upward and downward extension have been roughly equal over the lookback.

Tom DeMark described the indicator in his book The New Science of Technical Analysis, and the public version most charting packages follow has four stages. On every bar it compares today's high with yesterday's high; if today's high is higher, the difference is recorded as an up-extension, and otherwise the bar adds nothing on that side. It compares today's low with yesterday's low in the same way; if today's low is lower, the gap is recorded as a down-extension. Next it averages the up-extensions over the lookback, and separately averages the down-extensions over the same window. Last, it divides the average up-extension by the sum of both averages. Because the top of that fraction is always part of the bottom, the result cannot leave its bounded scale: it sits at the ceiling when only highs have been extending, at the floor when only lows have, and in the middle when the two are matched. Some charting packages stretch the same line onto a larger scale; the shape and the reading stay the same.

The contrast with RSI is the heart of the indicator. RSI averages up closes against down closes, so it only sees where each bar settled. DeMarker sees where each bar explored. A bar that spikes through the prior high and then closes below the previous close still counts as an up-extension for DeMarker, while RSI books it as a loss. That is why DeMarker reacts to range expansion: when a market breaks out of a quiet spell, new bars push past their predecessors by larger and larger amounts, and those outsized extensions dominate the averages within a few bars, often before the closes have caught up. Contraction shows up differently. Inside bars, whose high and low both stay within the prior bar, add nothing new to either side, so while a market coils the reading is driven by older bars leaving the window rather than by fresh price action. An outside bar adds to both sides at once, so its effect depends on which side it extended further.

Concept sketch (not real market data)

How it behaves in real markets

In a range, DeMarker swings between its upper and lower zones as price presses against each edge, and because it responds to the extension of highs and lows rather than to closes, it often reaches a zone on the very bar that tests the edge. In a trend it behaves differently. A market that prints a higher high on most bars, with only occasional lower lows, can hold the line in the upper zone for a long stretch, and pullbacks made of inside bars or bars that dip only slightly below the prior low barely register on the down side.

Choosing the lookback is the main decision. A short lookback averages only a handful of extensions, so a single wide bar can swing the line from one zone to the other: fast, but noisy, and prone to brief visits to the extremes that lead nowhere. A longer lookback dilutes each bar, so the line moves more slowly and reaches the zones less often, which suits filters and regime reads more than timing. The zone thresholds involve the same trade-off: set nearer the middle they produce more signals, set further out they produce fewer and later ones. Rather than settling on a setting by eye on one chart, compare several across trending and ranging periods and keep the ones whose behaviour stays similar on data they were not chosen on.

The most common misuse is treating every overbought or oversold reading as a reversal call. In a strong trend, persistent higher highs keep the line pinned near its ceiling, and selling each visit to the upper zone means fading the very extension that defines the trend. A more useful reading in that situation is whether the line leaves the zone and fails to return, or whether a new price high arrives with a lower DeMarker peak, a mismatch showing that upward reach is shrinking. A second, quieter mistake is mixing it up with the sequential counting tools that also carry DeMark's name. Those are separate studies with their own logic; DeMarker is a continuous oscillator, and its readings say nothing about where such a count stands.

Common ways to use it (concepts)

Zone exit

Leaving an extreme zone

Instead of acting when the line enters its upper or lower zone, wait for it to cross back out. A long idea triggers when DeMarker climbs out of the lower zone, a short idea when it drops out of the upper zone. In a range this catches the turn after price tests the edge, and the extra wait screens out bars that merely touch the zone.

Breakout check

Confirming a breakout’s reach

When price breaks out of a consolidation, require DeMarker to rise through its midline in the breakout direction. A real expansion shows up as highs clearing prior highs by growing amounts, so a breakout with a flat DeMarker line is one where the bars are not actually extending.

Divergence

Less reach at a new extreme

Price makes a higher high, but DeMarker makes a lower peak. Because the line is built from extension itself, this pattern says the new high was reached with less push beyond the prior bars. Traders usually wait for a confirming break, such as a cross down through the midline, before acting on it.

Pairing it with other indicator families

DeMarker says which side has been extending more, not whether the market is trending. Pairing it with ADX gives a rule the context it lacks: when trend strength is high, treat upper-zone readings as confirmation and look for pullbacks; when it is low, let the zone exits do the timing.

Since DeMarker is a ratio, it shows the balance of extension but not its size. A quiet market with tiny extensions can print the same reading as a violent one. ATR fills that gap: it tells you how many points the typical bar covers, which helps size stops for a DeMarker entry and separates genuine expansion from a high reading in a sleepy market. For breakouts, the Donchian Channel makes a natural cross-check, since it is also built from highs and lows.

Stacking it with close-location oscillators such as Williams %R or the Stochastic oscillator adds little in calm markets, where closes and extremes move together. The pairing becomes informative when they disagree: a high DeMarker with a middling close-based reading points to bars that reach higher but close back inside their range, a sign the extension is being sold into.

In AlphaPrime

In AlphaPrime, DeMarker is one of the built-in momentum families the strategy generator draws from, listed under its own name in the building-block catalogue. The input you adjust is the indicator period; conditions that compare the line with a level also take a threshold, and every condition carries a current-bar shift so a rule can look at the value a few bars back.

The basic condition types work on the main line: DeMarker crosses up through the level or crosses down through the level, is above or below the level, is rising or falling, turns up or turns down. A set of pattern conditions builds on the zones: holding overbought or holding oversold, an up failure swing or a down failure swing, hooks up in oversold or hooks down in overbought, and a double-trough up divergence or a double-peak down divergence. The parts of the calculation are exposed as well: DeMarker average gain, average loss, gain minus loss and gain plus loss, each of which can be required to be rising or falling.

The candidates are backtested on the GPU in parallel and checked out of sample, and you can set out-of-sample validation thresholds so that DeMarker rules that only fitted one stretch of history are filtered out. Combinations that pass can be exported as strategy code for trading platforms and tested further in simulation.

FAQ

DeMarker vs RSI: what is the difference?

RSI compares up closes with down closes, so it reflects where bars settle. DeMarker compares each high with the previous high and each low with the previous low, so it reflects how far bars reach. It tends to respond sooner when ranges widen, and it can disagree with RSI on bars that spike and then close back.

What settings should I use for DeMarker?

There is no single right setting. A shorter period reacts to a few wide bars and visits the zones often; a longer one is calmer and slower to turn. Test several periods and zone levels across trending and ranging stretches, and keep the ones whose behaviour holds up out of sample rather than the one that looks best on a single chart.

Is DeMarker the same as DeMark's sequential count?

No. Tom DeMark created several tools. DeMarker is a continuous oscillator built from high and low extensions; the sequential counting studies are separate tools with their own logic. A reading on one tells you nothing about the other.