OPEN-SOURCE SCRIPT
Math by Thomas SMC Swing Range + Premium/Discount Zones

Description:
"Math by Thomas – SMC Swing Range + Premium/Discount Zones" is a Smart Money Concepts (SMC) based indicator designed to help traders visually understand market structure and value zones.
This tool automatically detects and marks:
🔺 Recent Swing Highs and Lows
🟧 Midpoint Line between swing high and low
🟥🟩 Premium/Discount Zones for value-based entries
🔤 HH, HL, LH, LL Labels to identify trend structure
🔁 BoS (Break of Structure) and CHoCH (Change of Character) confirmations
Built with Pine Script v6, this indicator is optimized for both intraday and positional traders who rely on structure-based decision-making.
🛠️ How to Use:
Apply to any chart – Works on all timeframes and instruments.
Swing High/Low Detection:
Uses pivot logic with adjustable strength to find recent key turning points.
Displays shaded horizontal boxes for visual clarity.
Midpoint Line:
Automatically drawn between the last high and low.
Acts as the fair value level for identifying overbought/oversold zones.
Premium/Discount Zones:
Above midpoint = Premium (consider shorting).
Below midpoint = Discount (consider buying).
Structure Labels:
HH (Higher High), HL (Higher Low), LH (Lower High), LL (Lower Low).
Color-coded to reflect bullish or bearish trends.
BoS & CHoCH:
Structural breaks are labeled automatically to signal possible trend continuation or reversal.
⚙️ Settings:
🎯 Pivot Strength – Adjusts how far back/forward candles must confirm a swing.
✅ Toggle visibility of:
Swing Lines
Labels
BoS / CHoCH
Premium / Discount zones
🎨 Customize colors for each visual component.
🧠 Best Practices:
Use in combination with Order Blocks, Fair Value Gaps, or Volume Imbalances.
Ideal for traders applying Smart Money Concepts (SMC) with a structure-first mindset.
"Math by Thomas – SMC Swing Range + Premium/Discount Zones" is a Smart Money Concepts (SMC) based indicator designed to help traders visually understand market structure and value zones.
This tool automatically detects and marks:
🔺 Recent Swing Highs and Lows
🟧 Midpoint Line between swing high and low
🟥🟩 Premium/Discount Zones for value-based entries
🔤 HH, HL, LH, LL Labels to identify trend structure
🔁 BoS (Break of Structure) and CHoCH (Change of Character) confirmations
Built with Pine Script v6, this indicator is optimized for both intraday and positional traders who rely on structure-based decision-making.
🛠️ How to Use:
Apply to any chart – Works on all timeframes and instruments.
Swing High/Low Detection:
Uses pivot logic with adjustable strength to find recent key turning points.
Displays shaded horizontal boxes for visual clarity.
Midpoint Line:
Automatically drawn between the last high and low.
Acts as the fair value level for identifying overbought/oversold zones.
Premium/Discount Zones:
Above midpoint = Premium (consider shorting).
Below midpoint = Discount (consider buying).
Structure Labels:
HH (Higher High), HL (Higher Low), LH (Lower High), LL (Lower Low).
Color-coded to reflect bullish or bearish trends.
BoS & CHoCH:
Structural breaks are labeled automatically to signal possible trend continuation or reversal.
⚙️ Settings:
🎯 Pivot Strength – Adjusts how far back/forward candles must confirm a swing.
✅ Toggle visibility of:
Swing Lines
Labels
BoS / CHoCH
Premium / Discount zones
🎨 Customize colors for each visual component.
🧠 Best Practices:
Use in combination with Order Blocks, Fair Value Gaps, or Volume Imbalances.
Ideal for traders applying Smart Money Concepts (SMC) with a structure-first mindset.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.