OPEN-SOURCE SCRIPT
Bollinger Bands Simple Strategy

This is a simple Bollinger Bands mean-reversion strategy
It works like this:
BUY when price closes below the lower Bollinger Band
SELL when price closes above the upper Bollinger Band
It only opens one trade at a time because pyramiding = 0
Once a trade is open, it manages risk with:
a dynamic stop loss based on the most recent swing low/high plus an ATR buffer
a target at the Bollinger middle band (basis, the 20 SMA)
So the logic is:
long trades expect price to move back up toward the middle band
short trades expect price to move back down toward the middle band
The chart also shows:
the basis as a blue line
the upper and lower bands
an orange stop loss line
a light-green target line
BUY/SELL markers on entry
exit labels when a trade closes
One important detail: the stop loss and target are dynamic, so they update every bar while the trade is open. That means the stop can trail as price moves.
In simple terms, this strategy is trying to catch short-term reversals after price stretches too far outside the Bollinger Bands, then exit when price returns to the middle.
It works like this:
BUY when price closes below the lower Bollinger Band
SELL when price closes above the upper Bollinger Band
It only opens one trade at a time because pyramiding = 0
Once a trade is open, it manages risk with:
a dynamic stop loss based on the most recent swing low/high plus an ATR buffer
a target at the Bollinger middle band (basis, the 20 SMA)
So the logic is:
long trades expect price to move back up toward the middle band
short trades expect price to move back down toward the middle band
The chart also shows:
the basis as a blue line
the upper and lower bands
an orange stop loss line
a light-green target line
BUY/SELL markers on entry
exit labels when a trade closes
One important detail: the stop loss and target are dynamic, so they update every bar while the trade is open. That means the stop can trail as price moves.
In simple terms, this strategy is trying to catch short-term reversals after price stretches too far outside the Bollinger Bands, then exit when price returns to the middle.
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.
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.
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.