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.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.