Short Term Trading Strategy Based on Bollinger Bands 443252
This strategy uses Bollinger Bands indicator to determine trading signals and set stop profit/loss levels. It goes long when price touches the middle band from below and goes short when price touches the middle band…

Overview
This strategy uses Bollinger Bands indicator to determine trading signals and set stop profit/loss levels. It goes long when price touches the middle band from below and goes short when price touches the middle band from above. It sets 0.5% take profit and 3% stop loss, belonging to short-term trading strategy.
Strategy Logic
The middle band of Bollinger Bands is the N-day simple moving average of closing price. The upper band is middle band + K times N-day standard deviation of closing price. The lower band is middle band - K times N-day standard deviation of closing price. It goes long when price breaks above the middle band from below, and goes short when price breaks below the middle band from above. It opens fixed size for each trade and sets 0.5% take profit and 3% stop loss.
Advantage Analysis
- Using Bollinger Bands to determine trading signals can effectively capture price breakouts.
- Adopting short-term trading, the trading cycle is very short which allows quickly switching directions.
- Fixed size position and stop profit/loss setting manage risks well per trade.
Risk Analysis
- Bollinger Bands is sensitive to market volatility. Improper parameter settings may lead to more signals but lower win rate.
- High frequency trading can significantly reduce profit margin if commissions are comparatively high.
- Improper stop profit/loss setting may lead to premature stop loss or miss bigger profits.
Solutions:
- Optimize parameters to find best combination.
- Select securities with lower commissions.
- Optimize stop profit/loss levels through backtesting.
Optimization
- Combine with other indicators like K line patterns and MACD to filter signals and improve win rate.
- Add more types of take profit like trailing stop or partial closing to expand profit potential.
- Optimize parameters of Bollinger Bands and stop profit/loss levels to find best combination.
Conclusion
The overall logic of this strategy is clear. Using Bollinger Bands to determine signals is effective. However, high trading frequency and limited profit space per trade. It's recommended to combine trend indicators to filter signals and optimize parameters to improve strategy performance.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 20 | Longitud |
| v_input_2 | 2 | Multiplicador |
Source Pine Script
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-29 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Estrategia Bollinger Bands", shorttitle="BB Strategy", overlay=true)
// Parámetros de las Bandas de Bollinger
length = input(20, title="Longitud")
mult = input(2.0, title="Multiplicador")
// Calcula las Bandas de Bollinger
basis = ta.sma(close, length)
upper_band = basis + mult * ta.stdev(close, length)
lower_band = basis - mult * ta.stdev(close, length)
// Condiciones para realizar operaciones
price_touches_basis_up = ta.crossover(close, basis)
price_touches_basis_down = ta.crossunder(close, basis)
// Lógica de la estrategia
if (price_touches_basis_up)
strategy.entry("Compra", strategy.long, qty = 1)
if (price_touches_basis_down)
strategy.entry("Venta", strategy.short, qty = 1)
// Lógica para cerrar la operación con un movimiento del 0,5% (take profit) o 3% (stop loss)
target_profit = 0.005 // Actualizado a 0.5%
stop_loss = 0.03
if (strategy.position_size > 0)
strategy.exit("Take Profit/Close", from_entry = "Compra", profit = close * (1 + target_profit))
strategy.exit("Stop Loss/Close", from_entry = "Compra", loss = close * (1 - stop_loss))
if (strategy.position_size < 0)
strategy.exit("Take Profit/Close", from_entry = "Venta", profit = close * (1 - target_profit))
strategy.exit("Stop Loss/Close", from_entry = "Venta", loss = close * (1 + stop_loss))
// Dibuja las Bandas de Bollinger en el gráfico
plot(upper_band, color=color.blue, title="Upper Band")
plot(lower_band, color=color.red, title="Lower Band")
plot(basis, color=color.green, title="Basis")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-03-01. 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/Short-Term-Trading-Strategy-Based-on-Bollinger-Bands-443252.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
- Momentum Breakout Moving Average StrategyPine Script · Breakout · 1d
- Momentum Breakout Trading Strategy 440964Pine Script · Breakout · 5m
- Momentum Breakout Trading StrategyPine Script · Breakout · 4h
- Moving Average Crossover and Upper Rail Breakthrough Impulse StrategyPine Script · Breakout · 1m