
This strategy is a trend following system based on multiple technical indicators, combining Moving Averages (EMA), Directional Movement Index (DMI), Detrended Price Oscillator (DPO), Relative Strength Index (RSI), and Average True Range (ATR). The core concept is to execute trades only after confirming multiple market characteristics including trend direction, momentum, and volatility to improve trading success rate.
The strategy employs a Triple Exponential Moving Average (EMA) system as its core trend identification mechanism, combined with other technical indicators for multiple signal confirmation: 1. Fast EMA (10-day) captures short-term price momentum 2. Medium EMA (25-day) serves as a medium-term trend filter 3. Slow EMA (50-day) defines the overall trend direction 4. DMI (14-day) confirms trend directional strength 5. DPO confirms price deviation from trend 6. RSI (14-day) measures momentum and overbought/oversold conditions 7. ATR (14-day) sets stop-loss and profit targets
Trade Signal Conditions: - Long: Fast EMA crosses above Medium EMA with both above Slow EMA, ADX>25, RSI>50, DPO>0 - Short: Fast EMA crosses below Medium EMA with both below Slow EMA, ADX>25, RSI<50, DPO<0
Risk Control Measures: - Dynamic ATR-based stops adapt to market volatility - Fixed proportion risk management - Multiple indicator cross-confirmation reduces false signals
This strategy constructs a complete trend following trading system through the combination of multiple technical indicators. Its main features are strict signal confirmation and reasonable risk control, suitable for tracking medium to long-term trends on daily timeframes. While there is some lag in signals, the strategy demonstrates robust overall performance through strict risk control and multiple signal confirmation. When applying to live trading, careful consideration should be given to market environment selection and parameter optimization for specific instruments.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-15 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("Daily Strategy with Triple EMA, DMI, DPO, RSI, and ATR", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input parameters
fastEmaLength = input.int(10, title="Fast EMA Length")
mediumEmaLength = input.int(25, title="Medium EMA Length")
slowEmaLength = input.int(50, title="Slow EMA Length")
dmiLength = input.int(14, title="DMI Length")
adxSmoothing = input.int(14, title="ADX Smoothing")
dpoLength = input.int(14, title="DPO Length")
rsiLength = input.int(14, title="RSI Length")
atrLength = input.int(14, title="ATR Length")
riskPercentage = input.float(2.0, title="Risk Percentage", step=0.1)
atrMultiplier = input.float(1.5, title="ATR Multiplier for Stop Loss", step=0.1)
tpMultiplier = input.float(2.0, title="ATR Multiplier for Take Profit", step=0.1)
// Calculate EMAs
fastEma = ta.ema(close, fastEmaLength)
mediumEma = ta.ema(close, mediumEmaLength)
slowEma = ta.ema(close, slowEmaLength)
// Calculate other indicators
[adx, diPlus, diMinus] = ta.dmi(dmiLength, adxSmoothing)
dpo = close - ta.sma(close, dpoLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)
// Trading logic
longCondition = ta.crossover(fastEma, mediumEma) and fastEma > slowEma and mediumEma > slowEma and adx > 25 and rsi > 50 and dpo > 0
shortCondition = ta.crossunder(fastEma, mediumEma) and fastEma < slowEma and mediumEma < slowEma and adx > 25 and rsi < 50 and dpo < 0
// Risk management
riskAmount = (strategy.equity * riskPercentage) / 100
stopLoss = atr * atrMultiplier
takeProfit = atr * tpMultiplier
// Entry and exit logic
if (longCondition)
strategy.entry("Buy", strategy.long)
strategy.exit("Exit Long", "Buy", stop=close - stopLoss, limit=close + takeProfit)
if (shortCondition)
strategy.entry("Sell", strategy.short)
strategy.exit("Exit Short", "Sell", stop=close + stopLoss, limit=close - takeProfit)
// Plot indicators
plot(fastEma, color=color.green, title="Fast EMA")
plot(mediumEma, color=color.orange, title="Medium EMA")
plot(slowEma, color=color.red, title="Slow EMA")
hline(25, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)