Technical theory guide

Dow Theory Indicator: Automate Market Structure and Trend Phases

A Dow Theory indicator translates Charles Dow founding principles of technical analysis into automated chart algorithms. By programmatically identifying swing peaks and troughs, the indicator labels higher highs (HH), higher lows (HL), lower highs (LH), and lower lows (LL), pinpointing primary market phases and structural breaks of structure (BOS) without subjective manual trendline drawing.

Access Invite-Only Indicator

The six core tenets of Dow Theory in modern algorithmic trading

Formulated over a century ago by Wall Street Journal founder Charles Dow, Dow Theory remains the intellectual foundation of price action trading, market structure, and Smart Money Concepts (SMC).

  • The Market Discounts Everything: All available information, earnings, sentiment, and macro data are already reflected in price action.
  • The Market Has Three Trends: Primary (the main multi-month tide), Secondary (counter-trend pullbacks or corrections), and Minor (intraday and daily noise).
  • Primary Trends Have Three Phases: Accumulation (informed smart money buys), Public Participation (retail and trend followers join), and Distribution (institutional smart money unloads to late retail).
  • Indices Must Confirm Each Other: In modern markets, a breakout in technology equities (Nasdaq) should be accompanied by broader market participation (S&P 500 or Dow Jones).
  • Volume Must Confirm the Trend: Volume should expand in the direction of the primary trend and contract during secondary pullbacks.
  • A Trend Remains Intact Until Definite Reversal Signals Occur: Do not anticipate reversals before price closes past key structural swing pivots.

Manual trendlines vs automated Dow Theory indicators

Subjective trendline drawing leads to confirmation bias where traders see patterns that fit their open positions. An automated Dow Theory indicator enforces consistency.

FeatureManual chart drawingAutomated Dow Theory indicator
Swing Pivot DetectionSubjective; varies by trader emotion and zoom levelAlgorithmic; strict fractal lookback rules (e.g. 5-bar pivots)
Break of Structure (BOS)Prone to mistaking intra-bar wicks for breaksStrictly confirmed on bar-close beyond prior swing extreme
Alerts & ExecutionRequires manual alert line setting for every chartAutomatic multi-ticker alert triggers on structural flips
Timeframe ConsistencyDifficult to maintain across 5m, 1h, and daily chartsUniform mathematical calculation applied to any resolution

Pine Script v6: Automated Dow Theory peak and trough tracker

This Pine Script v6 indicator automatically detects structural swing highs and lows, labeling HH, HL, LH, and LL and alerting upon structural breaks.

Automated Dow Theory Indicator in Pine Script v6pinescript
//@version=6
indicator("Dow Theory Structure Tracker [Pineify]", overlay=true)

// Pivot sensitivity settings
int swingLength = input.int(5, "Swing Lookback Length", minval=2)

// Find swing highs and lows
float ph = ta.pivothigh(high, swingLength, swingLength)
float pl = ta.pivotlow(low, swingLength, swingLength)

var float prevHigh = na
var float prevLow = na

// Label swing structure
if not na(ph)
    string highLabel = na(prevHigh) ? "H" : (ph > prevHigh ? "HH" : "LH")
    label.new(bar_index[swingLength], ph, highLabel, color=color.new(color.red, 20), textcolor=color.white, style=label.style_label_down, size=size.tiny)
    prevHigh := ph

if not na(pl)
    string lowLabel = na(prevLow) ? "L" : (pl > prevLow ? "HL" : "LL")
    label.new(bar_index[swingLength], pl, lowLabel, color=color.new(color.green, 20), textcolor=color.white, style=label.style_label_up, size=size.tiny)
    prevLow := pl

// Break of structure logic (BOS)
bool bullBOS = not na(prevHigh) and ta.crossover(close, prevHigh)
bool bearBOS = not na(prevLow) and ta.crossunder(close, prevLow)

plotshape(bullBOS, "Bullish BOS", shape.triangleup, location.belowbar, color.green, size=size.small, text="BOS")
plotshape(bearBOS, "Bearish BOS", shape.triangledown, location.abovebar, color.red, size=size.small, text="BOS")

if bullBOS
    alert("Bullish Dow Theory Break of Structure at " + str.tostring(close), alert.freq_once_per_bar_close)
if bearBOS
    alert("Bearish Dow Theory Break of Structure at " + str.tostring(close), alert.freq_once_per_bar_close)

Trading secondary reactions with Dow Theory

Charles Dow emphasized that secondary reactions (pullbacks) provide the safest risk-reward entry points for trend traders.

  • Wait for the Higher Low (HL): When a downtrend breaks structure to the upside, avoid chasing the breakout. Wait for the market to form its first confirmed higher low to enter with defined risk.
  • Volume Contraction on Pullback: Ensure that volume dries up while price retraces toward the broken pivot, proving that sellers lack institutional aggression.
  • Invalidation Below the HL: Place your protective stop loss slightly below the newly formed higher low pivot. If price violates this level, the secondary reaction has failed.
Where Pineify fits

Pineify® - Signals & Overlays™

Gain institutional market structure clarity. Automates Dow Theory swing highs/lows, trend clouds, and real-time buy/sell alerts on TradingView.

Also useful: Pine Script AI Coding Agent. Generate customized Dow Theory indicators, swing pivot algorithms, and market structure break alerts in Pine Script v6.

Access Invite-Only Indicator

Frequently asked questions

Educational purposes only, not financial or investment advice. Dow Theory indicators evaluate historical structural swing points. Market conditions can violate historical patterns during extreme volatility. Always employ sound risk management.

Sources and verification