Overview
The RSI-AMD Dual Mode Momentum Trading System with Integrated Buy & Hold Benchmark is an innovative quantitative trading system that combines a technically-driven active trading component with a traditional buy-and-hold approach. The strategy leverages the Relative Strength Index (RSI) to identify overbought and oversold market conditions while utilizing the Average Mean Deviation (AMD) method to identify price accumulation zones. The system's uniqueness lies in the fact that it actually contains two separate strategies running in parallel: an active trading strategy based on RSI and price range with a 1:2 risk-reward ratio, and a passive buy-and-hold strategy that serves as a performance benchmark. The design allows traders to simultaneously evaluate the relative performance of tactical short-term trading versus long-term holding strategies.
Strategy Principles
The core logic of the strategy is based on multiple condition filters to determine optimal market entry points:
RSI Signals: Using a standard 14-period RSI indicator, buy signals are triggered when RSI crosses above the oversold zone (default 30), while sell signals are triggered when RSI crosses below the overbought zone (default 70).
Price Range Confirmation: The strategy utilizes the AMD (Average Mean Deviation) concept to identify price accumulation zones. It calculates the range between the highest high and lowest low over the past 10 periods and normalizes it as a percentage. When the price range is less than a preset threshold (default 1%), it indicates the market is in an accumulation phase, ready to break out in either direction.
Volume Confirmation: To further validate signal quality, the strategy requires that current volume is above the 20-period volume moving average, ensuring sufficient market participation to support potential price moves.
Risk Management: The system implements dynamic take profit and stop loss mechanisms, defaulting to 2% profit targets and 1% stop loss points, creating a 1:2 risk-reward ratio. These levels are dynamically calculated relative to the entry price.
Buy & Hold Component: The second component of the strategy is a simple one-time buy-and-hold approach that provides a performance benchmark for the active trading component.
The active trading engine and buy-and-hold component run completely independently without interfering with each other, allowing traders to compare the effectiveness of both approaches within the same backtest.
Strategy Advantages
Analysis of the strategy code reveals several significant advantages:
Multi-layered Signal Filtering: By requiring a combination of RSI signals, price accumulation, and volume confirmation, the strategy effectively filters out many potential false signals, improving trade quality.
High Adaptability: The strategy's multiple adjustable parameters (RSI period, overbought/oversold levels, range length, accumulation threshold, profit targets, and stop loss levels) allow for customization to different market environments and asset classes.
Built-in Risk Management: The dynamic take profit and stop loss mechanism provides clear exit criteria for each trade, preventing emotional decision-making and protecting capital.
Performance Benchmarking: The integrated buy-and-hold component provides immediate comparison, allowing traders to assess whether their active trading strategy is truly adding value beyond simple market participation.
Bidirectional Trading: The strategy is capable of capturing opportunities in both rising and falling markets through its long and short signals, enabling full-spectrum market participation.
Relatively Compact Trading: By focusing on momentum changes within tight price ranges, the strategy tends to capture early stages of significant price moves, potentially improving risk-adjusted returns.
Strategy Risks
Despite these advantages, the strategy also presents several potential risks that traders should be aware of:
RSI Limitations: RSI can produce sustained overbought or oversold signals in strongly trending markets, leading to premature entries or missed significant price moves. Simple overbought/oversold thresholds may not be reliable when markets are in strong trends.
Parameter Sensitivity: Strategy performance is highly sensitive to the settings of multiple parameters, particularly the RSI thresholds and price range percentage. Over-optimization of these parameters may lead to curve-fitting and poor performance in live trading.
Signal Frequency Uncertainty: Because the strategy relies on multiple conditions being met simultaneously, it may produce very few trading signals in certain market environments, leading to underutilization of capital.
Fixed Risk-Reward Settings: Using fixed percentage take profits and stop losses may not be suitable for all market conditions. During high-volatility periods, a 1% stop loss may be too tight, while during low-volatility periods, a 2% profit target may be too aggressive.
Absolute Percentage Stops: The strategy uses fixed percentage stops based on entry price rather than adaptive stops based on market volatility or support levels, which may result in being stopped out during normal market fluctuations.
Implicit Strategy Conflict: While the code ensures the two strategy components don't interfere with each other, running two potentially conflicting strategies (active trading vs. buy-and-hold) simultaneously may create conceptual confusion in terms of capital management and results evaluation.
Strategy Optimization Directions
Based on a deep analysis of the code, here are several possible optimization directions:
Adaptive RSI Thresholds: Introduce dynamic RSI thresholds based on historical volatility or trend strength, rather than using fixed overbought/oversold levels. This could be implemented by calculating the mean and standard deviation of RSI and then adjusting thresholds based on current market conditions.
Volatility-Adjusted Stop Losses: Replace fixed percentage stops with stops based on Average True Range (ATR), ensuring stop points account for current market volatility. For instance, stops could be set at entry price minus 1.5 times ATR.
Partial Profit Locking: Implement a staged profit-taking strategy, partially closing positions when certain targets are hit while moving stops on remaining positions to above cost, protecting realized gains.
Position Sizing Optimization: Adjust position sizes based on signal strength, market volatility, and recent strategy performance, rather than using a fixed percentage of equity.
Multiple Timeframe Confirmation: Add longer timeframe trend filters to ensure short-term trades align with the primary trend direction, possibly through longer-period moving averages or longer timeframe RSI readings.
Correlated Market Filters: Integrate information from related markets or indicators (such as sector indices, volatility indices, or market breadth indicators) to provide additional market context and filter low-quality signals.
Independent Strategy Evaluation: Modify the code to allow separate evaluation of the active trading and buy-and-hold components' performance, including separate drawdown and return statistics, for clearer comparison of the two approaches.
Machine Learning Enhancement: Explore using simple machine learning algorithms to optimize parameter selection or predict which strategy component might perform better under specific market conditions, enabling adaptive approach selection.
Summary
The RSI-AMD Dual Mode Momentum Trading System is a thoughtfully designed quantitative strategy that cleverly combines technical analysis, price pattern recognition, and risk management principles while providing built-in performance benchmarking. The strategy's core strength lies in its multi-layered signal confirmation process, requiring simultaneous RSI momentum, price accumulation, and volume support to enhance trade quality.
The built-in 1:2 risk-reward framework provides a structured approach to capital protection, while the parallel buy-and-hold component offers a realistic performance comparison for active trading decisions. However, like all trading systems, the strategy has limitations, particularly in RSI signal reliability, parameter sensitivity, and fixed risk management settings.
By implementing the suggested optimizations, especially adaptive parameters, volatility-adjusted risk management, and multiple timeframe analysis, the strategy can be further enhanced in robustness and adaptability. Ultimately, the RSI-AMD system represents a balanced approach that combines the reliability of classic technical indicators with innovative execution and risk management frameworks, providing a promising starting point for short-term momentum traders while maintaining a clear benchmark against long-term investment performance.
Strategy source code
/*backtest
start: 2025-06-04 00:00:00
end: 2025-06-06 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy('RSI + AMD Strategy (1:2 RR) vs Buy & Hold', overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === PARAMETERS ===
rsiPeriod = input(14, title='RSI Period')
rsiOverbought = input(70, title='RSI Overbought')
rsiOversold = input(30, title='RSI Oversold')
rangeLength = input(10, title='AMD Range Length')
rangeTightPct = input(0.01, title='Max % Range for Accumulation')
tpPct = input(2.0, title='Take Profit (%)')
slPct = input(1.0, title='Stop Loss (%)')
enableBuyHold = input.bool(true, title='Active Buy & Hold')
// === CALCULATIONS ===
rsi = ta.rsi(close, rsiPeriod)
rangeHigh = ta.highest(high, rangeLength)
rangeLow = ta.lowest(low, rangeLength)
tightRange = (rangeHigh - rangeLow) / rangeLow < rangeTightPct
volConfirm = volume > ta.sma(volume, 20)
// === ACTIVE STRATEGY CONDITIONS ===
longEntry = ta.crossover(rsi, rsiOversold) and tightRange and volConfirm
shortEntry = ta.crossunder(rsi, rsiOverbought) and tightRange and volConfirm
// === ACTIVE STRATEGY TICKETS ===
if longEntry
strategy.entry('Active Purchase', strategy.long, comment='Active Long')
if shortEntry
strategy.entry('Active Sell', strategy.short, comment='Active Short')
// === DYNAMIC TP/SL FOR ACTIVE STRATEGY ===
longTake = close * (1 + tpPct / 100)
longStop = close * (1 - slPct / 100)
shortTake = close * (1 - tpPct / 100)
shortStop = close * (1 + slPct / 100)
strategy.exit('TP/SL Purchase', from_entry='Active Purchase', limit=longTake, stop=longStop)
strategy.exit('TP/SL Sell', from_entry='Active Sell', limit=shortTake, stop=shortStop)
// === BUY & HOLD (parallel, without interfering with the other) ===
if enableBuyHold
var bool didBuyHold = false
if not didBuyHold
strategy.entry('Buy & Hold', strategy.long, comment='Buy & Hold')
didBuyHold := true
Strategy parameters
The original address: RSI-AMD Dual Mode Momentum Trading System with Integrated Buy & Hold Benchmark
RSI + AMD momentum trading? Now we're cooking with math! 🔥 Love how this system flips between mean-reversion and trend-following like a bipolar trader on caffeine. The built-in buy & hold benchmark is a nice touch - perfect for when you need that extra dose of reality check. Just don't be surprised when the market laughs at your 'dual mode' and goes triple-reverse-psychology on you. Solid work, though maybe add a 'WTF mode' for when volatility goes full meme stock?