Volume Weighted Trend Reversal Strategy

Author: ChaoZhang, Date: 2024-02-21 15:04:34



This strategy is named Volume Weighted Trend Reversal Strategy. It aims to identify potential trend reversal points and profit when prices deviate from average levels. It combines the Volume Weighted Average Price (VWAP) and Quantitative Qualitative Estimation Modified (QQE Mod) indicators to generate trading signals.

Strategy Logic

The strategy utilizes two indicators: VWAP and QQE Mod.

VWAP stands for Volume Weighted Average Price. It calculates the average price of an asset over a timeframe, weighted by volume.

QQE Mod is a modified version of the Quantitative Qualitative Estimation indicator, incorporating elements of Relative Strength Index (RSI) and Exponential Moving Averages (EMA). It helps identify potential trend reversals and assess the strength of a trend.

A buy signal is generated when the closing price is above both VWAP and QQE Mod values. This indicates a potential buying opportunity when price is higher than average and shows strength according to QQE Mod.

A sell signal is generated when the closing price is below both VWAP and QQE Mod values. This indicates a potential selling opportunity when price is lower than average and shows weakness according to QQE Mod.

By combining VWAP and QQE Mod, the strategy aims to timely identify and profit from trend reversals as prices bounce off from extreme levels.

Advantage Analysis

The advantages of this strategy include:

  1. Combines price and volume analysis. VWAP weights prices according to volume, making the analysis more meaningful.

  2. Distinguishes trends and random fluctuations. QQE Mod helps assess if price moves are sustainable trends or just random noise.

  3. Timely signals on reversals. The combination generates early signals when prices start to reverse.

  4. Customizable parameters. Indicator inputs can be optimized for different markets and timeframes.

  5. Easy backtesting and implementation. The strategy can be directly written in Pine Script for TradingView, or converted to MQL for MT4/MT5 automated trading.

Risk Analysis

Despite sound logic, trading risks still exist including:

  1. Whipsaw risk. Like all indicators, VWAP and QQE can generate false signals resulting in losses.

  2. Drawdown risk. Significant volatility could lead to portfolio drawdowns. Risk can be controlled via stop losses.

  3. Overfitting risk. Parameters maybe over-optimized to historical data but fail on out-of-sample data.

  4. Backtest vs live performance deviation. Actual performance may differ from backtested results.

  5. Automated trading risks. Additional risks from server outages, network errors etc if used for automated trading.

Optimization Directions

The strategy can be improved in several aspects:

  1. Choose appropriate stocks. More liquid stocks may give better VWAP and QQE signals.

  2. Adjust parameters. Optimize QQE input values for ideal performance.

  3. Incorporate stop loss. Reasonable stop loss levels and trailing stops help control risk.

  4. Account for trading costs. Include commissions and slippage to make simulations more realistic.

  5. Add filters. Additional filters on volume breakouts or volatility may reduce false signals.


The Volume Weighted Trend Reversal Strategy combines VWAP and QQE Mod to identify potential turning points in price trends. It incorporates both volume and momentum analysis to capture short-term reversals. Simple to implement, it can be optimized across market conditions and remains a viable option for traders. Nonetheless risks from whipsaws and drawdowns persist, necessitating prudent backtesting and risk control.

start: 2024-01-21 00:00:00
end: 2024-02-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]

strategy("VWAP and QQE Mod Strategy", overlay=true)

// Input parameters
length = input(14, title="QQE Length")
m = input(5, title="QQE Smoothing")
filterLength = input(5, title="QQE Filter Length")

// Calculate VWAP
vwapValue = ta.sma(close * volume, length) / ta.sma(volume, length)

// Calculate QQE Mod indicator
qqeMod(source, length, m, filterLength) =>
    emaSource = ta.ema(source, length)
    rsiValue = ta.rsi(source, length)
    var float j = na
    j := (1.0 - 1.0 / m) * nz(j[1]) + 1.0 / m * (rsiValue - 50)
    upperBand = emaSource + filterLength * ta.stdev(source - emaSource, length)
    lowerBand = emaSource - filterLength * ta.stdev(source - emaSource, length)
    qqeModValue = j > 0 ? upperBand : lowerBand
    [qqeModValue, upperBand, lowerBand]

[qqeModValue, upperBand, lowerBand] = qqeMod(close, length, m, filterLength)

// Generate trading signals
buySignal = close > vwapValue and close > qqeModValue
sellSignal = close < vwapValue and close < qqeModValue

// Plot signals on the chart
bgcolor(buySignal ? color.new(color.green, 90) : na)
bgcolor(sellSignal ? color.new(color.red, 90) : na)

// Print trading signals
strategy.entry("Buy", strategy.long, when=buySignal)
strategy.entry("Sell", strategy.short, when=sellSignal)