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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.