
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.
The core logic of this strategy is based on two sets of moving averages combined with their ATR channels:
EMA Channel System:
RMA Channel System:
Signal Triggering Conditions:
Position Management:
Stop-Loss and Exit Mechanism:
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.
Dual Confirmation Mechanism: EMA and RMA systems work together, significantly improving trading reliability when both emit signals in the same direction.
Adaptive Volatility Adjustment: By adjusting channel width through the ATR indicator, the strategy can automatically adjust sensitivity in different volatility environments.
Precise Risk Control: Each trade risks a fixed 0.5% of account equity, strictly controlling single trade risk exposure.
Clear Exit Strategy: The closing mechanism based on the previous period’s opening price provides clear profit-taking conditions for trades.
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.
Overtrading Risk: Ultra-short period (3) moving averages may generate too many false signals in oscillating markets, leading to frequent trading and commission erosion.
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.
Simplistic Exit Conditions: Relying solely on crosses of the previous period’s opening price may lead to premature exits 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.
Parameter Optimization Risk: Current parameters (such as period 3 and ATR multipliers) may be overfitted to historical data, with uncertain future performance.
Market State Adaptability Optimization:
Multi-Timeframe Confirmation:
Dynamic Stop-Loss Optimization:
Enhanced Exit Strategy:
Signal Quality Assessment:
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.
/*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)
// —— 输入参数 ——
ema_len = input.int(3, "EMA周期")
ema_mult = input.float(1.5, "EMA通道ATR乘数", step=0.1)
rma_len = input.int(3, "RMA周期")
rma_mult = input.float(1.0, "RMA通道ATR乘数", step=0.1)
atr_len = input.int(3, "ATR周期")
// —— 核心计算 ——
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
// —— 信号条件 ——
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
// —— 仓位计算 ——
risk_percent = 0.5 // 单次风险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
// —— 交易逻辑 ——
var float prev_open = na
if barstate.isconfirmed
prev_open := open[1]
// 多单逻辑
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)
// 空单逻辑
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)
// 平仓逻辑
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")
// —— 可视化 ——
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)