Trend Breakout Strategy Based on Moving Turning Profile and Bollinger Bands
This strategy incorporates a forward shifted Bollinger Bands as a moving turning profile to identify potential trend breakout points. It generates trading signals when price breaks through the forward shifted bands…
Overview
This strategy incorporates a forward shifted Bollinger Bands as a moving turning profile to identify potential trend breakout points. It generates trading signals when price breaks through the forward shifted bands. Combining the trend identification strength of BB and early warning of turning points from the shifted bands aims to discover more effective entries.
Strategy Logic
Calculate standard BB with middle line, upper and lower bands.
Shift BB lines forward by a set period.
Signal long entry when price breaks above forward shifted upper band.
Signal short entry when price breaks below forward shifted lower band.
Set stop loss at opposite BB line after entry.
Advantage Analysis
Moving turning profile provides early warning for trend reversals.
Combines with BB's inherent trend identification ability for higher signal accuracy.
Preset stop loss positions allows effective risk control.
Can build positions at advantageous prices when combined with trend and swing analysis.
Risk Analysis
Improper parameter tuning may generate excessive false signals.
Moving turning profile may have premature breakout and mid-way stop loss.
Needs further trend analysis to avoid whipsaws in ranging markets.
Has some lag, may not fully capture turning points.
Optimization Directions
Test different price inputs and parameter combinations.
Add filters to avoid false breakouts.
Incorporate trend analysis to avoid being trapped.
Optimize stops based on market conditions.
Test effectiveness across different instruments and timeframes.
Combine with other indicators for more accurate entries.
Summary
This strategy fully utilizes the inherent advantages of Bollinger Bands and improves entry timing via the moving turning profile. With optimized parameters, additional filters, and further trend analysis, it can become a robust breakout system. Overall, a simple and practical strategy worth further testing and optimization for improved performance.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1_hl2 | 0 | source: hl2 | high | low | open | close | hlc3 | hlcc4 | ohlc4 |
| v_input_2 | 20 | length |
| v_input_3 | true | mult |
| v_input_4 | 26 | x_offset |
Source Pine Script
/*backtest
start: 2023-09-11 00:00:00
end: 2023-09-18 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("LAGging span leaves Bollinger Bands strategy" , shorttitle="LagBB" , overlay=true)
source = input( hl2 )
length = input(20, minval=1)
mult = input( 1.0, minval=0.0, maxval=50)
x_offset = input( 26 ,minval=0 , maxval=244 )
basis = sma(source, length)
dev = mult * stdev(source, length)
upper = basis + dev
lower = basis - dev
buyEntry = crossover(source, upper[x_offset] )
sellEntry = crossunder(source, lower[x_offset] )
if (crossover(source, upper[x_offset] ))
strategy.entry("LE", strategy.long, stop=lower, oca_name="BollingerBands", comment="LE")
else
strategy.cancel(id="LE")
if (crossunder(source, lower[x_offset] ))
strategy.entry("SE", strategy.short, stop=upper, oca_name="BollingerBands", comment="SE")
else
strategy.cancel(id="SE")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
plot( upper , color=#cccc00 , transp=50 , offset=x_offset )
plot( basis , color=#cccc00 , offset=x_offset )
plot( lower , color=#cccc00 , transp=50 , offset=x_offset )Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-19. 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/Trend-Breakout-Strategy-Based-on-Moving-Turning-Profile-and-Bollinger-Bands.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