Noon Barbari
S'inscrire
Tous les articles
conceptPublié ·Lecture de 8 min

What is a trend? The Dow-theory answer that most retail traders skip

A trend is not "the line is going up." It is a sequence of higher highs and higher lows, or lower highs and lower lows — and if you cannot identify both, you do not have a trend.

Sur cette page

Ask ten traders to define a trend and you will get ten different answers. "The line is going up." "Price is above the 200-MA." "It's making higher candles." None of these are wrong, but none are testable, which is why almost every retail strategy that depends on "trade with the trend" ends up trading whatever the user's gut says — which is usually the last 30 minutes of price action.

Charles Dow, who founded the Wall Street Journal in 1889, gave us the only definition of trend that actually survives in code. It's older than computers, older than crypto, older than your favourite YouTube technical analyst — and it still works.

The Dow definition

An uptrend is a sequence of swing highs that are each higher than the previous swing high, and swing lows that are each higher than the previous swing low. Higher highs and higher lows. Both. If price makes a higher high but then drops to a lower low, the uptrend is over. If it makes a higher low but never breaks the previous high, you have a range, not a trend.

Up / down / range, in market-structure terms
Uptrend:        HH    HH
                /    \  /
              HL      HL
              /
            (start)

Downtrend:    (start)
              \
               LH      LH
                \    /  \
                 LL    LL

Range:        HH ──── HH
              /  \  /  \
             HL    HL    HL    (no break either way)

The strength of this definition is that it makes no claim about the angle, the speed, or how much price has moved. You don't need to draw a trendline (we'll get to those in a separate post). You need to identify swings and check the sequence. That's it.

What counts as a swing?

A swing is a local extremum — a bar that is higher (or lower) than the N bars on either side. The choice of N controls how zoomed-in the analysis is. N=2 captures every micro-wiggle; N=10 captures only the major turning points. There's no objectively correct N — it depends on your strategy's holding time.

Swing detection in pseudocode
# A swing high at bar t requires high[t] strictly greater than the
# highs of the N bars before AND the N bars after.
def is_swing_high(bars, t, n):
    if t < n or t >= len(bars) - n:
        return False
    pivot = bars[t].high
    for k in range(1, n + 1):
        if bars[t-k].high >= pivot or bars[t+k].high >= pivot:
            return False
    return True

# Swing low is the mirror image with .low and < / <=.

Notice the requirement of N bars after the candidate. Swing highs are not known in real-time — you only confirm them after N more bars have closed. This is why "trend" is always slightly delayed; you cannot know the most recent high is a real swing until enough time has passed.

Turning the definition into a rule

Once you have a swing detector, an "in an uptrend" check becomes a small piece of state: the last two confirmed swing highs and the last two confirmed swing lows. The rule fires when both sequences are strictly increasing.

Trend state machine, conceptually
state = {
  last_two_highs: [h1, h2],   # h2 is more recent
  last_two_lows:  [l1, l2],   # l2 is more recent
}

def is_uptrend(state):
    return state.last_two_highs[1] > state.last_two_highs[0] and \
           state.last_two_lows[1]  > state.last_two_lows[0]

def is_downtrend(state):
    return state.last_two_highs[1] < state.last_two_highs[0] and \
           state.last_two_lows[1]  < state.last_two_lows[0]

# Anything else: range or transition.

This single check is more honest than any moving-average crossover, any ADX threshold, any "price above MA" filter. Moving averages are smoothings; they can show a rising line in the middle of a range. Dow's definition cannot — if there are no higher highs, there's no uptrend, full stop.

Trends live on every timeframe

The same chart can be in an uptrend on the daily, a downtrend on the 4h, and a range on the 15m. None of these is wrong — they're observations at different zoom levels. A common professional setup is to define direction on the higher timeframe (say, daily uptrend) and entries on the lower (4h pullback to a higher low). The higher-timeframe trend is the gate; the lower-timeframe structure is the trigger.

An uptrend breaks the first moment price closes below the most recent confirmed higher low. Not below the trendline, not below a moving average — below the structural low. That's the cleanest exit signal in the entire Dow framework, and it's what professional discretionary traders mean when they say "the structure broke."

Tighter exit: any close below the higher low. Looser exit: only on a confirmed lower low (a swing low strictly less than the previous swing low). The tighter version exits trends earlier, sometimes prematurely. The looser version holds through deeper pullbacks but gives back more on real reversals.

A rule-set snippet

rules.yaml — long when in an uptrend, exit on structure break
strategy:
  name: dow_structure_long
  indicators:
    - { id: swing,  kind: SwingDetector, lookback: 5 }
    - { id: rsi,    kind: RSI,            period: 14 }
  rules:
    entry:
      type: AND
      children:
        - { type: eq, left: swing.is_uptrend, right: 1 }
        - { type: lt, left: rsi,              right: 40 }   # buy the pullback
    exit:
      type: OR
      children:
        - { type: lt, left: bar.close, right: swing.last_higher_low }
        - { type: eq, left: swing.is_uptrend, right: 0 }
  risk:
    size_pct: 1.0
    stop_loss_atr: 2.0

Next steps

Once you can identify a trend, you'll want to draw on it — see the trendlines post for how to do that without lying to yourself. For the practical question of trend-following vs mean-reverting your way through the resulting setups, the trend-following vs mean-reversion piece covers the trade-offs.

Essaie-le sur tes propres données

Chaque concept ci-dessus est implémenté dans la plateforme. Backtest, walk-forward, paper trading, puis passage en live — même jeu de règles à chaque étape.

Lectures associées