Tool
Market Structure Interpretor (SMC)
interpretor.market_structure
Inputs
A market structure + liquidity bundle from market.smc_structure. This tool reads its STRUCTURE group — the labelled swings (HH/HL/LH/LL) and the breaks between them.
Outputs
A boolean that is true on each bar the chosen structure condition holds (a fresh break for the break modes, or the held state for bias_is / level_is).
Reads the market-structure side of a Market Structure + Liquidity bundle and turns it into a yes/no gate about trend shifts. A Break-of-Structure (BOS) confirms the trend is continuing; a Change-of-Character (CHoCH) is the first sign it may be flipping. Use it to align entries with structure.
How it works
It reads the STRUCTURE group of a market.smc_structure bundle, and the mode picks which structure condition to test: is_bos, is_choch and is_break fire on the bar where the level breaks, bull_break and bear_break add a direction, level_is reports the broken level's grade, and bias_is reports the held trend bias. The required_level knob (internal or swing) lets you demand major swing-grade structure and ignore minor breaks; required_bias sets the trend to match in bias_is mode.
Modes
Mode options
Fires on the bar a swing level breaks in the direction of the existing trend — confirmation that the trend continues.
When to use: Confirm trend continuation before adding to a position.
Fires on the bar price breaks structure against the prior trend — the first warning the trend may be reversing.
When to use: Catch the earliest hint of a reversal at a major swing.
Fires on the bar any structure level breaks, whether it is a BOS or a CHoCH and in either direction.
When to use: Gate on 'something structural just happened' without caring which kind.
Fires only when the structure break is upward — price closes above the broken level.
When to use: Filter long entries to upside structure breaks only.
Fires only when the structure break is downward — price closes below the broken level.
When to use: Filter short entries to downside structure breaks only.
A held state: true while the structure's overall trend bias equals required_bias (bullish, bearish, neutral or ranging).
When to use: Keep a strategy active only while structure agrees with your intended direction.
A held state: true when the broken level's grade matches required_level (internal minor structure or swing major structure).
When to use: Demand a specific structure grade before reacting to a break.
Required bias options
Require the held trend bias to be bullish (higher highs and higher lows).
When to use: Only trade longs while structure is trending up.
Require the held trend bias to be bearish (lower highs and lower lows).
When to use: Only trade shorts while structure is trending down.
Require a neutral bias — no clear up or down trend, structure is balanced.
When to use: Stand aside or trade mean-reversion when no trend is in control.
Require a ranging bias — price oscillating between a floor and ceiling with no directional structure.
When to use: Activate range-bound tactics (fade the edges) only while structure is ranging.
Required level options
Require an internal (minor) structure grade — small breaks between the larger swings.
When to use: React to early, finer breaks inside a leg.
Require a swing (major) structure grade — only the significant pivots that define the larger trend.
When to use: Ignore minor noise and act only on major swing breaks.
Configuration
Which structure condition to test: is_bos / is_choch / is_break (and the directional bull_break / bear_break) fire only on the break bar, level_is reports the broken level's grade, and bias_is reports the held trend bias.
The trend bias to match in bias_is mode: bullish, bearish, neutral or ranging.
The structure grade to require for the break and level_is modes — internal (minor structure) or swing (major structure).
Connects to
Examples
- Filter: only take longs when mode is is_choch with required_level = swing (a major change-of-character to the upside).
- Gate continuation entries on mode bull_break to confirm structure broke upward before adding to a long.
Common mistakes
- Treating a CHoCH as a guaranteed reversal — it is an early warning, not a confirmation, and can fail in choppy ranges.
- Leaving required_level on internal and getting flooded with minor breaks when you actually wanted swing-grade structure only.