Dow theory by Trendlines
- librerie
- Jerome Stephane Eric Brivet
- Versione: 1.0
- Attivazioni: 5
JB Dow Theory — Automatic Trend Pattern Detection
Dow Theory is the foundation of all technical analysis: trends are defined by sequences of higher highs and higher lows (uptrend) or lower highs and lower lows (downtrend). But identifying these patterns manually is slow and subjective.
This indicator automates Dow Theory pattern detection by tracking swing pivots and connecting them with trendlines when a valid sequence is found.
4 Pattern Types detected:
Falling Peaks (bearish) — 3+ consecutive lower swing highs. The market is making lower highs = sellers are in control. This is the classic Dow Theory downtrend signal.
Rising Valleys (bullish) — 3+ consecutive higher swing lows. The market is making higher lows = buyers are stepping in. Classic uptrend confirmation.
Rising Peaks (bullish continuation) — 3+ consecutive higher swing highs. The uptrend is accelerating.
Falling Valleys (bearish continuation) — 3+ consecutive lower swing lows. The downtrend is accelerating.
When both peaks AND valleys confirm the same direction (e.g., falling peaks + falling valleys), the pattern strength doubles — this is the strongest Dow Theory signal.
What you see on the chart:
- Color-coded trendlines connecting the pivot sequence
- Pattern labels showing type and strength (e.g., "4 Falling Peaks")
- Pivot markers (red triangles for highs, green for lows)
- Trendlines are ray-projected to show where the trend boundary extends
No pattern = no lines. If the market is ranging or pivots are alternating without direction, the indicator stays clean. Only valid Dow Theory patterns are displayed.
Configurable:
- Swing Length: how many bars define a pivot (default 15)
- Minimum Pivots: 3, 4, or 5 consecutive pivots required
- Min Slope: filter out flat/insignificant patterns
- Keep Days: auto-clean old graphics
EA-Ready Buffers:
- Buffer 0: Dow Signal (+1=Bullish, -1=Bearish, 0=None)
- Buffer 1: Pattern Strength (pivot count, combined when both peaks+valleys confirm)
- Buffer 2: Trendline Slope (points per bar)
- Buffer 3: Pivot High markers
- Buffer 4: Pivot Low markers
- Buffer 5: Projected trendline level at current bar
Works on any symbol and any timeframe.
Why this instead of manual Dow Theory analysis:
- Manual pivot detection is subjective — different traders see different pivots.
- This uses a consistent swing length algorithm — same result every time.
- Pattern strength is quantified (3, 4, 5+ pivots) — not just "I think it's a downtrend".
- Projected trendline level tells you exactly where the trend boundary is.
- Full EA integration — automate Dow Theory trading strategies.
