Advanced Vortex Momentum Analysis and Trading Strategy

FMZQuant - Feb 19 - - Dev Community

Image description

Overview
This strategy is a trend-following trading system based on the Vortex Indicator (VI). The strategy identifies turning points in market trends by calculating the positive momentum (VI+) and negative momentum (VI-) of price fluctuations and generates trading signals at key indicator crossovers. The strategy uses a smoothed moving average (SMA) to reduce noise and improve signal reliability.

Strategy Principle
The core of the strategy is to determine the trend direction by comparing the relative strength of VI+ and VI-. The specific calculation process is as follows:

  1. Calculate positive momentum (VM+) and negative momentum (VM-)
  2. Normalization using True Range
  3. Apply SMA smoothing to the above indicators to obtain the final VI+ and VI-
  4. When VI+ crosses VI-, a long signal is generated; when VI+ crosses VI-, a short signal is generated.

Strategy Advantages

  1. Clear signals: Crossover signals are clearly visible, facilitating trading decisions
  2. Trend adaptation: can better capture the turning points of medium and long-term trends
  3. Noise filtering: SMA smoothing can effectively reduce false signals
  4. Strong visualization: intuitively display buy and sell signal marks on the chart
  5. Flexible parameters: Cycle parameters can be adjusted according to different market characteristics

Strategy Risks

  1. Hysteresis: Due to the use of moving average processing, the signal has a certain lag
  2. Not suitable for volatile markets: Frequent false signals may be generated in a sideways and volatile market
  3. Retracement risk: There may be a large retracement in the early stage of trend reversal
  4. Parameter sensitivity: Different parameter settings will affect strategy performance significantly

Strategy Optimization Direction

  1. Add trend strength filter: Combine trend strength indicators such as ADX to filter out weak market conditions
  2. Introducing dynamic stop loss: Designing dynamic stop loss position based on ATR to improve risk control capabilities
  3. Optimize position management: dynamically adjust the position ratio according to the degree of deviation of the VI indicator
  4. Multi-time period analysis: Combine trend judgment with higher time periods to improve accuracy

Summary
This strategy provides a reliable analytical framework for trend tracking trading through the innovative application of volatility potential indicators. Although there is a certain lag, a robust trading system can be built through reasonable parameter optimization and risk management measures. It is recommended that traders conduct sufficient backtesting verification before real-time application, and perform targeted optimization according to specific market characteristics.

Strategy source code

/*backtest
start: 2022-02-11 00:00:00
end: 2025-02-08 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Vortex Strategy with Signals", shorttitle="VI_Strat", overlay=true)

// User input
length = input.int(14, title="Period", minval=1)

//------------------------------------
// 1) Vortex calculation
//------------------------------------
vmPlus     = math.abs(high - low[1])
vmMinus    = math.abs(low - high[1])
trueRange  = math.max(math.max(high - low, math.abs(high - close[1])), math.abs(low - close[1]))

// SMA smoothing
smoothedVMPlus     = ta.sma(vmPlus,     length)
smoothedVMMinus    = ta.sma(vmMinus,    length)
smoothedTrueRange  = ta.sma(trueRange,  length)

// Vortex Indicators
viPlus  = smoothedVMPlus  / smoothedTrueRange
viMinus = smoothedVMMinus / smoothedTrueRange

//------------------------------------
// 2) Indicator fence
//------------------------------------
plot(viPlus,  color=color.green, title="VI+")
plot(viMinus, color=color.red,   title="VI-")

//------------------------------------
// 3) Definition of signals
//------------------------------------
bullSignal = ta.crossover(viPlus, viMinus)    // VI+ pretína VI- smerom nahor
bearSignal = ta.crossunder(viPlus, viMinus)   // VI+ pretína VI- smerom nadol

//------------------------------------
// 4) Visualization of signals on the chart
//------------------------------------
plotshape(bullSignal, 
     title="Bull Signal", 
     style=shape.labelup, 
     location=location.belowbar, 
     color=color.green, 
     text="BUY", 
     textcolor=color.white, 
     size=size.small)

plotshape(bearSignal, 
     title="Bear Signal", 
     style=shape.labeldown, 
     location=location.abovebar, 
     color=color.red, 
     text="SELL", 
     textcolor=color.white, 
     size=size.small)

//------------------------------------
// 5) STRATEGY LOGIC
//------------------------------------
if bullSignal
    strategy.entry("Long", strategy.long)

if bearSignal
    strategy.entry("Short", strategy.short)
Enter fullscreen mode Exit fullscreen mode

Strategy Parameters

Image description

The original address: Advanced Vortex Momentum Analysis and Trading Strategy

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .