QQE SHARPE MAXIMIZATION INTELLIGENT TRADING SYSTEM V2 - Reversals+Trailing Stop+Volume Filter

RSI QQE EMA SMA ATR 趋势跟踪 反转交易 动态止损 交易量过滤 平滑移动均线 相对强弱指标 平均真实范围
Created on: 2025-04-27 11:01:48 Modified on: 2025-05-14 15:25:40
Copy: 0 Number of hits: 576
avatar of ianzeng123 ianzeng123
2
Follow
319
Followers

 QQE SHARPE MAXIMIZATION INTELLIGENT TRADING SYSTEM V2 - Reversals+Trailing Stop+Volume Filter  QQE SHARPE MAXIMIZATION INTELLIGENT TRADING SYSTEM V2 - Reversals+Trailing Stop+Volume Filter

Overview

The QQE Sharpe Maximization Intelligent Trading System V2 is a strategy that leverages the QQE Mod indicator to detect momentum shifts, combined with a trend filter based on EMA and Heikin Ashi, as well as a volume filter that requires volume to be above its moving average to validate entry signals. The strategy operates bidirectionally (long and short) with automatic reversals and manages risk through dynamic trailing stops based on ATR, allowing it to maximize profits during strong trends while avoiding trading in low-interest market zones.

Strategy Principles

The core of this strategy is the QQE Mod indicator, which is a variant of the RSI (Relative Strength Index) that identifies potential trend changes and reversal points by tracking the relationship between RSI and its own moving average. Signals are generated when RSI crosses a dynamically adjusted threshold line (trailingLine).

Specifically, the strategy executes the following steps:

  1. Calculates RSI values and applies Wilders smoothing to form a more stable RSI curve.
  2. Computes the absolute value of RSI changes (delta) and averages it using the Wilders method.
  3. Establishes a dynamic threshold line based on the average delta value and a user-defined threshold factor (thresh).
  4. Generates long signals (1) when RSI is above the dynamic threshold line and short signals (-1) when below.
  5. Confirms trends using EMA and Heikin Ashi calculated average closing prices.
    • Bullish trend: price above EMA and Heikin Ashi close above EMA
    • Bearish trend: price below EMA
  6. Checks that volume is above its SMA (Simple Moving Average) to ensure adequate market participation.
  7. Calculates dynamic trailing stop positions based on ATR, setting different stop points for long and short positions.
  8. Automatically closes existing positions and opens new ones when entry conditions for the opposite direction are met.

Strategy Advantages

  1. Multiple Confirmation Mechanism: By combining QQE signals, trend filtering, and volume confirmation, the strategy significantly reduces false signals and improves trade quality.

  2. Adaptability: The dynamic threshold line automatically adjusts according to market volatility, enabling the strategy to adapt to different market conditions.

  3. Risk Management: ATR-based dynamic trailing stops ensure that potential losses are limited while preserving most profits, particularly suitable for capturing continuation trends.

  4. Automatic Reversals: The strategy can automatically close positions and open in the opposite direction without manual intervention, reducing emotional decision-making.

  5. Volume Validation: By requiring volume above its average level, the strategy avoids trading in environments with insufficient liquidity, improving execution quality.

  6. Technical Indicator Synergy: The combination of QQE, EMA, Heikin Ashi, and volume indicators provides a comprehensive market perspective, capturing multiple dimensions including price, trend, and market participation.

Strategy Risks

  1. False Breakout Risk: Despite multiple filters, false breakouts may still occur in highly volatile environments, leading to unnecessary trades. Solution: Consider adding volatility filters or increasing volume requirements.

  2. Over-optimization Risk: The multiple parameters in the strategy (such as RSI length, EMA length, ATR multiplier, etc.) risk overfitting historical data. Solution: Robustness testing should be conducted across different timeframes and market conditions.

  3. Trend Change Lag: EMA-based trend filtering may respond slowly during the initial phases of trend changes. Solution: Consider using more sensitive trend indicators or incorporating shorter-period moving averages.

  4. Trailing Stop Adjustment: Fixed ATR multipliers may perform inconsistently in different volatility environments. Solution: Implement adaptive ATR multipliers that dynamically adjust based on market volatility.

  5. Transaction Cost Impact: Frequent reversal trades may result in high transaction costs. Solution: Add minimum holding time requirements or increase signal confirmation thresholds.

Strategy Optimization Directions

  1. Add Time Filters: Implement trading session filtering to avoid trading during highly volatile periods around market opens or closes and during low liquidity periods. This can reduce poor trades caused by poor liquidity or abnormal price volatility.

  2. Intelligent Parameter Optimization: Develop adaptive parameter adjustment mechanisms that allow RSI length, threshold, and ATR multipliers to automatically adjust based on market conditions. This can enhance the strategy’s adaptability and robustness across different market environments.

  3. Multi-timeframe Analysis: Integrate higher timeframe trend confirmation to reduce counter-trend trading. By ensuring trade direction aligns with larger market trends, the strategy’s success rate can be improved.

  4. Improved Stop-Loss Strategy: Implement volatility-based dynamic stop-loss adjustments, tightening stops in low-volatility environments and widening them in high-volatility environments. This better balances risk and reward.

  5. Add Profit Targets: In addition to trailing stops, incorporate partial profit-taking mechanisms based on support/resistance levels or price targets. This allows locking in partial profits when price reaches key levels rather than waiting for trailing stops to trigger.

  6. Integrate Machine Learning: Apply machine learning algorithms to predict the effectiveness of QQE signals and dynamically adjust strategy weights based on historical performance. Learning market patterns can further enhance the strategy’s predictive capabilities.

Summary

The QQE Sharpe Maximization Intelligent Trading System V2 is a comprehensive trading strategy that cleverly combines momentum detection (QQE Mod), trend confirmation (EMA and Heikin Ashi), and volume validation to form a multi-layered trading decision system. Its core strengths lie in its automatic reversal functionality and ATR-based dynamic trailing stops, allowing it to adapt to changing market conditions and effectively manage risk.

The strategy is particularly suited for medium to long-term trend trading, performing best in markets with clear direction and sufficient volume. While some inherent risks exist, such as false breakouts and parameter optimization challenges, these can be mitigated through the suggested optimization directions. By adding time filters, implementing intelligent parameter optimization, integrating multi-timeframe analysis, and improving stop-loss strategies, the system can further enhance its robustness and adaptability.

Overall, this is a well-designed quantitative trading strategy suitable for traders looking to capture medium to long-term trends in the market while effectively managing risk. With the implementation of the suggested optimizations, it has the potential to become an even more comprehensive and efficient trading system.

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=6
strategy("QQE SHARPE MAX BOT v2 - Reversals + Trailing + Volumen", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// === INPUTS ===
src = close
rsiLength = input.int(14, "RSI Length")
wilders = input.int(14, "Wilders Smoothing")
thresh = input.float(3.0, "Threshold")
emaLen = input.int(200, "EMA Trend Length")
atrLen = input.int(14, "ATR Length")
trailingMult = input.float(1.5, "Trailing Stop Multiplier (ATR)")
volLen = input.int(20, "Volumen Medio (SMA)")

// === QQE MOD ===
rsi = ta.rsi(src, rsiLength)
wildersRsi = ta.rma(rsi, wilders)
delta = math.abs(wildersRsi - wildersRsi[1])
avgDelta = ta.rma(delta, wilders)
trailingLine = wildersRsi - avgDelta * thresh
var float signal = na
signal := wildersRsi > trailingLine ? 1 : wildersRsi < trailingLine ? -1 : nz(signal[1], 0)

// === TENDENCIA ===
ema = ta.ema(close, emaLen)
heikinClose = (open + high + low + close) / 4
bullTrend = close > ema and heikinClose > ema
bearTrend = close < ema

// === FILTRO DE VOLUMEN ===
vol = volume
volSMA = ta.sma(vol, volLen)
volOk = vol > volSMA

// === CONDICIONES ===
longCond = signal == 1 and bullTrend and volOk
shortCond = signal == -1 and bearTrend and volOk

// === TRAILING STOP ===
atr = ta.atr(atrLen)
longTrail = close - atr * trailingMult
shortTrail = close + atr * trailingMult

// === REVERSALS AUTOMÁTICOS ===
if (longCond)
    strategy.close("Short")
    strategy.entry("Long", strategy.long)
    strategy.exit("Trailing SL Long", from_entry="Long", trail_points=atr * trailingMult, trail_offset=atr * trailingMult)

if (shortCond)
    strategy.close("Long")
    strategy.entry("Short", strategy.short)
    strategy.exit("Trailing SL Short", from_entry="Short", trail_points=atr * trailingMult, trail_offset=atr * trailingMult)

// === ALERTAS ===
alertcondition(longCond, title="Long Entry", message="🔼 Señal de compra (LONG)")
alertcondition(shortCond, title="Short Entry", message="🔽 Señal de venta (SHORT)")

// === VISUAL ===
plotshape(longCond, title="BUY", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small, textcolor=color.white)
plotshape(shortCond, title="SELL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small, textcolor=color.white)