Aggiornato

Market Structure [odnac]

2 794
Overview

This indicator is a comprehensive tool designed for traders utilizing Smart Money Concepts (SMC) and Price Action. It automatically identifies and labels significant market structure shifts, specifically BOS (Break of Structure) and CHoCH (Change of Character), helping you stay on the right side of the trend.


Key Features

Dual Logic Modes (V1 & V2):
  1. V1 (Fixed Pivot): Only utilizes confirmed pivot points. Ideal for conservative traders looking for major swing levels.
  2. V2 (Dynamic Update): Automatically updates swing points to the actual highest high or lowest low between breaks. This provides a more fluid and accurate representation of price flow.

Smart Confirmation: Unlike basic pivot scripts, this indicator uses a multi-bar confirmation logic (checking candle polarity and close sequences) to filter out market noise and false pivots.

Automatic Trend Detection: The indicator tracks the current market bias (Bullish/Bearish) and visualizes it through customizable background colors or shapes.

Clear Visual Cues: * BOS: Indicates a continuation of the current trend.

CHoCH: Signals a potential trend reversal.


How to Use

Identify Trend Direction: Use the background coloring or the shapes at the bottom to quickly identify if the market is in a Bullish (Green) or Bearish (Red) phase.

Look for Structure Breaks: * When price breaks a previous high/low, the indicator will draw a line and label it as BOS if the trend continues, or CHoCH if the trend flips.

Customize for Your Assets: * For volatile assets like XLM or other cryptocurrencies, you can adjust the Swing Left/Right Bars inputs to filter for either micro-structures or macro-trends.


Input Settings

Version: Choose between V1 (Strict Pivots) and V2 (Dynamic Ranges).

Swing Left/Right Bars: Determines the sensitivity of high/low detection. Increase these values to find "stronger" structural points.

Trend Visualization: Toggle between Background fills, Shape markers at the bottom, or None for a cleaner look.

Show Swings: Toggle the visibility of the white circles marking confirmed pivot points.


Disclaimer

Market structure is a lagging indicator by nature as it requires confirmation. Always use this tool in conjunction with other technical analysis methods (Order Blocks, Fair Value Gaps, or Volume) for the best results.
Note di rilascio
Right Bars Processing:

Explicitly excludes the pivot candle and processes exactly rightBars candles starting immediately after the pivot (using adjusted indexing: j = rightBars - 1 - i). This ensures accurate confirmation on the true right-side bars.
Note di rilascio
update visualization
Note di rilascio
Update Notes
  • Added V3 (no time limit, confirms swing when close renewal reaches N count)
  • Added Confirmation Count input (set required confirmation count for V2/V3, default 3)
  • Fixed duplicate swing label bug
  • Separated version logic (V1 no longer affected by V2/V3 logic)
Note di rilascio
Swing Point Search Range Fix (V2 & V3)
  • Fixed an issue where the auto-updated swing high/low after a BOS/CHoCH was incorrectly including the previous swing index in the search range
  • New swing high/low is now accurately detected within the BOS candle range only
Note di rilascio
Sweep Detection Update
  • Triggered when a new confirmed swing exceeds the prior swing via wick only.
Note di rilascio
Remove V1, V2
Note di rilascio
Update Notes — Major Rewrite

Structure engine
- Swing logic reworked. A bullish leg tracks a Swing High candidate; it is confirmed once N opposite-color candles with progressively lower closes print after it (bearish for a high, bullish for a low).
- Swing Low is now confirmed at the next BOS as the lowest low of the pullback, so each pullback produces exactly one Swing Low.
- If an opposite-direction CHoCH occurs mid-leg (before the swing is confirmed), the current candidate is confirmed as the swing at that point.
- BOS / CHoCH are based on candle closes, regardless of candle color. Swing prices use highs / lows.
- New option: "Count the extreme candle if it has the opposite color" (counts the candle that set the high/low as 1 when it has the opposite color).
- New debug option to show the confirmation count and reset reason on each candle.

New: Internal Structure
- The same logic runs independently with a smaller confirmation count (default 1) to capture smaller waves inside the main wave.
- Internal BOS / CHoCH are drawn with an "i" prefix and dashed lines, with their own colors, transparency, and SH / SL label options.

New: Dashboard
- Directional Bias (Weekly / Daily): shows whether price swept or closed beyond the previous period's high/low.
- Market Structure (current timeframe): direction and stage (Expansion / Continuation / Confirmed Shift) for both Main and Internal structure.
- Position, text size and on/off are configurable.

Visuals
- BOS / CHoCH labels are centered on their lines.
- Broken levels are closed out at the break bar; line and label transparency are adjustable.

Alerts
- Alert conditions for Bullish/Bearish BOS and CHoCH, for both Main and Internal structure (8 total). "Once Per Bar Close" is recommended.

Settings
- Inputs are organized into groups: External Structure / Internal Structure / Common / Dashboard.
- All labels, tooltips and comments are now in English.

Removed / changed (vs. previous version)
- Trend background / bottom shape visualization and the Swing Left/Right Bars inputs are not part of this version.
- Sweep detection is not part of this version.
Note di rilascio
Fixed overlapping main / internal labels and lines. When the main structure and the internal structure break the same level on the same bar, only the main BOS / CHoCH is now drawn. Added an input to toggle this behavior (“Hide internal break when main breaks the same level”, on by default).
Note di rilascio
Main structure BOS / CHoCH labels are now small.
Internal structure iBOS / iCHoCH labels are now tiny.
Note di rilascio
Added “BOS/CHoCH label size (pt)” and “Internal label size (pt)” inputs. Label text size can now be set numerically (in points) separately for main and internal structure.
Note di rilascio
## Update Notes

### Swing point confirmation rule changed
The count-reset condition used to confirm swing high/low candidates has been changed.

| | Before | After |
|---|---|---|
| Bullish leg (Swing High) | Resets on a new high **or** a higher close | Resets **only on a new high** |
| Bearish leg (Swing Low) | Resets on a new low **or** a lower close | Resets **only on a new low** |

### Effect
- Reduces cases where swing confirmation kept getting delayed by candles that only pushed the close higher or lower without setting a new high/low.
- Swing highs/lows are confirmed sooner.
- Applies to both external and internal structure.

### Other
- Debug labels now show only `reset(high)` and `reset(low)`.
- BOS/CHoCH detection, pullback low tracking, the dashboard, and alerts are unchanged.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.