A stream of swing highs and lows (typically from a zigzag) that the tool reads in sequence to classify the trend as up, down, or ranging.
Outputs
Bundle (untagged)
The current market structure label — uptrend (higher highs and higher lows), downtrend (lower highs and lower lows), or range — plus the confirming swing points and an optional projected continuation target.
Trend structure reads the market's swing highs and lows to tell you whether price is trending up, trending down, or ranging. An uptrend makes higher highs and higher lows; a downtrend makes lower highs and lower lows — this tool labels that sequence for you.
How it works
It walks the incoming swing pivots and compares each new swing to the previous one of the same type. Rising highs paired with rising lows are tagged as an uptrend (HH / HL); falling highs paired with falling lows are tagged as a downtrend (LH / LL); a mix is read as a range or a transition. swing_depth sets how many pivots back it looks to confirm the structure, and target_ratio projects a measured continuation target from the most recent confirmed swing leg.
Configuration
swing_depthscalar
How many swing pivots back the tool looks to confirm the structure. Larger needs more swings in agreement before it calls a trend, giving steadier but slower reads; smaller flips sooner.
target_ratioscalar
The projection factor used to estimate a continuation target from the most recent confirmed swing leg. 1.0 projects an equal-length move; larger projects a longer extension.
Connects to
Reads from
Feeds into
Examples
Trend gate: only take long signals while trend_structure reports an uptrend, read through interpretor.market_structure or interpretor.trend.
Continuation target: use the projected target_ratio leg to place a take-profit in the direction of the established trend.
Regime filter: stand aside when the structure is a range and only trade once a clear higher-high / higher-low or lower-high / lower-low sequence resumes.
Common mistakes
Feeding it a noisy, low-depth zigzag so tiny wiggles count as swings and the trend label flips back and forth on insignificant moves.
Treating the structure label as a guaranteed forecast — it describes what price has done, not a promise that the next swing continues the trend.