Overview
The Support-Resistance Breakout-Reversal Volume-Based Trading System with Fixed Stop Loss is a comprehensive quantitative trading strategy that combines support and resistance level identification, price breakout/reversal signals, and volume confirmation mechanisms, paired with a fixed 2% stop loss and adjustable take profit parameters. This strategy captures market trend changes by identifying breakouts or bounces at key price levels while using volume filters to confirm signal validity and improve trading success rates. The system automatically enters trades in four scenarios: breakouts above support, breakouts below resistance, reversals at support, and reversals at resistance, with each scenario requiring high trading volume to ensure sufficient market participation and momentum.
Strategy Principles
The core principles of this strategy are based on traditional technical analysis theories of support and resistance, combined with price action and volume analysis:
Support and Resistance Identification: By looking back to find past price highs and lows (default 10 periods), the strategy dynamically establishes current support and resistance levels. These key price levels represent the collective psychology of market participants and historical trading activity.
Breakout Signals:
- Long Breakout: Price closes more than 1% above resistance, indicating buyers have broken through the selling pressure zone
- Short Breakout: Price closes more than 1% below support, indicating sellers have broken through the buying support zone
Reversal Signals:
- Long Reversal: Price bounces near support (±1%) with the low testing support but closing price above support
- Short Reversal: Price drops near resistance (±1%) with the high testing resistance but closing price below resistance
Volume Confirmation: All entry signals require volume to be higher than 1.5 times its 20-period simple moving average, ensuring sufficient market participation to support price movement
Risk Management:
- Fixed 2% stop loss setting to limit maximum loss per trade
- Adjustable take profit parameter (default 3%) for risk-reward optimization
This strategy design fully considers market structure, price action, and trader psychology, capturing market momentum changes through breakouts and bounces at support and resistance levels, while using abnormal volume as an additional confirmation indicator to filter out low-quality signals.
Strategy Advantages
Through deep analysis of the code, this strategy demonstrates the following significant advantages:
Multi-dimensional Entry Signals: Simultaneously utilizing both breakout and reversal mechanisms for entries, capable of capturing trading opportunities in different market environments, suitable for both trending and ranging markets.
Volume Confirmation Mechanism: By requiring volume significantly higher than its moving average, effectively filters out potential false breakouts and reversals, improving signal quality and reliability.
Adaptive Support and Resistance: Uses dynamically calculated support and resistance levels rather than fixed levels, allowing the strategy to adapt to different market phases and volatility environments.
Clear Risk Control: Fixed 2% stop loss ensures controlled risk per trade, avoiding major account losses from single trades.
Flexible Take Profit Settings: Adjustable take profit parameters allow traders to optimize risk-reward ratios based on different market environments and personal risk preferences.
Graphical Support-Resistance Display: The strategy intuitively displays calculated support and resistance levels on the chart, helping traders understand entry logic and market structure.
Integrated Money Management: The strategy defaults to using a percentage of total account value for position sizing, rather than fixed quantities, contributing to long-term stable account growth.
Strategy Risks
Despite its comprehensive design, the strategy still has the following potential risks:
False Breakout Risk: Despite using volume filters, false breakouts may still occur in highly volatile markets, triggering stop losses. Solution: Consider adding confirmation periods or adjusting breakout percentage thresholds.
Limitations of Fixed Stop Loss: The fixed 2% stop loss may be too large or too small in different volatility environments. Solution: Design a dynamic stop loss mechanism based on market volatility (such as ATR).
Lag in Support-Resistance Calculation: Due to using historical data to calculate support and resistance levels, the strategy may not be timely enough in rapidly changing markets. Solution: Consider reducing lookback periods or adding shorter-period support-resistance calculations as supplements.
Trade Congestion Risk: In certain market conditions, multiple entry signals may be triggered consecutively, leading to overtrading. Solution: Add cooling periods between signals or set maximum position limits.
Lack of Trend Filtering: The strategy trades aggressively in both strong trend and no-trend environments, potentially reducing overall efficiency. Solution: Add trend identification components to adjust strategy parameters or pause specific signals in different trend environments.
Parameter Sensitivity: Strategy performance may be sensitive to key parameters such as support-resistance lookback length and volume multiplier. Solution: Conduct thorough parameter robustness testing to find relatively stable parameter combinations.
Strategy Optimization Directions
Based on code analysis, the strategy can be optimized in the following directions:
Dynamic Stop Loss Mechanism: Replace the fixed 2% stop loss with an ATR (Average True Range) based dynamic stop loss to adapt to different market volatility environments. This is necessary because market volatility changes over time, and a fixed percentage stop loss may be too small in highly volatile markets and too large in low volatility markets.
Trend Filter Integration: Add trend identification components (such as moving average direction or ADX indicator) to only execute trades in the direction of strong trends, improving overall win rate. This optimization helps avoid consecutive losses from counter-trend trading in strong trend environments.
Time Filter: Add trading session filters to avoid low liquidity or high volatility specific time periods, such as market opening and pre-closing sessions. This can prevent trading during periods of dramatic price fluctuations without directionality.
Multi-timeframe Confirmation: Add support-resistance calculations from different timeframes, requiring alignment across multiple timeframes before executing trades, improving signal quality. Multi-timeframe confirmation can filter out short-term noise and capture more meaningful market structure changes.
Price Structure Optimization: Beyond simple support and resistance levels, consider integrating more complex price structures such as double tops/bottoms, head and shoulders patterns, etc., to identify higher quality reversal points. These complex price structures often represent stronger market psychology shifts.
Money Management Optimization: Dynamically adjust position size based on strategy historical performance, increasing positions during high win-rate phases and reducing during low win-rate phases. This approach can maximize returns when the strategy performs well and control risk when performance is poor.
Adaptive Parameters: Develop parameter self-adjustment mechanisms to automatically adjust key parameters such as volume multiplier and breakout percentage based on market conditions. This allows the strategy to adapt to different market environments without manual intervention.
Summary
The Support-Resistance Breakout-Reversal Volume-Based Trading System with Fixed Stop Loss is a comprehensive quantitative trading framework that builds a multi-dimensional signal system by combining market structure (support-resistance levels), price action (breakouts and reversals), and volume confirmation. The core strengths of the strategy lie in its diversified entry signal combination and strict risk control mechanisms, enabling it to adapt to different market environments.
Although there are potential risks such as false breakouts and parameter sensitivity, these risks can be mitigated through the proposed optimization directions like dynamic stop loss, trend filtering, and multi-timeframe confirmation. Ultimately, this strategy provides traders with a clearly structured, risk-controlled trading system framework, particularly suitable for medium to short-term trading and volatile market environments.
Through further parameter optimization and implementation of the above recommendations, this strategy has the potential to become a more robust and adaptive trading system, providing reliable guidance for trading decisions across different market conditions.
Strategy source code
/*backtest
start: 2024-04-27 00:00:00
end: 2025-04-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("S/R Breakout/Reversal + Volume with 2% SL", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === INPUTS ===
pivotLen = input.int(10, "Pivot Lookback Length for S/R")
volSmaLength = input.int(20, "Volume SMA Length") // Simple Moving Average for Volume
volMultiplier = input.float(1.5, "Volume Multiplier") // Multiplier for high volume confirmation
tpPerc = input.float(3.0, "Take Profit %", step=0.1)
slPerc = 2.0 // Stop loss fixed at 2%
// === SUPPORT/RESISTANCE ===
pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
pivotLow = ta.pivotlow(low, pivotLen, pivotLen)
var float resZone = na
var float supZone = na
if not na(pivotHigh)
resZone := pivotHigh
if not na(pivotLow)
supZone := pivotLow
// === VOLUME ===
volSma = ta.sma(volume, volSmaLength)
highVolume = volume > volSma * volMultiplier // High volume condition
// === LONG CONDITIONS (Breakout + Reversal) ===
priceAboveResistance = close > resZone * 1.01 // Breakout above resistance
priceNearSupport = close >= supZone * 0.99 and close <= supZone * 1.01 // Near support zone
priceRejectionSupport = low <= supZone and close > supZone // Price rejection at support
longBreakoutCondition = priceAboveResistance and highVolume
longReversalCondition = priceNearSupport and priceRejectionSupport and highVolume
// === SHORT CONDITIONS (Breakout + Reversal) ===
priceBelowSupport = close < supZone * 0.99 // Breakdown below support
priceNearResistance = close >= resZone * 0.99 and close <= resZone * 1.01 // Near resistance zone
priceRejectionResistance = high >= resZone and close < resZone // Price rejection at resistance
shortBreakoutCondition = priceBelowSupport and highVolume
shortReversalCondition = priceNearResistance and priceRejectionResistance and highVolume
// === EXECUTE LONG TRADE ===
if (longBreakoutCondition)
strategy.entry("Long Breakout", strategy.long)
if (longReversalCondition)
strategy.entry("Long Reversal", strategy.long)
// === EXECUTE SHORT TRADE ===
if (shortBreakoutCondition)
strategy.entry("Short Breakout", strategy.short)
if (shortReversalCondition)
strategy.entry("Short Reversal", strategy.short)
// === PLOT SUPPORT/RESISTANCE ZONES ===
plot(supZone, title="Support", color=color.green, linewidth=2, style=plot.style_linebr)
plot(resZone, title="Resistance", color=color.red, linewidth=2, style=plot.style_linebr)
// === TAKE PROFIT & STOP LOSS ===
longTP = close * (1 + tpPerc / 100)
longSL = close * (1 - slPerc / 100)
shortTP = close * (1 - tpPerc / 100)
shortSL = close * (1 + slPerc / 100)
// Apply exits for long and short positions
strategy.exit("Long TP/SL", from_entry="Long Breakout", limit=longTP, stop=longSL)
strategy.exit("Long TP/SL", from_entry="Long Reversal", limit=longTP, stop=longSL)
strategy.exit("Short TP/SL", from_entry="Short Breakout", limit=shortTP, stop=shortSL)
strategy.exit("Short TP/SL", from_entry="Short Reversal", limit=shortTP, stop=shortSL)
Strategy parameters
The original adddress: Support-Resistance Breakout-Reversal Volume-Based Trading System with Fixed Stop Loss
Effective volume-based approach! The combination of S/R levels with breakout/reversal signals and volume confirmation creates high-conviction setups. The fixed stop-loss adds disciplined risk control.