资源加载中... loading...

ATR, EOM and VORTEX Based Long Trend Strategy

Author: ChaoZhang, Date: 2024-02-18 16:01:07
Tags:

img

Overview

This strategy is a long-term trend strategy for stock and cryptocurrency markets. It combines three indicators - ATR (Average True Range), EOM (Ease of Movement) and VORTEX to identify trend directions.

Strategy Logic

  • ATR measures market volatility. Here we calculate the 10-period ATR and smooth it with a 5-period EMA. If the current ATR is above EMA of ATR, it indicates high volatility and a bull market. Otherwise, it is a bear market.

  • EOM belongs to volume-price indicators. Here we calculate the 10-period EOM. If EOM is positive, it suggests increasing trading volumes and a bull market. Otherwise it is a bear market.

  • VORTEX represents vortex indicator to judge long-term trend directions. We calculate the sum of absolute price fluctuations over last 10 periods to get VMP and VMM. Then use sum of ATR as denominator to normalize and obtain VIP and VIM. Average them, if greater than 1 suggests bull and less than 1 suggests bear markets.

In summary, this strategy combines ATR/EMAATR for short-term volatility, EOM for volume-price features and VORTEX for long-term trend to determine the final long-only direction.

Advantage Analysis

  • This strategy synthesizes three major types of indicators, including volatility, volume-price and trend to identify trend directions with comprehensive judgments and strong signals.

  • Both ATR and VORTEX have smoothing features to filter out noises from ranged markets and avoid false long signals.

  • Only long without short can maximize risk avoidance from short-term pullbacks.

  • As a trend following strategy, it focuses on capturing medium-to-long term directional opportunities and benefits from the main trend.

Risk Analysis

  • Insufficient backtest data with real-trading performance to be verified and parameters to be further optimized and tested.

  • Unable to search for profit opportunities from reversals or range-bound markets, limiting profit potential.

  • Pure trend strategy cannot effectively control position risks with certain capital locking risks.

  • Unable to short for hedging with larger loss space.

Optimization Directions

  • Test stability of different periods for ATR and VORTEX.

  • Attempt to introduce stop loss methods e.g. moving stop loss, time stop loss to control single loss.

  • Set position sizing based on ATR values to reduce risk in high volatility environments.

  • Incorporate mean-reversion factors to confirm entry timing and avoid unnecessary capital locking.

Conclusion

This long-term trend following strategy enters based on confirmations from ATR, EOM and VORTEX across three categories, and only goes long without short to benefit from main trend. It has the advantage of comprehensive judgments and clear signals, but the disadvantages of insufficient data validation, weak risk control capabilities. Future improvements can be made in areas like introducing stop loss, optimizing parameter settings and position sizing.


/*backtest
start: 2023-02-11 00:00:00
end: 2024-02-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SoftKill21

//@version=4
strategy("atr+eom+vortex strat", overlay=true )

//atr and ema
atr_lenght=input(10)
atrvalue = atr(atr_lenght)


//plot(atrvalue)
ema_atr_length=input(5)
ema_atr = ema(atrvalue,ema_atr_length)

//plot(ema_atr,color=color.white)

//EOM and ema
lengthEOM = input(10, minval=1)
div = 10//input(10000, title="Divisor", minval=1)
eom = sma(div * change(hl2) * (high - low) / volume, lengthEOM)
// + - 0 long/short

//VORTEX
period_ = input(10, title="Length", minval=2)
VMP = sum( abs( high - low[1]), period_ )
VMM = sum( abs( low - high[1]), period_ )
STR = sum( atr(1), period_ )
VIP = VMP / STR
VIM = VMM / STR
avg_vortex=(VIP+VIM)/2
//plot(avg_vortex)

long= atrvalue > ema_atr and eom > 0 and avg_vortex>1 
short=atrvalue < ema_atr and eom < 0 and avg_vortex<1 

strategy.entry("long",1,when=long)
//strategy.entry("short",0,when=short)

strategy.close("long",when=short)
template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6