OPEN-SOURCE SCRIPT
Market Structure Signals | ProjectSyndicate

Market Structure Signals automatically detects Break of Structure (BOS) and Change of Character (CHoCH) patterns using pivot-based swing analysis, generates clean entry levels with ADR10-calibrated TP1/TP2/SL zones, and provides a professional performance dashboard tracking win rates and trade history for data-driven strategy optimization.
Core Features
• 📊 Pivot-Based Market Structure Detection — Automatically identifies swing highs/lows using customizable lookback period (5-100 bars) to detect institutional order flow shifts and trend reversals.
• ⚡ BOS (Break of Structure) Signals — Triggers when price breaks previous swing high/low in trend direction, indicating continuation of smart money positioning.
• 🔄 CHoCH (Change of Character) Signals — Detects when breakout reverses previous trend direction, signaling potential trend exhaustion or reversal setup.
• 🎨 Clean Visual Presentation — Horizontal breakout lines with large BOS/CHoCH labels at breakout levels, color-coded for bullish (teal #21c997) and bearish (purple #cc24e2) setups.
• 📏 ADR10-Based TP/SL Calculation — Uses 10-day Average Daily Range (ADR10) percentage-based targets for consistent, volatility-adjusted risk management across all instruments and timeframes.
• 🎯 Dual Take Profit Levels — TP1 (default 20% of ADR10) and TP2 (default 30% of ADR10) with clean rectangular zones and price labels for clear profit targets.
• 🛡️ Stop Loss Zones — SL level (default 20% of ADR10) plotted as clean rectangular zone below entry for longs, above entry for shorts.
• 📦 Clean Zone Visualization — Rectangular boxes with customizable transparency (default 85% fill, 50% border) extend from entry bar to current bar for active trades.
• 🚫 No Position Sizing Clutter — Entry labels show clean price levels only, no quantity calculations or risk percentages cluttering the chart.
Professional Performance Dashboard
• 📈 Real-Time Statistics Panel — Top-right dashboard displays Total Signals, Closed Trades, TP1 Wins, TP2 Wins, and SL Losses with color-coded values.
• 🎯 Win Rate Metrics — Shows TP1 Win Rate (trades hitting at least TP1), TP2 Win Rate (trades reaching TP2), and Overall Win Rate (any TP hit).
• 📜 Last 10 Trades History — Color-coded trade results (TP2=teal, TP1=green, SL/Reversal=red) for quick performance review.
• 🔧 Adjustable Text Size — Dashboard text size setting (Tiny/Small/Normal/Large/Huge) for optimal visibility on any screen size or resolution.
• ✅ Mathematically Accurate — TP2 win rate always ≤ TP1 win rate (since TP2 is further), Overall win rate = TP1 win rate (any TP hit counts as win).
• 🔄 Dynamic Updates — Statistics recalculate automatically when you adjust TP/SL percentage settings to show historical performance with new parameters.
⚙️ Customization Options
Market Structure Settings
• Market Structure Lookback (5-100, default 25) — Number of candles for pivot high/low detection, lower = more sensitive, higher = major swings only.
• BOS Confirmation (Close/Wick) — Use candle close or wick for breakout confirmation, Close = conservative, Wick = aggressive entries.
• Show CHoCH Labels (true/false) — Toggle Change of Character labels on/off, disable for cleaner chart with BOS signals only.
TP/SL Settings (ADR10-Based)
• TP1 % of ADR10 (default 20%) — First target distance as percentage of 10-day Average Daily Range, adjust based on instrument volatility.
• TP2 % of ADR10 (default 30%) — Second target distance as percentage of ADR10, typically 1.5-2x TP1 for optimal risk:reward.
• SL % of ADR10 (default 20%) — Stop loss distance as percentage of ADR10, keeps risk consistent with market volatility.
🔔 How to Setup Alerts
Market Structure Signals includes built-in alert conditions for TradingView's native alert system:
Step-by-Step Alert Setup:
1.Add Indicator to Chart — Apply "Market Structure Signals" to your chart with desired settings.
2.Open Alerts Panel — Click the Alert icon (bell) in top toolbar or press Alt + A (Windows) / Option + A (Mac).
3.Create Alert — Click "Create Alert" button (+ icon).
4.Select Condition — In "Condition" dropdown, select "Market Structure Signals" and choose:
•"Bullish BOS/CHoCH" — Alert when bullish breakout detected
•"Bearish BOS/CHoCH" — Alert when bearish breakout detected
5.Configure Alert Options:
•Alert Name: e.g., "XAUUSD M30 - Bullish BOS"
•Frequency: "Once Per Bar Close" (recommended) or "Only Once"
•Expiration: Set alert duration or leave open-ended
6.Notification Settings: Enable desired notification methods:
•📱 Push notifications to TradingView mobile app
•📧 Email notifications
•🔊 Sound alerts in browser
•🪝 Webhook URL for third-party integrations
7.Save Alert — Click "Create" to activate alert.
Alert Best Practices:
• Use "Once Per Bar Close" frequency to avoid false alerts during bar formation.
• Set separate alerts for bullish and bearish signals on each timeframe you trade.
• Test alerts on demo/paper trading before live use to verify settings.
• Combine with price action confirmation before entering trades.
📈 Supported Markets & Instruments
✅ Gold (XAUUSD) — Excellent performance on M30/H1/H4 with ADR10-based targets perfectly suited for gold volatility.
✅ Forex Pairs — EUR/USD, GBP/USD, USD/JPY, AUD/USD, NZD/USD, and all major/minor pairs.
✅ Cryptocurrencies — BTC/USD, ETH/USD, and all crypto pairs (adjust ADR10 percentages for higher volatility).
✅ Stock Indices — ES (S&P 500), NQ (Nasdaq), YM (Dow Jones), RTY (Russell 2000).
✅ Individual Stocks — Large-cap stocks with sufficient liquidity and daily range.
✅ Commodities — Oil (CL), Natural Gas (NG), Silver (XAGUSD), Copper.
⏰ Recommended Timeframes
Optimal Performance:
• M10-M15 — Scalping and intraday setups, higher signal frequency, verify dashboard win rates before use.
• M30-H1 — Best balance of signal quality and frequency, recommended starting point for most traders.
Important Notes:
• Always verify recent performance using the dashboard before trading new timeframes.
• Lower timeframes (M5-M10) may produce more signals but require tighter risk management.
• Higher timeframes (H4-D1) produce fewer but more reliable structural breaks.
• ADR10-based targets automatically adapt to each timeframe's volatility characteristics.
How to Use This Indicator
Trading Workflow:
1.Apply to Chart — Add "Market Structure Signals" to your preferred instrument and timeframe (start with M30/H1).
2.Review Dashboard — Check win rates and recent trade history to assess current market structure quality and strategy performance.
3.Wait for Signal — BOS label appears when price breaks previous swing high/low, CHoCH when breakout reverses trend.
4.Confirm Entry — Use price action, candlestick patterns, or your trading system to confirm entry at breakout level.
5.Manage Trade — TP1/TP2 zones show profit targets, SL zone shows stop loss, adjust position size based on your risk tolerance.
6.Monitor Performance — Track results in dashboard, adjust TP/SL percentages if needed based on win rate data.
Strategy Tips:
• Focus on BOS signals in trending markets for continuation setups.
• Watch for CHoCH signals at key support/resistance for reversal opportunities.
• Combine with volume analysis, order flow, or momentum indicators for confirmation.
• Use higher timeframe structure (H4/D1) to filter lower timeframe signals (M30/H1).
• Adjust ADR10 percentages based on instrument: Gold 20-30%, Forex 15-25%, Crypto 30-50%.
🎯 Why This Indicator is Unique
• ✅ Volatility-adaptive targets vs fixed-pip targets
• ✅ Clean professional dashboard vs cluttered multi-panel stats
• ✅ Mathematically accurate win rates vs inflated performance metrics
• ✅ No position sizing clutter vs quantity/risk calculations on every label
• ✅ Customizable text size for any screen vs tiny unreadable text
• ✅ Built from scratch vs copy-paste indicator code
⚠️ IMPORTANT DISCLAIMERS
Educational Purpose Only
This indicator is designed for educational purposes only to help traders understand Smart Money Concepts (SMC), market structure analysis, and Break of Structure (BOS) / Change of Character (CHoCH) detection methodologies. It is NOT financial advice and should NOT be used as a standalone trading system.
Past Performance Warning
Past results are not a guarantee of future performance. Historical win rates, trade statistics, and dashboard metrics shown in backtesting or past chart data do not predict or guarantee future trading outcomes. Market conditions change, volatility fluctuates, and what worked historically may not work in current or future markets.
Risk Disclosure
Trading financial instruments involves substantial risk of loss and is not suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before trading. Never trade with money you cannot afford to lose.
Core Features
• 📊 Pivot-Based Market Structure Detection — Automatically identifies swing highs/lows using customizable lookback period (5-100 bars) to detect institutional order flow shifts and trend reversals.
• ⚡ BOS (Break of Structure) Signals — Triggers when price breaks previous swing high/low in trend direction, indicating continuation of smart money positioning.
• 🔄 CHoCH (Change of Character) Signals — Detects when breakout reverses previous trend direction, signaling potential trend exhaustion or reversal setup.
• 🎨 Clean Visual Presentation — Horizontal breakout lines with large BOS/CHoCH labels at breakout levels, color-coded for bullish (teal #21c997) and bearish (purple #cc24e2) setups.
• 📏 ADR10-Based TP/SL Calculation — Uses 10-day Average Daily Range (ADR10) percentage-based targets for consistent, volatility-adjusted risk management across all instruments and timeframes.
• 🎯 Dual Take Profit Levels — TP1 (default 20% of ADR10) and TP2 (default 30% of ADR10) with clean rectangular zones and price labels for clear profit targets.
• 🛡️ Stop Loss Zones — SL level (default 20% of ADR10) plotted as clean rectangular zone below entry for longs, above entry for shorts.
• 📦 Clean Zone Visualization — Rectangular boxes with customizable transparency (default 85% fill, 50% border) extend from entry bar to current bar for active trades.
• 🚫 No Position Sizing Clutter — Entry labels show clean price levels only, no quantity calculations or risk percentages cluttering the chart.
Professional Performance Dashboard
• 📈 Real-Time Statistics Panel — Top-right dashboard displays Total Signals, Closed Trades, TP1 Wins, TP2 Wins, and SL Losses with color-coded values.
• 🎯 Win Rate Metrics — Shows TP1 Win Rate (trades hitting at least TP1), TP2 Win Rate (trades reaching TP2), and Overall Win Rate (any TP hit).
• 📜 Last 10 Trades History — Color-coded trade results (TP2=teal, TP1=green, SL/Reversal=red) for quick performance review.
• 🔧 Adjustable Text Size — Dashboard text size setting (Tiny/Small/Normal/Large/Huge) for optimal visibility on any screen size or resolution.
• ✅ Mathematically Accurate — TP2 win rate always ≤ TP1 win rate (since TP2 is further), Overall win rate = TP1 win rate (any TP hit counts as win).
• 🔄 Dynamic Updates — Statistics recalculate automatically when you adjust TP/SL percentage settings to show historical performance with new parameters.
⚙️ Customization Options
Market Structure Settings
• Market Structure Lookback (5-100, default 25) — Number of candles for pivot high/low detection, lower = more sensitive, higher = major swings only.
• BOS Confirmation (Close/Wick) — Use candle close or wick for breakout confirmation, Close = conservative, Wick = aggressive entries.
• Show CHoCH Labels (true/false) — Toggle Change of Character labels on/off, disable for cleaner chart with BOS signals only.
TP/SL Settings (ADR10-Based)
• TP1 % of ADR10 (default 20%) — First target distance as percentage of 10-day Average Daily Range, adjust based on instrument volatility.
• TP2 % of ADR10 (default 30%) — Second target distance as percentage of ADR10, typically 1.5-2x TP1 for optimal risk:reward.
• SL % of ADR10 (default 20%) — Stop loss distance as percentage of ADR10, keeps risk consistent with market volatility.
🔔 How to Setup Alerts
Market Structure Signals includes built-in alert conditions for TradingView's native alert system:
Step-by-Step Alert Setup:
1.Add Indicator to Chart — Apply "Market Structure Signals" to your chart with desired settings.
2.Open Alerts Panel — Click the Alert icon (bell) in top toolbar or press Alt + A (Windows) / Option + A (Mac).
3.Create Alert — Click "Create Alert" button (+ icon).
4.Select Condition — In "Condition" dropdown, select "Market Structure Signals" and choose:
•"Bullish BOS/CHoCH" — Alert when bullish breakout detected
•"Bearish BOS/CHoCH" — Alert when bearish breakout detected
5.Configure Alert Options:
•Alert Name: e.g., "XAUUSD M30 - Bullish BOS"
•Frequency: "Once Per Bar Close" (recommended) or "Only Once"
•Expiration: Set alert duration or leave open-ended
6.Notification Settings: Enable desired notification methods:
•📱 Push notifications to TradingView mobile app
•📧 Email notifications
•🔊 Sound alerts in browser
•🪝 Webhook URL for third-party integrations
7.Save Alert — Click "Create" to activate alert.
Alert Best Practices:
• Use "Once Per Bar Close" frequency to avoid false alerts during bar formation.
• Set separate alerts for bullish and bearish signals on each timeframe you trade.
• Test alerts on demo/paper trading before live use to verify settings.
• Combine with price action confirmation before entering trades.
📈 Supported Markets & Instruments
✅ Gold (XAUUSD) — Excellent performance on M30/H1/H4 with ADR10-based targets perfectly suited for gold volatility.
✅ Forex Pairs — EUR/USD, GBP/USD, USD/JPY, AUD/USD, NZD/USD, and all major/minor pairs.
✅ Cryptocurrencies — BTC/USD, ETH/USD, and all crypto pairs (adjust ADR10 percentages for higher volatility).
✅ Stock Indices — ES (S&P 500), NQ (Nasdaq), YM (Dow Jones), RTY (Russell 2000).
✅ Individual Stocks — Large-cap stocks with sufficient liquidity and daily range.
✅ Commodities — Oil (CL), Natural Gas (NG), Silver (XAGUSD), Copper.
⏰ Recommended Timeframes
Optimal Performance:
• M10-M15 — Scalping and intraday setups, higher signal frequency, verify dashboard win rates before use.
• M30-H1 — Best balance of signal quality and frequency, recommended starting point for most traders.
Important Notes:
• Always verify recent performance using the dashboard before trading new timeframes.
• Lower timeframes (M5-M10) may produce more signals but require tighter risk management.
• Higher timeframes (H4-D1) produce fewer but more reliable structural breaks.
• ADR10-based targets automatically adapt to each timeframe's volatility characteristics.
How to Use This Indicator
Trading Workflow:
1.Apply to Chart — Add "Market Structure Signals" to your preferred instrument and timeframe (start with M30/H1).
2.Review Dashboard — Check win rates and recent trade history to assess current market structure quality and strategy performance.
3.Wait for Signal — BOS label appears when price breaks previous swing high/low, CHoCH when breakout reverses trend.
4.Confirm Entry — Use price action, candlestick patterns, or your trading system to confirm entry at breakout level.
5.Manage Trade — TP1/TP2 zones show profit targets, SL zone shows stop loss, adjust position size based on your risk tolerance.
6.Monitor Performance — Track results in dashboard, adjust TP/SL percentages if needed based on win rate data.
Strategy Tips:
• Focus on BOS signals in trending markets for continuation setups.
• Watch for CHoCH signals at key support/resistance for reversal opportunities.
• Combine with volume analysis, order flow, or momentum indicators for confirmation.
• Use higher timeframe structure (H4/D1) to filter lower timeframe signals (M30/H1).
• Adjust ADR10 percentages based on instrument: Gold 20-30%, Forex 15-25%, Crypto 30-50%.
🎯 Why This Indicator is Unique
• ✅ Volatility-adaptive targets vs fixed-pip targets
• ✅ Clean professional dashboard vs cluttered multi-panel stats
• ✅ Mathematically accurate win rates vs inflated performance metrics
• ✅ No position sizing clutter vs quantity/risk calculations on every label
• ✅ Customizable text size for any screen vs tiny unreadable text
• ✅ Built from scratch vs copy-paste indicator code
⚠️ IMPORTANT DISCLAIMERS
Educational Purpose Only
This indicator is designed for educational purposes only to help traders understand Smart Money Concepts (SMC), market structure analysis, and Break of Structure (BOS) / Change of Character (CHoCH) detection methodologies. It is NOT financial advice and should NOT be used as a standalone trading system.
Past Performance Warning
Past results are not a guarantee of future performance. Historical win rates, trade statistics, and dashboard metrics shown in backtesting or past chart data do not predict or guarantee future trading outcomes. Market conditions change, volatility fluctuates, and what worked historically may not work in current or future markets.
Risk Disclosure
Trading financial instruments involves substantial risk of loss and is not suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before trading. Never trade with money you cannot afford to lose.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
🚀taplink.cc/prsyndicate
⭐️JOIN TELEGRAM + DISCORD
💎JOIN SYNDICATE TODAY!
🏧SMC+ALGO TRADERS ONLY
🔱FREE & PREMIUM SMC INDICATORS
🔥Syndicate Black MT4/MT5
⚡️taplink.cc/black001
🤖Gold auto-trading bot
📕Myfxbook +++
💎100%/week DD <5%
⭐️JOIN TELEGRAM + DISCORD
💎JOIN SYNDICATE TODAY!
🏧SMC+ALGO TRADERS ONLY
🔱FREE & PREMIUM SMC INDICATORS
🔥Syndicate Black MT4/MT5
⚡️taplink.cc/black001
🤖Gold auto-trading bot
📕Myfxbook +++
💎100%/week DD <5%
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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
🚀taplink.cc/prsyndicate
⭐️JOIN TELEGRAM + DISCORD
💎JOIN SYNDICATE TODAY!
🏧SMC+ALGO TRADERS ONLY
🔱FREE & PREMIUM SMC INDICATORS
🔥Syndicate Black MT4/MT5
⚡️taplink.cc/black001
🤖Gold auto-trading bot
📕Myfxbook +++
💎100%/week DD <5%
⭐️JOIN TELEGRAM + DISCORD
💎JOIN SYNDICATE TODAY!
🏧SMC+ALGO TRADERS ONLY
🔱FREE & PREMIUM SMC INDICATORS
🔥Syndicate Black MT4/MT5
⚡️taplink.cc/black001
🤖Gold auto-trading bot
📕Myfxbook +++
💎100%/week DD <5%
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.