Dynamic Multi-Indicator Trend Continuation Trading Strategy
FMZQuant

FMZQuant @fmzquant

Joined:
Apr 25, 2024

Dynamic Multi-Indicator Trend Continuation Trading Strategy

Publish Date: May 30
2 1

Image description

Image description

Overview
The Dynamic Multi-Indicator Trend Continuation Trading Strategy is a powerful backtesting tool designed to identify high-probability trend continuation setups. This strategy cleverly combines the Relative Strength Index (RSI), Chande Momentum Oscillator (CMO), and adaptive Average True Range (ATR)-based trailing stop logic to detect precise entry points and manage risk through automated take profit targets (1R, 2R, 3R) and stop loss levels. The strategy dynamically evaluates trend direction shifts using price action and momentum divergence, enabling traders to test robust trading scenarios with clearly defined exit points. Through flexible adjustment of sensitivity and volatility filter parameters, the strategy is suitable for forex, cryptocurrency, and stock trading, making it ideal for both intraday and swing trading approaches.

Strategy Principles
The core of this strategy lies in combining multiple technical indicators to identify trend reversal points and continuation opportunities:

  1. Trend Confirmation Mechanism: Uses Hull Moving Average (HMA) to process opening and closing prices with 5-period and 12-period settings respectively, calculating momentum changes and comparing these changes to evaluate trend strength.

  2. Momentum Assessment: Utilizes the Chande Momentum Oscillator (CMO) to identify overbought and oversold conditions, measuring price momentum through the percentage of the difference between upward momentum and downward momentum relative to their sum. When the CMO value exceeds 50 and RSI is below 25, a potential buy signal is indicated; when CMO falls below -50 and RSI exceeds 75, a potential sell signal may occur.

  3. Key Price Level Identification: The code employs a simple yet effective logic to identify high and low points by comparing the highest and lowest prices over 2 consecutive periods, combined with standard deviation detection to ensure the validity of these levels.

  4. Dynamic Stop Loss System: An ATR-based adaptive trailing stop mechanism adjusts stop loss distance using a multiplier (default value of 2), allowing the stop loss to automatically adjust according to market volatility, providing wider stops during high volatility and tighter stops during low volatility.

  5. Trend Shift Detection: When price breaks through the upper or lower band, the trend variable changes from 1 to -1 or from -1 to 1, triggering trading signals during these transitions.

  6. Risk Management: The strategy incorporates percentage-based stop loss settings (default 2%) and a risk multiple-based partial profit-taking mechanism (1R, 2R, 3R), ensuring predictable risk-reward ratios for each trade.

Strategy Advantages
Through deep analysis of the strategy code, we can summarize the following significant advantages:

  1. High Adaptability: Through ATR calculations, the strategy can adapt to different market volatility conditions, making it effective across different timeframes and market environments.

  2. Multiple Confirmations: The strategy doesn't rely on a single indicator, but combines RSI, CMO, and price support/resistance levels for multiple confirmations, greatly reducing the possibility of false signals.

  3. Systematic Risk Management: Built-in stop loss and multi-level profit-taking mechanisms ensure each trade follows strict risk management rules, avoiding emotional decision-making risks.

  4. Parameter Optimization Space: The strategy provides multiple adjustable parameters, such as sensitivity multiplier, ATR period, and calculation method, allowing traders to optimize according to specific market conditions and personal risk preferences.

  5. Partial Profit-Taking Strategy: Adopting the 1R, 2R, 3R partial profit-taking method allows locking in partial profits while maintaining some position to capture major trends, balancing short-term gains and long-term returns.

  6. Flexible Entry Mechanism: The definition of trend shifts is clear and quantifiable, avoiding subjective judgment and making strategy execution more consistent and disciplined.

Strategy Risks
Despite its many advantages, the strategy also presents some potential risks and limitations:

  1. Over-Optimization Risk: Parameter flexibility is a double-edged sword; over-optimization may lead to the strategy performing well on historical data but poorly in future market environments. The solution is to backtest across multiple timeframes and market conditions, keeping parameters concise.

  2. Ranging Market Performance: In range-bound markets lacking clear trends, the strategy may generate frequent false breakout signals, resulting in consecutive stop losses. The solution is to add market environment filters to reduce or pause trading when ranging markets are identified.

  3. Slippage and Trading Costs: In live trading, slippage and trading costs can significantly affect the strategy's actual performance, especially in less liquid markets. The solution is to incorporate these factors in backtesting and consider using limit orders rather than market orders.

  4. Exceptional Volatility Risk: During major news events or black swan events, markets may experience extreme volatility beyond the expected ATR range, causing stop losses to fail. The solution is to set maximum stop loss amounts as additional protection.

  5. Reliance on Historical Volatility: ATR is calculated based on historical data; if market volatility suddenly increases, the strategy may not adjust quickly enough. The solution is to consider using exponential moving average versions of ATR to adapt more quickly to market changes.

Strategy Optimization Directions
Based on in-depth analysis of the code, the strategy can be optimized in the following directions:

  1. Market Environment Filtering: Introduce trend strength indicators (such as ADX) or volatility indexes (such as VIX) to filter trading signals, trading only in market environments suitable for the strategy. This is because different strategies perform differently in various market environments; market environment filtering can improve overall strategy performance.

  2. Dynamic Parameter Adjustment: Implement parameter adaptive mechanisms to automatically adjust sensitivity multipliers and ATR periods based on recent market volatility. This is because fixed parameters often cannot adapt to all market conditions; dynamic parameters can improve strategy robustness.

  3. Add Volume Confirmation: Integrate volume analysis to confirm trend signals, entering trades only when supported by volume. Volume is the driving force behind price movements; adding volume confirmation can reduce false signals.

  4. Optimize Profit-Taking Strategy: Consider more complex profit-taking strategies, such as volatility-based dynamic profit targets or trailing stops, to better capture trend continuation potential. This is because fixed multiple profit targets may not fully utilize the potential of continuing trends.

  5. Time Filters: Add intraday time filters to avoid trading during market opening, closing, or low liquidity sessions. Certain market sessions have higher volatility or lower liquidity; time filtering can avoid these unfavorable periods.

  6. Integrate Technical Patterns: In addition to existing indicators, incorporate chart pattern recognition (such as head and shoulders, double bottoms, etc.) as additional confirmation tools. Technical patterns often represent market participants' psychological states and can provide additional entry confirmation.

  7. Capital Management Optimization: Based on historical backtesting results, develop more advanced capital management algorithms to dynamically adjust position sizes based on the strategy's recent performance. Effective capital management can increase overall returns and reduce drawdowns.

Summary
The Dynamic Multi-Indicator Trend Continuation Trading Strategy is a well-designed trading system that effectively identifies trend reversal points and manages trading risk by combining RSI, CMO, and ATR-based dynamic stop losses. Its core advantages lie in its multiple confirmation mechanisms, highly adaptive stop loss system, and systematic risk management approach. While the strategy excels in trending markets, it may face challenges in range-bound conditions.

By implementing the suggested optimization directions, particularly market environment filtering, dynamic parameter adjustment, and volume confirmation, the strategy can further enhance its robustness and adaptability. For traders seeking a systematic approach to identifying trend continuation opportunities, this is a strategy framework worth considering, especially suitable for those who value risk management and pursue consistent trading results.

Ultimately, successful application of this strategy depends not only on the code itself but also on the trader's understanding of the market, risk management discipline, and commitment to continuous optimization. By combining quantitative analysis with trading wisdom, this strategy can become a powerful weapon in a trader's toolkit.

Strategy source code

/*backtest
start: 2024-05-13 00:00:00
end: 2025-05-11 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/

//@version=5
strategy("Seekho roj kamao Strategy", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)

// === INPUTS ===
src =  input(hl2, title="Source")
Multiplier = input.float(2,title="Sensitivity (0.5 - 5)", step=0.1, defval=2, minval=0.5, maxval=5)
atrPeriods = input.int(14,title="ATR Length", defval=10)
atrCalcMethod= input.string("Method 1",title = "ATR Calculation Methods",options = ["Method 1","Method 2"])
stopLossVal  = input.float(2.0, title="Stop Loss Percent (0 for Disabling)", minval=0)

// === CALCULATIONS ===
percent(nom, div) => 100 * nom / div

src1 = ta.hma(open, 5)[1] 
src2 = ta.hma(close, 12)
momm1 = ta.change(src1)
momm2 = ta.change(src2)
f1(m, n) => m >= n ? m : 0.0
f2(m, n) => m >= n ? 0.0 : -m
m1 = f1(momm1, momm2)
m2 = f2(momm1, momm2)
sm1 = math.sum(m1, 1)
sm2 = math.sum(m2, 1)
cmoCalc = percent(sm1-sm2, sm1+sm2)

hh = ta.highest(2)
h1 = ta.dev(hh, 2) ? na : hh
hpivot = fixnan(h1)
ll = ta.lowest(2)
l1 = ta.dev(ll, 2) ? na : ll
lpivot = fixnan(l1)

rsiCalc = ta.rsi(close,9)
lowPivot =  lpivot  
highPivot =  hpivot

sup = rsiCalc < 25 and cmoCalc > 50  and lowPivot
res = rsiCalc > 75 and cmoCalc < -50  and highPivot

atr2 = ta.sma(ta.tr, atrPeriods)
atr = atrCalcMethod == "Method 1" ? ta.atr(atrPeriods) : atr2

up = src - (Multiplier * atr)
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + (Multiplier * atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn

trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend

buySignal = trend == 1 and trend[1] == -1
sellSignal = trend == -1 and trend[1] == 1

// === STRATEGY LOGIC ===
longCond = buySignal
shortCond = sellSignal

sl = stopLossVal > 0 ? stopLossVal / 100 : 0.02  // default to 2% if 0
tp1 = sl
tp2 = sl * 2
tp3 = sl * 3

if (longCond)
    strategy.entry("Long", strategy.long)
    strategy.exit("TP1", from_entry="Long", stop=close * (1 - sl), limit=close * (1 + tp1))
    strategy.exit("TP2", from_entry="Long", stop=close * (1 - sl), limit=close * (1 + tp2))
    strategy.exit("TP3", from_entry="Long", stop=close * (1 - sl), limit=close * (1 + tp3))

if (shortCond)
    strategy.entry("Short", strategy.short)
    strategy.exit("TP1", from_entry="Short", stop=close * (1 + sl), limit=close * (1 - tp1))
    strategy.exit("TP2", from_entry="Short", stop=close * (1 + sl), limit=close * (1 - tp2))
    strategy.exit("TP3", from_entry="Short", stop=close * (1 + sl), limit=close * (1 - tp3))
Enter fullscreen mode Exit fullscreen mode

Strategy parameters

Image description

The original adddress: Dynamic Multi-Indicator Trend Continuation Trading Strategy

Comments 1 total

  • chao shi
    chao shiJun 3, 2025

    Really appreciate you sharing the strategy details and your thought process behind it — very insightful and helpful!

Add comment