Overview
The Multi-SMA Pullback Trend Following Strategy with DMI Confirmation is a comprehensive trading system that combines multiple Simple Moving Averages (SMAs), Directional Movement Index (DMI), and price pullback pattern recognition to capture low-risk entry points in trending markets. The core concept of this strategy is to wait for price pullbacks to key moving averages in established trends, confirm direction using the DMI indicator, and implement a complete risk management mechanism through swing point stop-loss placement.
Strategy Principles
The strategy operates based on the synergistic action of several key components:
Multiple Moving Average System: The strategy employs 5 different period SMAs (9/20/50/100/200) to assess market structure. The 20-day and 200-day SMAs serve as the primary trend determination tools.
Moving Average Slope Analysis: By calculating the slopes of the 20-day and 200-day SMAs over the past 5 periods (slope20 and slope200), the strategy confirms trend strength and direction. A positive slope indicates an uptrend, while a negative slope indicates a downtrend.
Price-to-Moving Average Relationship: The strategy requires the price's relationship with key moving averages (20-day and 200-day) to align with the trend direction (price above SMAs for long positions, below SMAs for short positions).
Moving Average Alignment: For long conditions, the 20-day SMA must be positioned above the 200-day SMA; the opposite applies for short conditions.
Pullback Entry Mechanism:
- Long condition: The previous candle's closing price falls below the 20-day SMA, while the current candle's closing price rises above it, indicating a completed pullback and bounce
- Short condition: The previous candle's closing price rises above the 20-day SMA, while the current candle's closing price falls below it, indicating a completed pullback and decline
DMI Direction Confirmation: The DMI indicator (with a period of 14) confirms trend direction:
- Long confirmation: +DI > -DI
- Short confirmation: -DI > +DI
Swing Point Stop-Loss:
- Long trades use the lowest point of the past 10 periods as the stop-loss level
- Short trades use the highest point of the past 10 periods as the stop-loss level
Strategy Advantages
Multiple Filtering Mechanisms: By combining moving average systems, slope analysis, price position, and DMI confirmation, the strategy effectively reduces false signals and improves trading accuracy.
Pullback Entries: The strategy waits for price pullbacks to key moving averages before entering, providing better risk-reward ratios compared to chasing momentum.
Trend Confirmation: Through triple verification of moving average position, alignment, and slope, the strategy ensures trading only in strong trends, avoiding frequent trading in oscillating markets.
Clear Stop-Loss Strategy: Using swing points as stop-loss levels bases the method on market structure rather than arbitrary percentages, aligning better with market logic.
DMI Indicator Confirmation: Adding the DMI indicator as an additional trend confirmation tool further filters out higher uncertainty signals.
Visualized Trading Signals: The strategy displays buy and sell signals through clear visual markers, allowing traders to quickly identify trading opportunities.
Strategy Risks
Lagging Trend Reversal Recognition: Due to reliance on moving average systems, there may be delayed reactions at trend reversal points, leading to untimely entries or entries near trend exhaustion.
False Breakout Risk: Prices may briefly break through moving averages before reverting, creating false breakouts and triggering incorrect signals.
Parameter Optimization Challenges: The strategy includes multiple parameters (such as moving average periods, slope lookback periods, DMI period), which may require different settings for different markets and timeframes.
Market Environment Limitations: This strategy performs well in clear trending markets but may generate numerous losing trades in range-bound, oscillating markets.
Excessive Stop-Loss Risk: Stop-loss strategies based on swing points may result in overly wide stops in highly volatile markets, undermining effective capital management.
Insufficient Risk Control: The strategy lacks dynamic profit-taking mechanisms, potentially allowing profits to be surrendered.
Strategy Optimization Directions
Add Adaptive Parameters: Introduce adaptive mechanisms to dynamically adjust moving average periods and slope lookback periods based on market volatility, allowing the strategy to better adapt to different market environments.
Incorporate Volatility Filtering: Introduce ATR indicators or volatility measures to adjust strategy execution or pause trading in environments of excessive or insufficient volatility.
Improve Profit-Taking Mechanisms: Add profit-taking mechanisms based on market structure or target risk-reward ratios, such as trailing stops or partial profit-taking methods, to better protect realized profits.
Market Environment Recognition: Add trend strength indicators or market state classification algorithms to automatically reduce position size or pause trading in range-bound markets.
Enhance Entry Confirmation: Consider adding volume confirmation or candlestick pattern confirmation to improve entry signal reliability.
Optimize Capital Management: Dynamically adjust position sizes based on ATR or other volatility indicators to control risk exposure in different volatility environments.
Multi-Timeframe Analysis: Introduce higher timeframe trend confirmation to ensure trade direction aligns with larger-degree trends.
Summary
The Multi-SMA Pullback Trend Following Strategy with DMI Confirmation is a structurally complete and logically clear trend-following system. It seeks low-risk, high-probability entry points in established trends by integrating multiple moving averages, slope analysis, price pullbacks, and DMI confirmation. This strategy is particularly suitable for markets with evident medium to long-term trends, where the pullback entry approach allows following the main trend while obtaining relatively favorable entry prices.
However, the strategy also has limitations such as lagging trend identification, false breakout risks, and poor performance in oscillating markets. By introducing adaptive parameters, volatility filtering, improved profit-taking mechanisms, and market environment recognition, the strategy's robustness and adaptability can be further enhanced. Most importantly, traders should make targeted adjustments to strategy parameters based on market conditions, personal risk preferences, and capital management principles to maximize its effectiveness in practical application.
Strategy source code
/*backtest
start: 2025-06-30 00:00:00
end: 2025-07-04 08:00:00
period: 10m
basePeriod: 10m
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Full SMA Pullback Strategy with DMI", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === SMA Definitions ===
sma9 = ta.sma(close, 9)
sma20 = ta.sma(close, 20)
sma50 = ta.sma(close, 50)
sma100 = ta.sma(close, 100)
sma200 = ta.sma(close, 200)
// === Inputs ===
slopeLookback = input.int(5, title="Slope Lookback Period")
swingLookback = input.int(10, title="Swing High/Low Period")
dmiLength = input.int(14, title="DMI Period")
// === Slope Calculation ===
slope20 = sma20 - sma20[slopeLookback]
slope200 = sma200 - sma200[slopeLookback]
// === DMI Calculation ===
[plusDI, minusDI, _] = ta.dmi(dmiLength, dmiLength)
dmiLongConfirm = plusDI > minusDI
dmiShortConfirm = minusDI > plusDI
// === Long Conditions ===
trendUp = close > sma20 and close > sma200
smaOrderUp = sma20 > sma200
slopeUp = slope20 > 0 and slope200 > 0
pullbackUp = close[1] < sma20[1] and close > sma20
longCond = trendUp and smaOrderUp and slopeUp and pullbackUp and dmiLongConfirm
swingLow = ta.lowest(low, swingLookback)
// === Short Conditions ===
trendDown = close < sma20 and close < sma200
smaOrderDown = sma20 < sma200
slopeDown = slope20 < 0 and slope200 < 0
pullbackDown = close[1] > sma20[1] and close < sma20
shortCond = trendDown and smaOrderDown and slopeDown and pullbackDown and dmiShortConfirm
swingHigh = ta.highest(high, swingLookback)
// === Strategy Entry & Exit ===
if (longCond)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long", stop=swingLow)
if (shortCond)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short", stop=swingHigh)
// === Plotting SMAs ===
plot(sma9, title="SMA 9", color=color.gray)
plot(sma20, title="SMA 20", color=color.orange)
plot(sma50, title="SMA 50", color=color.purple)
plot(sma100, title="SMA 100", color=color.green)
plot(sma200, title="SMA 200", color=color.blue)
// === Signal Markers ===
plotshape(longCond, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(shortCond, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
Strategy parameters
The original address: Multi-SMA Pullback Trend Following Strategy with DMI Confirmation
Top comments (1)
The classic “wait for the pullback” approach—aka the part where I usually get impatient and enter too early 😂 Love how the SMAs and DMI are like the calm, responsible trading friends I wish I had. Gonna give this one a spin and let the strategy be the adult in the room while I try not to sabotage it 😅