Overview
This strategy is a quantitative trading system based on Bollinger Bands and price mean reversion principles. It monitors price deviation from the moving average, combined with Bollinger Bands breakout signals, to trade when expecting price regression after market overbought/oversold conditions. The strategy uses percentage thresholds to measure price deviation and sets reasonable trigger conditions to filter false signals and improve trading accuracy.
Strategy Principles
The core logic is based on the following key elements:
- Uses 20-day moving average as middle band, with 2 standard deviations to construct Bollinger Bands
- Introduces 3.5% price deviation threshold to identify significant divergence
- Tracks price deviation status through is_outside variable
- Triggers trading signals when price returns within Bollinger Bands
- Specific trading rules:
- Long when price returns from deviation and breaks above upper band
- Short when price returns from deviation and breaks below lower band
Strategy Advantages
- Robust Mean Reversion Logic
- Based on statistical principle of price returning to mean
- Ensures trading opportunity significance through deviation threshold
- Comprehensive Risk Control
- Bollinger Bands provide clear volatility range reference
- Deviation status tracking avoids trading during extreme volatility
- Strong Parameter Adjustability
- Bollinger Bands parameters adjustable to instrument characteristics
- Deviation threshold can be set according to risk preference
Strategy Risks
- Trend Market Ineffectiveness Risk
- May generate frequent false signals in strong trend markets
- Recommend adding trend filter to identify market conditions
- Parameter Sensitivity Risk
- Improper parameter settings may affect strategy performance
- Requires parameter optimization through historical data backtesting
- Slippage Cost Risk
- Frequent trading may incur high transaction costs
- Recommend adding position time limits and cost controls
Strategy Optimization Directions
- Add Market Environment Recognition
- Introduce trend strength indicators like ADX
- Dynamically adjust parameters based on market conditions
- Improve Stop-Loss and Take-Profit Mechanisms
- Set dynamic stops based on ATR
- Introduce trailing stops to protect profits
- Optimize Trading Frequency
- Add minimum position holding time
- Set trading interval to control costs
Summary
This strategy captures market overbought/oversold opportunities through Bollinger Bands and mean reversion principles, effectively controlling trading risks with reasonable deviation thresholds and status tracking mechanisms. The strategy framework has good scalability and can adapt to different market environments through parameter optimization and functionality improvements. It's recommended to focus on risk control in live trading and adjust parameters according to specific instrument characteristics.
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-04 08:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Estratégia com Bandas de Bollinger e Sinal de Retorno", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// Configurações das Bandas de Bollinger- 1

