OPEN-SOURCE SCRIPT
forex swing

It detects swing highs and lows based on a chosen length.
When price breaks these levels, it marks BOS (Break of Structure) or CHOCH (Change of Character).
It tracks the current trend (bullish or bearish) based on these breaks.
👉 Then it adds a filter using the Weekly Pivot:
If price is above Weekly Pivot + bullish structure → green background
If price is below Weekly Pivot + bearish structure → red background
✔️ It also plots the Weekly Pivot line on the chart.
In simple terms:
➡️ It shows market structure (SMC) + confirms it using Weekly Pivot to highlight bullish/bearish zones visually.
When price breaks these levels, it marks BOS (Break of Structure) or CHOCH (Change of Character).
It tracks the current trend (bullish or bearish) based on these breaks.
👉 Then it adds a filter using the Weekly Pivot:
If price is above Weekly Pivot + bullish structure → green background
If price is below Weekly Pivot + bearish structure → red background
✔️ It also plots the Weekly Pivot line on the chart.
In simple terms:
➡️ It shows market structure (SMC) + confirms it using Weekly Pivot to highlight bullish/bearish zones visually.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.