
The Advanced Pullback Trading Triangle Breakout with Volume-Price Confirmation Strategy is a quantitative trading approach that combines technical pattern recognition, volume confirmation, and dynamic risk management. Optimized for 1-hour charts, the strategy offers two independent entry setups based on triangle breakout and volume-price confirmation principles. The core concept is to capture high-probability breakout opportunities while effectively managing risk through a dynamic trailing stop loss that automatically tightens when profit reaches a specific threshold. This dual entry mechanism provides flexibility across different market conditions, while the intelligent stop-loss mechanism helps balance risk and reward.
The strategy operates based on two key entry setups and a carefully designed exit mechanism:
Entry Setup 1 - Golden Triangle Breakout: - Uses recent pivot highs and lows to detect triangle formations - Confirms a bullish breakout when price closes above the triangle top and is simultaneously above the 50-period SMA - Entry occurs at the breakout candle close - Ideal for capturing early momentum trades after consolidation periods
Entry Setup 2 - Price & Volume Confirmation: - Based on mean reversion followed by volume surge: - Price drops below the 50 SMA, then closes back above it - Requires at least one “up day” (current close > previous close) - Volume must be above its 50-period SMA and higher than each of the previous 4 days - Entry occurs at the close of the volume-confirmation day - Particularly effective when triangle patterns aren’t clear but accumulation is strong
Exit Strategy - Dynamic Trailing Stop Loss: - Initial stop set at 10% below the highest price reached after entry - When profit reaches 10%, the trailing stop is tightened to 5% - This mechanism allows traders to stay in the trend while securing profits
In the code implementation, the strategy uses simplified pivots to identify triangle formations and compares current price to the SMA for trend confirmation. For volume confirmation, the strategy checks if volume exceeds both its moving average and previous periods’ volume. The dynamic trailing stop is implemented by continuously updating the highest price reached during the trade and calculating the corresponding stop level.
Dual Entry Mechanism: By providing two independent entry setups, the strategy can adapt to different market environments, increasing the likelihood of capturing favorable trading opportunities. When markets are in distinct consolidation, Setup 1 can capture the breakout; when patterns are less obvious but show strong accumulation signs, Setup 2 can work effectively.
Integrated Risk Management: The built-in dynamic trailing stop mechanism automatically adapts to market movements, allowing profits to grow while protecting capital. Particularly valuable is the feature that tightens the stop once a profit threshold is reached, effectively balancing the conflicting goals of securing profit and letting winners run.
False Breakout Filtering: By combining SMA filtering and volume confirmation, the strategy reduces the risk of false breakouts. Price must not only break through the pattern but also remain above the SMA, and for Setup 2, have significant volume support, greatly improving signal quality.
Visual Aids: The strategy provides rich visual indicators, including background shading during trades, a real-time dashboard, and various plotting elements, allowing traders to easily monitor strategy status and signals.
Flexible Timeframe Optimization: While optimized for 1-hour charts, the strategy’s parameters can be adjusted to accommodate different timeframes, increasing its range of applications.
Market Condition Dependency: The strategy performs best in sideways-to-bullish markets and may underperform in strongly bearish trends or highly volatile markets. In bearish environments, the risk of false breakouts increases, potentially leading to consecutive losses.
Slippage and Execution Risk: In real trading, especially in less liquid markets, entry and stop points may experience slippage, affecting the strategy’s overall performance. To mitigate this risk, consider using limit orders instead of market orders.
Parameter Optimization Challenges: The strategy relies on multiple parameters (SMA length, stop-loss percentages, etc.) that need optimization for specific markets and timeframes. Improper parameter settings may lead to overfitting or underperformance.
Overtrading Risk: Under certain market conditions, the strategy might generate excessive signals, leading to overtrading and increased transaction costs. Implementing additional filters or cooldown periods can help reduce this risk.
Stop-Loss Optimization Tradeoffs: While the dynamic stop-loss mechanism is a strength of this strategy, setting stops too tight can lead to premature exits from favorable trades, while setting them too wide may result in profit giveback. Stop parameters need careful calibration based on the specific market’s volatility.
Add Trend Filters: Integrating broader trend indicators (such as longer-term moving averages or ADX) can help the strategy trade only in favorable market directions. For example, adding a condition to only allow bullish entries when a long-term SMA (like 200-period) is sloping upward.
Optimize Volume Confirmation Logic: The current volume confirmation requirement of volume being higher than the previous 4 periods may be too strict or not strict enough, depending on market conditions. Implementing adaptive volume thresholds that dynamically adjust based on market volatility could improve the effectiveness of Setup 2.
Incorporate Time Filters: Certain trading sessions may be more conducive to this strategy than others. Adding time filters to avoid trading during unfavorable periods (such as high-volatility periods around market opens or closes) could enhance overall performance.
Implement Partial Profit Locking: The current exit strategy is binary (hold all or exit all). Implementing a scaling-out system that progressively reduces position size as profit increases could lock in partial profits while retaining some upside potential.
Add Correlated Asset Confirmation: In certain markets, confirmation from correlated assets can improve signal quality. For example, in stock trading, sector or industry strength could serve as an additional filter; in forex, the behavior of related currency pairs could provide extra confirmation.
Integrate Volatility Adjustments: Dynamically adjusting stop levels based on market volatility (such as ATR or historical volatility) could make the strategy better adapt to different market conditions. Using tighter stops in low-volatility environments and wider stops in high-volatility environments.
The Advanced Pullback Trading Triangle Breakout with Volume-Price Confirmation Strategy provides a comprehensive trading approach that combines technical pattern recognition, momentum principles, and volume analysis. By offering two complementary entry setups, the strategy maintains flexibility across different market conditions, while its dynamic trailing stop mechanism provides optimized risk management.
The main advantages of the strategy lie in its multifaceted entry criteria and integrated risk management, making it suitable for various trading styles from intraday to short-term swing trading. However, market condition dependency and parameter optimization challenges are the primary risks to be mindful of.
By incorporating trend filters, optimizing volume confirmation logic, or implementing volatility adjustments, traders can further enhance the strategy’s performance. Ultimately, the strategy provides a solid framework that can be customized according to individual risk preferences and market characteristics, making it a valuable tool for traders seeking a technically-driven, risk-controlled trading approach.
/*backtest
start: 2024-06-03 00:00:00
end: 2025-06-02 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © eemani123
//@version=5
strategy("Golden Triangle Strategy (1H, Setup 1 & 2)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === Inputs ===
smaLength = input.int(34, title="SMA Length (1H Optimized)", minval=1)
volumeSmaLength = input.int(34, title="Volume SMA Length", minval=1)
trailingStopPct = input.float(6.0, title="Initial Trailing Stop Loss (%)", minval=0.1)
tightenPct = input.float(5.0, title="Tightened TSL (%)", minval=0.1)
profitTrigger = input.float(10.0, title="Tighten TSL After Profit (%)", minval=1)
maxLookback = input.int(10, title="Max Lookback Bars for Setup 2", minval=1)
pivotStrength = input.int(2, title="Pivot Strength (Shorter for 1H)", minval=1)
// === SMA Calculations ===
smaPrice = ta.sma(close, smaLength)
smaVolume = ta.sma(volume, volumeSmaLength)
// === Setup 1: Golden Triangle (simplified with pivots) ===
pivotHigh = ta.pivothigh(high, pivotStrength, pivotStrength)
pivotLow = ta.pivotlow(low, pivotStrength, pivotStrength)
var float triangleTop = na
var float triangleBottom = na
if not na(pivotHigh)
triangleTop := pivotHigh
if not na(pivotLow)
triangleBottom := pivotLow
triangleBreakout = ta.crossover(close, triangleTop) and close > smaPrice
enterSetup1 = triangleBreakout
// === Setup 2: Price & Volume Confirmation ===
priceBelowSMA = ta.barssince(close < smaPrice) <= maxLookback
priceConfirm = close > smaPrice and close > close[1]
volumeConfirm = volume > smaVolume and volume > volume[1] and volume > volume[2] and volume > volume[3] and volume > volume[4]
enterSetup2 = priceConfirm and priceBelowSMA and volumeConfirm
// === Entry & TSL Tracking ===
var bool inTradeSetup1 = false
var bool inTradeSetup2 = false
var float entryPrice1 = na
var float entryPrice2 = na
var float highestSinceEntry1 = na
var float highestSinceEntry2 = na
var float trailingStop1 = na
var float trailingStop2 = na
// === Entry Conditions ===
if enterSetup1 and not inTradeSetup1
strategy.entry("Buy Setup 1", strategy.long)
entryPrice1 := close
highestSinceEntry1 := close
inTradeSetup1 := true
if enterSetup2 and not inTradeSetup2
strategy.entry("Buy Setup 2", strategy.long)
entryPrice2 := close
highestSinceEntry2 := close
inTradeSetup2 := true
// === Update Trailing Stops with Tightening ===
if inTradeSetup1
highestSinceEntry1 := math.max(highestSinceEntry1, high)
profit1 = (highestSinceEntry1 - entryPrice1) / entryPrice1 * 100
activePct1 = profit1 >= profitTrigger ? tightenPct : trailingStopPct
trailingStop1 := highestSinceEntry1 * (1 - activePct1 / 100)
if inTradeSetup2
highestSinceEntry2 := math.max(highestSinceEntry2, high)
profit2 = (highestSinceEntry2 - entryPrice2) / entryPrice2 * 100
activePct2 = profit2 >= profitTrigger ? tightenPct : trailingStopPct
trailingStop2 := highestSinceEntry2 * (1 - activePct2 / 100)
// === Exit Conditions ===
if inTradeSetup1 and close < trailingStop1
strategy.close("Buy Setup 1", comment="TSL Hit - Setup 1")
inTradeSetup1 := false
entryPrice1 := na
highestSinceEntry1 := na
trailingStop1 := na
if inTradeSetup2 and close < trailingStop2
strategy.close("Buy Setup 2", comment="TSL Hit - Setup 2")
inTradeSetup2 := false
entryPrice2 := na
highestSinceEntry2 := na
trailingStop2 := na
// === Plotting ===
plot(smaPrice, color=color.orange, title="SMA")
//plot(triangleTop, title="Triangle Top", color=color.red, style=plot.style_linebr, linewidth=2)
//plot(triangleBottom, title="Triangle Bottom", color=color.green, style=plot.style_linebr, linewidth=2)
plot(inTradeSetup1 ? trailingStop1 : na, color=color.red, title="Trailing Stop - Setup 1", linewidth=2,style=plot.style_linebr)
plot(inTradeSetup2 ? trailingStop2 : na, color=color.blue, title="Trailing Stop - Setup 2", linewidth=2,style=plot.style_linebr)
plotshape(enterSetup1, title="Triangle Breakout Entry", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(enterSetup2, title="Volume Confirmed Entry", location=location.belowbar, color=color.blue, style=shape.circle, size=size.small)
// === Alerts ===
alertcondition(enterSetup1, title="Setup 1 Buy", message="Golden Triangle Breakout (Setup 1) - BUY")
alertcondition(enterSetup2, title="Setup 2 Buy", message="Volume + Price Confirmation (Setup 2) - BUY")
// === Background highlight during trades ===
bgcolor(inTradeSetup1 or inTradeSetup2 ? color.new(color.green, 85) : na, title="In-Trade Highlight")
// === Weekly Fibonacci Pivot Levels (R3 / S3) ===
weeklyHigh = request.security(syminfo.tickerid, "W", high)
weeklyLow = request.security(syminfo.tickerid, "W", low)
weeklyClose = request.security(syminfo.tickerid, "W", close)
weeklyPivot = (weeklyHigh + weeklyLow + weeklyClose) / 3
weeklyRange = weeklyHigh - weeklyLow
fibR3 = weeklyPivot + 1.000 * weeklyRange
fibS3 = weeklyPivot - 1.000 * weeklyRange
// === Plot R3 and S3 ===
plot(fibR3, title="Weekly Fib R3", color=color.fuchsia, linewidth=2, style=plot.style_circles)
plot(fibS3, title="Weekly Fib S3", color=color.teal, linewidth=2, style=plot.style_circles)
// === Weekly Fibonacci Pivot Levels (R3 / S3) ===