OPEN-SOURCE SCRIPT
Structure & Trend Context

Structure & Trend Context is a clean overlay that visualises market structure and trend direction without cluttering the chart. It is built as a context tool to support your own analysis, not as a signal system.
What it shows
- Trend filter: a fast and a slow EMA define the prevailing direction. The slow EMA is colour-coded by bias (up / down / neutral).
- Volatility band: an ATR band around the fast EMA gives a sense of normal price travel and dynamic over-/under-extension.
- Swing structure: the most recent confirmed swing high and swing low are tracked and drawn as reference levels.
- Structure breaks (BoS): a marker appears only when price closes beyond the prior swing by an ATR buffer while in trend. Each level is locked after it breaks, so markers stay rare and meaningful rather than firing on every minor poke.
- Context panel: a compact top-right table showing current trend bias, last higher high and last lower low.
How to use it
Read the chart first. Use the trend filter and band for context, the swing levels for reference, and treat a structure break as one piece of confluence, not a standalone trigger. Raise "Swing sensitivity" on higher timeframes or noisy assets to keep only the larger structure.
Inputs
Every layer (band, swing levels, structure markers, raw pivots, panel, bar tint) has its own toggle, and the EMA, ATR and pivot lengths are fully adjustable.
Notes
This indicator is a visualisation aid for discretionary analysis. It does not predict price, does not generate buy or sell recommendations, and is not financial advice. Markers are confirmed on bar close and do not repaint. Open-source — adapt it to your own workflow.
What it shows
- Trend filter: a fast and a slow EMA define the prevailing direction. The slow EMA is colour-coded by bias (up / down / neutral).
- Volatility band: an ATR band around the fast EMA gives a sense of normal price travel and dynamic over-/under-extension.
- Swing structure: the most recent confirmed swing high and swing low are tracked and drawn as reference levels.
- Structure breaks (BoS): a marker appears only when price closes beyond the prior swing by an ATR buffer while in trend. Each level is locked after it breaks, so markers stay rare and meaningful rather than firing on every minor poke.
- Context panel: a compact top-right table showing current trend bias, last higher high and last lower low.
How to use it
Read the chart first. Use the trend filter and band for context, the swing levels for reference, and treat a structure break as one piece of confluence, not a standalone trigger. Raise "Swing sensitivity" on higher timeframes or noisy assets to keep only the larger structure.
Inputs
Every layer (band, swing levels, structure markers, raw pivots, panel, bar tint) has its own toggle, and the EMA, ATR and pivot lengths are fully adjustable.
Notes
This indicator is a visualisation aid for discretionary analysis. It does not predict price, does not generate buy or sell recommendations, and is not financial advice. Markers are confirmed on bar close and do not repaint. Open-source — adapt it to your own workflow.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.