Triple EMA and Triple RMA Adaptive Channel Crossover Strategy
FMZQuant

FMZQuant @fmzquant

Joined:
Apr 25, 2024

Triple EMA and Triple RMA Adaptive Channel Crossover Strategy

Publish Date: Apr 16
1 1

Image description

Image description

Overview
The Triple EMA and Triple RMA Adaptive Channel Crossover Strategy is a quantitative trading system that combines short-period EMA (Exponential Moving Average) and RMA (Relative Moving Average) indicators. This strategy utilizes the ATR (Average True Range) indicator to construct price channels and identifies entry signals by capturing price breakouts from these channels. The strategy incorporates a built-in risk management mechanism, calculating position size based on a fixed risk percentage, using the opening price as a stop-loss point, and designing a closing mechanism based on the previous period's opening price, forming a complete trading system.

Strategy Principles
The core logic of this strategy is based on two sets of moving averages combined with their ATR channels:

EMA Channel System:

  • Uses a 3-period EMA as the center line
  • Constructs upper and lower channel boundaries by multiplying ATR by a factor of 1.5
  • Generates long signals when price breaks through the upper band; short signals when it breaks through the lower band

RMA Channel System:

  • Uses a 3-period RMA as the center line
  • Constructs upper and lower channel boundaries by multiplying ATR by a factor of 1.0
  • Similarly generates trading signals through channel breakouts

Signal Triggering Conditions:

  • Long entry triggered when closing price breaks above either channel's upper band
  • Short entry triggered when closing price breaks below either channel's lower band
  • Signals are only valid after bar confirmation (barstate.isconfirmed)

Position Management:

  • Uses a fixed risk percentage method (0.5%) to calculate position size
  • The distance between entry price and stop-loss price determines the final position size

Stop-Loss and Exit Mechanism:

  • Immediately sets a stop-loss order at the opening price upon entry
  • Closes long positions when the low crosses above the previous period's opening price
  • Closes short positions when the high crosses below the previous period's opening price

Strategy Advantages

  1. Rapid Response to Market Changes: Using ultra-short period (3) moving averages, the strategy can quickly capture price movements and enter trends in a timely manner.

  2. Dual Confirmation Mechanism: EMA and RMA systems work together, significantly improving trading reliability when both emit signals in the same direction.

  3. Adaptive Volatility Adjustment: By adjusting channel width through the ATR indicator, the strategy can automatically adjust sensitivity in different volatility environments.

  4. Precise Risk Control: Each trade risks a fixed 0.5% of account equity, strictly controlling single trade risk exposure.

  5. Clear Exit Strategy: The closing mechanism based on the previous period's opening price provides clear profit-taking conditions for trades.

  6. Differentiated Channel Multipliers: The EMA channel uses 1.5x ATR, while the RMA channel uses 1.0x ATR. This design gives the two systems different sensitivities, capable of capturing different types of market opportunities.

Strategy Risks
Overtrading Risk: Ultra-short period (3) moving averages may generate too many false signals in oscillating markets, leading to frequent trading and commission erosion.

  • Solution: Consider adding confirmation filters, such as volume confirmation or trend direction filtering.

Fixed Stop-Loss Setting: Using the opening price as a stop-loss point may not always be optimal, especially in high-volatility or gap markets.

  • Solution: Dynamically adjust stop-loss distance based on ATR or volatility percentage.

Simplistic Exit Conditions: Relying solely on crosses of the previous period's opening price may lead to premature exits in strong trends.

  • Solution: Consider introducing trend strength indicators and adopting more relaxed exit conditions in strong trends.

Lack of Market Environment Filtering: The strategy does not distinguish between different market states (trending/oscillating), potentially trading frequently in unsuitable market environments.

  • Solution: Add market state judgment indicators, such as ADX or volatility indicators, to pause trading in oscillating markets.

Parameter Optimization Risk: Current parameters (such as period 3 and ATR multipliers) may be overfitted to historical data, with uncertain future performance.

  • Solution: Conduct parameter robustness testing and validate parameter stability using walk-forward optimization methods.

Strategy Optimization Directions
Market State Adaptability Optimization:

  • Add market environment recognition mechanisms, such as ADX or volatility range judgment
  • Use different parameter settings or trading rules in different market states
  • This can avoid overtrading problems in oscillating markets

Multi-Timeframe Confirmation:

  • Introduce longer-period (e.g., daily) trend judgment
  • Only trade when short-period signals align with long-period trend direction
  • This will improve signal reliability and reduce counter-trend trading

Dynamic Stop-Loss Optimization:

  • Dynamically set stop-loss distances based on current ATR values
  • Give prices more breathing room in high-volatility environments
  • This method can better adapt to volatility characteristics in different market conditions

Enhanced Exit Strategy:

  • Introduce trailing stop or trailing stop-loss mechanisms
  • Dynamically adjust exit strategies based on accumulated profits
  • This can better protect existing profits and allow trends to fully develop

Signal Quality Assessment:

  • Develop a signal strength scoring system
  • Dynamically adjust position size based on signal quality
  • This will increase positions under high-confidence conditions and reduce risk under low-confidence conditions

Summary
The Triple EMA and Triple RMA Adaptive Channel Crossover Strategy cleverly combines two different types of moving averages with ATR channels, forming a trading system that is sensitive to price breakouts while maintaining risk control capabilities. This strategy is particularly suitable for capturing short-term price movements and responds quickly to rapidly developing trends. Through position management with fixed risk percentages and clear stop-loss strategies, the system focuses on capital safety while pursuing returns.

However, the strategy also faces potential overtrading risks and market environment adaptability issues. By adding market state filtering, optimizing stop-loss mechanisms, introducing multi-timeframe confirmation, and other methods, the robustness and long-term performance of this strategy can be significantly enhanced. In particular, adding the ability to recognize market environments will enable the strategy to selectively participate in trading under different market conditions, further improving its practicality and profitability.

Overall, this is a clearly structured, logically rigorous quantitative trading strategy with a solid theoretical foundation and application potential. Through the optimization directions suggested in this article, the strategy is expected to demonstrate stronger adaptability and stability across various market environments.

Strategy source code

/*backtest
start: 2024-04-07 00:00:00
end: 2025-04-06 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/

//@version=5
strategy("EMA3 & RMA3 ATR Strategy", overlay=true, initial_capital=10000, currency=currency.USD)

// —— Input parameters ——
ema_len = input.int(3, "EMA period")
ema_mult = input.float(1.5, "EMA channel ATR multiplier", step=0.1)
rma_len = input.int(3, "RMA period")
rma_mult = input.float(1.0, "RMA channel ATR multiplier", step=0.1)
atr_len = input.int(3, "ATR period")

// —— Core computing ——
ema_val = ta.ema(close, ema_len)
atr_val = ta.atr(atr_len)
ema_upper = ema_val + atr_val * ema_mult
ema_lower = ema_val - atr_val * ema_mult

rma_val = ta.rma(close, rma_len)
rma_upper = rma_val + atr_val * rma_mult
rma_lower = rma_val - atr_val * rma_mult

// —— Signal conditions ——
ema_buy = barstate.isconfirmed and close > ema_upper
ema_sell = barstate.isconfirmed and close < ema_lower
rma_buy = barstate.isconfirmed and close > rma_upper
rma_sell = barstate.isconfirmed and close < rma_lower

// —— Position calculation ——
risk_percent = 0.5 // Single risk is 0.5%
position_size(price, stop_price) => 
    risk_amount = strategy.equity * risk_percent / 100
    math.abs(price - stop_price) > 0 ? (risk_amount / math.abs(price - stop_price)) : na

// —— Trading logic ——
var float prev_open = na
if barstate.isconfirmed
    prev_open := open[1]

// Long order logic
if (ema_buy or rma_buy) and strategy.position_size == 0
    stop_price = open
    qty = position_size(close, stop_price)
    if not na(qty)
        strategy.entry("Long", strategy.long, qty=qty)
        strategy.exit("Long Stop", "Long", stop=stop_price)

// Short order logic
if (ema_sell or rma_sell) and strategy.position_size == 0
    stop_price = open
    qty = position_size(close, stop_price)
    if not na(qty)
        strategy.entry("Short", strategy.short, qty=qty)
        strategy.exit("Short Stop", "Short", stop=stop_price)

// Closing position logic
if strategy.position_size > 0
    if ta.crossover(low, prev_open)
        strategy.close("Long")

if strategy.position_size < 0
    if ta.crossunder(high, prev_open)
        strategy.close("Short")

// —— Visualization ——
plot(ema_val, "EMA3", color.new(#00BFFF, 0), 2)
plot(ema_upper, "EMA Upper", color.red, 1)
plot(ema_lower, "EMA Lower", color.green, 1)
plot(rma_val, "RMA3", color.new(#FFA500, 0), 2)
plot(rma_upper, "RMA Upper", #FF1493, 1)
plot(rma_lower, "RMA Lower", #32CD32, 1)
Enter fullscreen mode Exit fullscreen mode

Strategy parameters

Image description

The original address: Triple EMA and Triple RMA Adaptive Channel Crossover Strategy

Comments 1 total

  • Rebecca Chow
    Rebecca ChowJun 26, 2025

    Interesting twist using both EMA and RMA channels! The triple-layer approach seems robust for trend identification, but how sensitive is it to the chosen lookback periods? Have you tested this on assets with different volatility profiles? Also curious about the trade frequency—does it generate enough signals in slower markets? Really like the adaptive nature of this system. Would love to see some Monte Carlo simulation results!

Add comment