Bollinger Crossing Death Golden Strategy
This strategy is a Bollinger Bands crossover strategy based on the Bollinger Bands indicator. By adjusting the parameters of Bollinger Bands, it is optimized for gold trading. It generates buy signals when the price…

Overview
This strategy is a Bollinger Bands crossover strategy based on the Bollinger Bands indicator. By adjusting the parameters of Bollinger Bands, it is optimized for gold trading. It generates buy signals when the price closes above the upper band and sell signals when the price closes below the lower band.
Strategy Logic
The strategy uses Bollinger Bands with a length of 50 and a multiplier of 2.5. The middle band of the Bollinger Bands is the SMA line of the price, the upper band is the middle band plus the multiplier of the standard deviation, and the lower band is the middle band minus the multiplier of the standard deviation.
When the price closes above the upper band, a buy signal is generated. When the price closes below the lower band, a sell signal is generated. It utilizes the feature of narrowing of the Bollinger Bands channels and generates signals when the breakout occurs after channel contraction.
Advantage Analysis
The advantages of this strategy include:
The optimized parameters fit gold trading and profit is steady.
Utilize the channel feature of Bollinger Bands to generate signals after reduced price fluctuation, avoiding missing opportunities.
The crossover system is easy to follow for manual trading.
The graphical display is intuitive to monitor the price movement within the bands.
Risk Analysis
There are also some risks with this strategy:
Inappropriate Bollinger Bands parameters may cause false signals. Parameters need to be tested and optimized.
Frequent trading increases costs and slippage. Parameters can be adjusted to lower trading frequency.
It is easy to hit stop loss when gold fluctuates greatly. Stop loss points can be adjusted or position management can be added.
Optimization
The strategy can be optimized from the following aspects:
Test parameters on different markets and time frames to find the optimal parameter combination.
Add position management module to generate additional entry signals through moving average, channel breakouts, etc.
Add stop loss module, using trailing stops to follow price moves.
Incorporate other indicators to filter out false signals and improve strategy stability.
Conclusion
The strategy optimizes Bollinger Bands for gold trading by adjusting parameters. It utilizes the expansion and contraction of Bollinger Bands to generate signals. There is large room for improvement in parameters optimization, position management, stop loss. Overall, the strategy has simple logic, good stability, and is suitable for manual gold trading.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 50 | BB Length |
| v_input_2 | 2.5 | Multiplier |
Source Pine Script
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Optimized Bollinger Bands Strategy for Gold", overlay=true)
// Bollinger Bands Settings
length = input(50, title="BB Length", minval=1)
mult = input(2.5, title="Multiplier", minval=0.001, maxval=50)
// Bollinger Bands
basis = sma(close, length)
upper = basis + mult * stdev(close, length)
lower = basis - mult * stdev(close, length)
// Plotting
plot(upper, color=color.blue, title="Upper Band", linewidth=2)
plot(lower, color=color.blue, title="Lower Band", linewidth=2)
// Highlight the region between upper and lower bands
bgcolor(upper > lower ? color.new(color.blue, 90) : na)
// Buy Signal with arrow
longCondition = crossover(close, upper)
plotshape(series=longCondition, title="Buy Signal", color=color.green, style=shape.triangleup, text="Buy", location=location.belowbar, size=size.small)
// Sell Signal with arrow
shortCondition = crossunder(close, lower)
plotshape(series=shortCondition, title="Sell Signal", color=color.red, style=shape.triangledown, text="Sell", location=location.abovebar, size=size.small)
// Strategy
strategy.entry("Buy", strategy.long, when=longCondition)
strategy.entry("Sell", strategy.short, when=shortCondition)
Published by ChaoZhang on the FMZ strategy square · last modified 2024-02-21. 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-Crossing-Death-Golden-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
- Adaptive Bollinger Breakout with Moving Average Quantitative Strategy SystemPine Script · Breakout · 1h
- BB Breakout StrategyPine Script · Breakout · 1d
- Bollinger Band Breakout Trend Following StrategyPine Script · Breakout · 1d
- Bollinger Band Channel Breakout Trading StrategyPine Script · Breakout · 1d
- Bollinger Band T3 Moving Average StrategyPine Script · Breakout · 10m
- Bollinger Bands Breakout Trading StrategyPine Script · Breakout · 1h