Bollinger Band Channel Breakout Trading Strategy
This strategy trades the price breakout of Bollinger Bands. The bands effectively define price oscillation range, with breakouts signaling potential trend turns. Strategy Logic: 1. Calculate BB midline, upper and…
This strategy trades the price breakout of Bollinger Bands. The bands effectively define price oscillation range, with breakouts signaling potential trend turns.
Strategy Logic:
Calculate BB midline, upper and lower bands. Midline is n-period SMA, band width is n-period standard deviation multiple.
Go long on lower band breakout, and short on upper band breakout.
Set stop loss on opposite band for risk control.
Trailing stop to lock in more profits, or fixed stop.
Apply mutually exclusive orders to avoid simultaneous long/short.
Advantages:
BB breakout accurately identifies trend changes.
Stops on bands allow timely trend exit.
Mutual exclusion avoids same-direction hedging.
Risks:
BB mean and deviation lag, missing best entries.
Whipsaws common in ranging markets.
Static parameters Unable to adapt changing volatility.
In summary, this strategy trades BB breakouts as a typical channel system. There is room for improvement in tuning and risk management but the overall concept is simple and robust.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 45 | length |
| v_input_2 | 2.5 | mult |
Source Pine Script
/*backtest
start: 2022-09-05 00:00:00
end: 2023-09-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("Kozlod - BB Strategy - 1 minute", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
//
// author: Kozlod
// date: 2019-05-27
// RSI - BTCUSDT - 1m
// https://www.tradingview.com/u/Kozlod/
// https://t.me/quantnomad
//
source = close
length = input(45, minval=1)
mult = input(2.5, minval=0.001, maxval=50)
basis = sma(source, length)
dev = mult * stdev(source, length)
upper = basis + dev
lower = basis - dev
plot(upper)
plot(lower)
buyEntry = crossover(source, lower)
sellEntry = crossunder(source, upper)
if (crossover(source, lower))
strategy.entry("BBandLE", strategy.long, stop=lower, oca_name="BollingerBands", comment="BBandLE")
else
strategy.cancel(id="BBandLE")
if (crossunder(source, upper))
strategy.entry("BBandSE", strategy.short, stop=upper, oca_name="BollingerBands", comment="BBandSE")
else
strategy.cancel(id="BBandSE")Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-12. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Bollinger-Band-Channel-Breakout-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Bollinger Bands Dynamic Breakout StrategyPine Script · Breakout · 1h
- Cross boundary Dynamic Range Quantitative Trading Strategy Based on Bollinger BandsPine Script · Breakout · 3h
- EMA and Bollinger Bands Breakout StrategyPine Script · Breakout · 1h
- Momentum Breakout Moving Average StrategyPine Script · Breakout · 1d
- Momentum Breakout Trading Strategy 440964Pine Script · Breakout · 5m
- Momentum Breakthrough TTM StrategyPine Script · Breakout · 1d