OPEN-SOURCE SCRIPT
SMI + Bollinger Bands

## SMI + Bollinger Bands
SMI + Bollinger Bands is an overlay indicator that projects the Stochastic Momentum Index directly into the price space defined by Bollinger Bands.
Traditional SMI indicators are displayed in a separate oscillator pane. This script instead transforms the SMI value into a price-relative flow line, allowing momentum, volatility, and price structure to be viewed together on the main chart.
### Core concept
The indicator calculates two related systems:
1. A standard Bollinger Band structure based on a configurable moving average and standard deviation.
2. A double-smoothed Stochastic Momentum Index calculated from the relationship between the closing price and its recent high-low range.
The SMI is then normalized using the selected SMI Threshold and projected around the Bollinger basis:
* An SMI value equal to the positive threshold aligns with the primary upper Bollinger Band.
* An SMI value equal to the negative threshold aligns with the primary lower Bollinger Band.
* Values between the thresholds appear inside the primary Bollinger range.
* Momentum exceeding the threshold can extend beyond the primary bands and into the optional extended-band zones.
This projection makes it possible to compare momentum behavior directly with current price and volatility rather than interpreting an oscillator in a separate pane.
### Plotted elements
**Bollinger basis**
The center line of the Bollinger structure. The moving-average type can be selected from SMA, EMA, SMMA/RMA, WMA, or VWMA.
**Primary Bollinger Bands**
The upper and lower volatility boundaries calculated from the selected standard-deviation multiplier.
**Extended Bollinger Bands**
Optional outer volatility zones using a separately configurable standard-deviation multiplier. These areas can help visualize unusually extended price or momentum conditions.
**SMI Flow**
The yellow line represents the projected Stochastic Momentum Index. Its position shows where momentum currently sits relative to the Bollinger structure.
**SMI Flow-Base**
The white line is an EMA-smoothed version of the projected SMI Flow. It provides a slower reference line that can be used to observe momentum direction, compression, expansion, and crossings.
### Inputs
**Bollinger Band settings**
* Length: Lookback period used for the Bollinger basis and standard deviation.
* Basis MA Type: Moving-average calculation used for the basis.
* Source: Price source used for the Bollinger calculations.
* StdDev: Multiplier used for the primary Bollinger Bands.
* Extended StdDev: Multiplier used for the optional outer bands.
* Use Extended Bands: Enables or disables the extended volatility zones.
**SMI settings**
* %K Length: Lookback period used to determine the recent high-low momentum range.
* %D Length: Double-EMA smoothing applied during the SMI calculation.
* EMA Length: Smoothing applied to the projected SMI Flow-Base line.
* SMI Threshold: Defines which positive and negative SMI values align with the primary upper and lower Bollinger Bands.
### General interpretation
The indicator is intended as a visual analysis framework rather than a standalone entry system.
Traders may use it to study:
* Momentum changes relative to volatility.
* SMI Flow and Flow-Base crossings.
* Momentum expansion beyond the primary bands.
* Momentum rejection from extended zones.
* Divergence between price movement and projected momentum.
* Compression around the Bollinger basis.
* Confluence with trend, structure, volume, support, resistance, or other analysis.
A movement outside a band does not automatically indicate a reversal. Strong trends can remain extended, and crossings can occur repeatedly during sideways or volatile conditions. Market context and risk management remain necessary.
### Calculation behavior
This script does not use future data, lookahead calculations, or higher-timeframe requests. Values on the active candle may continue changing as the candle’s high, low, and close update. Historical values are finalized after their respective candles close.
### Disclaimer
This indicator is provided for research, education, and chart analysis. It does not provide guaranteed trade signals, financial advice, or predictions of future market performance. Users are responsible for independently evaluating all trading decisions and managing their own risk.
SMI + Bollinger Bands is an overlay indicator that projects the Stochastic Momentum Index directly into the price space defined by Bollinger Bands.
Traditional SMI indicators are displayed in a separate oscillator pane. This script instead transforms the SMI value into a price-relative flow line, allowing momentum, volatility, and price structure to be viewed together on the main chart.
### Core concept
The indicator calculates two related systems:
1. A standard Bollinger Band structure based on a configurable moving average and standard deviation.
2. A double-smoothed Stochastic Momentum Index calculated from the relationship between the closing price and its recent high-low range.
The SMI is then normalized using the selected SMI Threshold and projected around the Bollinger basis:
* An SMI value equal to the positive threshold aligns with the primary upper Bollinger Band.
* An SMI value equal to the negative threshold aligns with the primary lower Bollinger Band.
* Values between the thresholds appear inside the primary Bollinger range.
* Momentum exceeding the threshold can extend beyond the primary bands and into the optional extended-band zones.
This projection makes it possible to compare momentum behavior directly with current price and volatility rather than interpreting an oscillator in a separate pane.
### Plotted elements
**Bollinger basis**
The center line of the Bollinger structure. The moving-average type can be selected from SMA, EMA, SMMA/RMA, WMA, or VWMA.
**Primary Bollinger Bands**
The upper and lower volatility boundaries calculated from the selected standard-deviation multiplier.
**Extended Bollinger Bands**
Optional outer volatility zones using a separately configurable standard-deviation multiplier. These areas can help visualize unusually extended price or momentum conditions.
**SMI Flow**
The yellow line represents the projected Stochastic Momentum Index. Its position shows where momentum currently sits relative to the Bollinger structure.
**SMI Flow-Base**
The white line is an EMA-smoothed version of the projected SMI Flow. It provides a slower reference line that can be used to observe momentum direction, compression, expansion, and crossings.
### Inputs
**Bollinger Band settings**
* Length: Lookback period used for the Bollinger basis and standard deviation.
* Basis MA Type: Moving-average calculation used for the basis.
* Source: Price source used for the Bollinger calculations.
* StdDev: Multiplier used for the primary Bollinger Bands.
* Extended StdDev: Multiplier used for the optional outer bands.
* Use Extended Bands: Enables or disables the extended volatility zones.
**SMI settings**
* %K Length: Lookback period used to determine the recent high-low momentum range.
* %D Length: Double-EMA smoothing applied during the SMI calculation.
* EMA Length: Smoothing applied to the projected SMI Flow-Base line.
* SMI Threshold: Defines which positive and negative SMI values align with the primary upper and lower Bollinger Bands.
### General interpretation
The indicator is intended as a visual analysis framework rather than a standalone entry system.
Traders may use it to study:
* Momentum changes relative to volatility.
* SMI Flow and Flow-Base crossings.
* Momentum expansion beyond the primary bands.
* Momentum rejection from extended zones.
* Divergence between price movement and projected momentum.
* Compression around the Bollinger basis.
* Confluence with trend, structure, volume, support, resistance, or other analysis.
A movement outside a band does not automatically indicate a reversal. Strong trends can remain extended, and crossings can occur repeatedly during sideways or volatile conditions. Market context and risk management remain necessary.
### Calculation behavior
This script does not use future data, lookahead calculations, or higher-timeframe requests. Values on the active candle may continue changing as the candle’s high, low, and close update. Historical values are finalized after their respective candles close.
### Disclaimer
This indicator is provided for research, education, and chart analysis. It does not provide guaranteed trade signals, financial advice, or predictions of future market performance. Users are responsible for independently evaluating all trading decisions and managing their own risk.
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.