PROTECTED SOURCE SCRIPT
已更新

BOS & CHoCH (v6, UA)

1 869
The logic of the trading strategy
This is a well-structured and concise summary of a trading strategy based on market structure analysis. Here is the English translation.

Swings
ta.pivothigh/low on a selected structure timeframe (TF). When a swing is confirmed, we fix the level and the bar_index of the current chart as an anchor for a horizontal line.

BOS (Break of Structure)
A breakout of the last Swing High (SH) or Swing Low (SL) in the direction of the current trend.

CHoCH (Change of Character)
A breakout against the trend, signaling a potential trend reversal.

Breakout
By close or by high/low (you can switch the breakout confirmation mode to closing price).
版本注释
SMC: BOS & CHoCH + IDM (v6.1, UA) — What it does

This indicator maps market structure in a clean, multi-timeframe way and highlights three things:
1. BOS (Break of Structure): continuation breaks in the current trend
2. CHoCH (Change of Character): first break against the prior trend (potential reversal)
3. IDM / Inducement (“sweep”): quick liquidity grabs of recent local highs/lows

It draws labeled levels right on the chart and provides alert conditions for all events.



How it builds the signals

1) Structure pivots (on your chosen “Structure Timeframe”)
• You choose a Structure TF (Current, 15, 60, 240, or 1D).
• On that TF the script finds confirmed swing highs/lows using ta.pivothigh/ta.pivotlow with your left/right bar settings.
• It captures both the swing price and the exact swing time on the Structure TF (no lookahead), then “projects” that information onto your current chart.
• Result: each swing level is anchored at the true pivot time (using xloc.bar_time), so levels line up correctly across timeframes.

2) BOS & CHoCH detection (evaluated on the current chart TF)
• The last confirmed Swing High (SH) and Swing Low (SL) from the Structure TF act as reference levels.
• On your current TF, the script checks price crossing logic:
• BOS Up: price breaks above the last SH while trend is already bullish.
• BOS Down: price breaks below the last SL while trend is already bearish.
• CHoCH Up: first break above SH when the prior trend wasn’t bullish (potential regime flip to up).
• CHoCH Down: first break below SL when the prior trend wasn’t bearish (potential flip to down).
• You can choose close-only confirmation (break must occur on candle close) or allow wick-based confirmation.
• Each event draws a horizontal line starting at the pivot’s original time and a label (“BOS ↑/↓”, “CHoCH ↑/↓”). Optional right-extension keeps the level live as price moves.

3) IDM (Inducement) / Liquidity sweep (on the current chart TF)
• Separately from the Structure TF, the script tracks recent local pivots on the current TF (with independent left/right settings).
• A potential bearish inducement (IDM ⤒) is flagged when price sweeps above the latest confirmed local high.
• A potential bullish inducement (IDM ⤓) is flagged when price sweeps below the latest confirmed local low.
• Options refine what counts as a sweep:
• Wick-only mode: require that the candle does not close beyond the swept level (liquidity grab rather than a full break).
• Minimum wick size: the upper/lower wick must be at least X% of the bar’s range.
• Lookback window: ignore very old local pivots.
• Allow equality: treat “equal high/low” touches as sweeps if desired.
• Each inducement is drawn as a dashed horizontal line from the local pivot’s time to the current bar, with a label “IDM ⤒/⤓”.



Visuals & housekeeping
• Colors, line width, text size, and whether to extend lines to the right are user-configurable.
• You can show/hide swing labels (SH/SL).
• onlyLatest mode clears previous drawings and shows only the most recent level per type.
• keepLast limits how many BOS, CHoCH, IDM lines and labels are kept to avoid clutter.



Alerts

Built-in alert conditions:
• BOS Up / BOS Down
• CHoCH Up / CHoCH Down
• IDM Long (sweep Low) / IDM Short (sweep High)

Add an alert on the indicator and choose the condition you need.



Practical notes
• Structure is identified on the Structure TF; breaks and inducements are evaluated on your current TF. This gives precise context from higher timeframes while keeping execution responsive.
• For stricter signals, enable close-only for BOS/CHoCH and wick-only for IDM, and increase the minimum wick %.
• For more frequent signals, reduce pivot widths (left/right) and allow equality in IDM.

That’s it—clean structure, clear breaks, and actionable sweep context, all aligned by the correct pivot time.
If you spot a bug, please let me know—I’ll do my best to fix it. If you have ideas for improvements message in comments.

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。