Tool
Market Structure + Liquidity (SMC)
market.smc_structure
Inputs
The swing pivots (from a zigzag or structure tool) marking the chart's highs and lows. The detector reads them to track the current structure and find equal-level liquidity.
Outputs
A bundle of structure events: BOS and CHoCH breaks with their swing levels, equal-high/low liquidity pools, and any sweeps. Feed it into interpretor.market_structure or interpretor.liquidity to drive bias and entry logic.
Smart-Money-Concepts structure reads the chart's skeleton: it tracks swing highs and lows and flags when price breaks one (a Break of Structure that continues the trend, or a Change of Character that warns of a reversal). It also marks equal highs and lows where stop-liquidity pools, and notes when price sweeps that liquidity.
How it works
From the swing pivots you feed in, it maintains the most recent confirmed high and low. When price clears one of them by break_buffer it labels a BOS (same-direction break) or CHoCH (opposite-direction break); confirm_mode decides whether a wick or a full close is needed. Equal highs/lows are detected when several pivots sit within eq_tolerance and meet eq_min_touches, and a sweep is logged when price pierces that pool then reclaims it inside reclaim_window bars.
Modes
Confirm mode options
A structure break only counts when a bar closes beyond the swing level, filtering out wicks that briefly poke past and snap back.
When to use: The safer default — fewer false breaks, at the cost of confirming a bar or two later.
A structure break counts the moment any wick trades through the swing level, the most sensitive setting.
When to use: When you want the earliest possible read on a break and accept more noise.
Liquidity side options
Tracks equal highs, where buy-stop and breakout orders pool above the market, and flags when price sweeps up through them.
When to use: Hunting sweeps of resting highs before a short, or breakouts above equal highs.
Tracks equal lows, where sell-stop and breakdown orders pool below the market, and flags when price sweeps down through them.
When to use: Hunting sweeps of resting lows before a long, or breakdowns below equal lows.
Tracks equal highs and equal lows together, mapping both pools of resting liquidity above and below price.
When to use: Range and reversal trading, where sweeps can come from either side.
Configuration
Whether a structure break is confirmed by a wick trading through the level or by a full bar close beyond it.
How far, in price, past a swing level price must trade before a break is registered. Larger demands a cleaner break and suppresses marginal pokes; 0 triggers on the slightest overshoot.
How many bars on each side define a confirmed major swing high or low. Larger yields fewer, more significant swings; smaller reacts to shorter-term structure.
The window used to detect minor internal swings that sit inside the larger structure. Larger ignores small wiggles; smaller surfaces finer internal breaks.
How close, in price, two or more pivots must sit to count as 'equal'. Larger groups loosely-aligned highs/lows into one pool; smaller demands near-exact equality.
How many pivots must cluster within eq_tolerance before they are treated as equal highs or lows (a liquidity pool). Higher needs a more obvious pool; 2 is the minimum.
How many bars price has to reclaim a level after piercing it for the move to count as a liquidity sweep rather than a genuine break. Larger is more forgiving of a slow reclaim.
Which liquidity pools to track: buyside (equal highs above price), sellside (equal lows below price), or both.
Connects to
Examples
- Wire the swing output of market.zigzag into the pivots input, then read BOS events through interpretor.market_structure to confirm a trend before entering.
- In liquidity_side 'both', detect a sweep of equal lows and feed it to interpretor.liquidity to arm a reversal long.
Common mistakes
- Confusing a CHoCH with a BOS — a CHoCH breaks structure against the prior trend (an early reversal warning), a BOS breaks with it (continuation).
- Setting eq_tolerance too wide, which lumps unrelated highs into one 'equal' pool and produces phantom liquidity levels.