Technical Overview
This approach is a quantitative trading system utilizing RSI-WMA crossovers and EMA trend filtering to generate signals. It captures crossover points of RSI and its WMA, confirmed by trend direction using the EMA. The strategy employs dynamic Stop Loss (SL) and Take Profit (TP) mechanisms, based on the golden ratio for a structured risk management setup. The focus is on overbought/oversold reversals, validated by trend direction.
Strategy Overview
The framework is constructed on RSI-WMA crossover signals and EMA trend filtering.
The Relative Strength Index (RSI) is calculated over 14 periods and further smoothed with a 45-period Weighted Moving Average (WMA). A crossover of RSI above its WMA signals a potential long entry, while a crossover below signals a short entry.
A 120-period Exponential Moving Average (EMA) acts as a trend filter. Long entries are confirmed only if price is above the EMA, confirming trend direction and minimizing counter-trend risks.
Once a signal is confirmed, dynamic stop loss and take profit levels are set:
- For long positions: Stop loss at the lowest low of the last two candles, take profit at entry plus the risk-reward distance (default 1.613).
- For short positions: Stop loss at the highest high of the last two candles, take profit in the opposite direction.
This dynamic approach aligns with market volatility, unlike fixed SL points.
Strategy Strengths
- Dual Confirmation: RSI-WMA signals confirmed by EMA trend alignment reduce false signals.
- Adaptive Risk Management: SLs adjust based on recent volatility, refining performance across environments.
- Risk-Reward Optimization: A default 1.613 ratio approximates the golden ratio for balanced outcomes.
- Streamlined Parameter Setup: Simplified through four settings (EMA, RSI, WMA lengths, risk-reward ratio).
- Visual Clarity: EMA, RSI, and WMA-RSI lines plotted for immediate strategy insight.
Strategy Limitations
- Trend Lag: EMA lag may cause missed entries near reversals.
- Range Market Challenges: Frequent RSI-WMA crossovers in sideway trends elevate signal noise.
- Stop Loss Constraints: Volatility extremes may widen SLs, altering risk exposure.
- Parameter Sensitivity: System performance varies with parameter adjustments across markets.
- Volume Omission: Reliance on price indicators without volume confirmation could affect signal integrity.
Optimize parameters, introduce adaptive elements, integrate volume filters, and control trade frequency for improved robustness.
Optimization Directions
- Adaptive Parameters: Dynamically adjust RSI and WMA based on market volatility.
- Volume Integration: Add volume confirmation for improved signal validation.
- Trend Filter Enhancement: Utilize dual EMA crossovers or ADX to reduce trend filter lag.
- Risk Management Refinement: Use ATR for SL levels, enhancing precision.
- Time Filters: Avoid low-volatility sessions or uncertain periods such as major data releases.
- Signal Quality Control: Filter crossover angles and require proximity to key RSI levels (e.g., 30/70).
These refinements aim to solidify strategy effectiveness and adaptability.
Technical Summary
The RSI-WMA Dynamic Crossover Trend Following Strategy merges RSI-WMA signaling with EMA trend filtering, employing dynamic SL/TP for disciplined risk management. Its dual confirmation and adaptive risk control are strategic strengths, countered by challenges in trend recognition and parameter sensitivity.
Enhancements such as adaptive parameters, volume confirmation, trend filter optimization, and improved risk management can increase strategy longevity. It performs effectively in trending markets, leveraging RSI reversals and EMA filtering to minimize counter-trend activity.
This system suits medium to long-term traders who favor systematic risk management and alignment with dominant market trends. Proper parameter settings and sound risk strategies may yield stable returns across diverse environments.
Strategy source code
/*backtest
start: 2024-04-27 00:00:00
end: 2025-04-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"SOL_USDT"}]
*///@version=5
strategy("RSI-WMA + EMA Trend Filter | SL/TP Dynamic", overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=5)// ==== INPUTS ====
emaLen = input.int(120, title="EMA Length")
rsiLen = input.int(14, title="RSI Length")
wmaLen = input.int(45, title="WMA of RSI Length")
rrRatio = input.float(1.613, title="Risk:Reward Ratio", step=0.001)// ==== INDICATORS ====
rsi = ta.rsi(close, rsiLen)
wma_rsi = ta.wma(rsi, wmaLen)
ema = ta.ema(close, emaLen)// ==== TREND FILTER ====
trendLong = close > ema
trendShort = close < ema // ==== CROSS SIGNALS ====
longSignal = ta.crossover(rsi, wma_rsi) and trendLong
shortSignal = ta.crossunder(rsi, wma_rsi) and trendShort// ==== SL/TP CALC ====
var float sl = na
var float tp = na// ==== ENTRY/EXIT LOGIC ====
if (longSignal)
sl := math.min(low, low[1]) // nearest lower bottom
tp := close + (close - sl) * rrRatio
strategy.entry("Long", strategy.long)
strategy.exit("TP/SL Long", from_entry="Long", stop=sl, limit=tp)if (shortSignal)
sl := math.max(high, high[1]) // nearest higher peak
tp := close - (sl - close) * rrRatio
strategy.entry("Short", strategy.short)
strategy.exit("TP

