All indicators

Easy to Use MACD+RSI Strategy

Oct 9, 2019

Static chart image
SignalsOscillators

The Easy to Use MACD+RSI Strategy tool provides a simplified framework for trend-following backtesting by combining momentum and oscillator signals to identify high-probability entry and exit points.

Usage

This strategy is designed to identify long-side opportunities by looking for convergence between the MACD and RSI indicators. A long entry is triggered when the MACD line crosses above the Signal line while both are below the zero level, provided the RSI is also below its midpoint (50), indicating a potential reversal from an oversold or neutral state.

The strategy is configured by default to only allow long positions, making it suitable for beginners or investors who prefer not to engage in short-selling. To exit a trade, the script looks for a MACD crossunder (MACD line crossing below the Signal line) while above the zero level.

Details

The strategy relies on two core technical analysis concepts:

  1. MACD (Moving Average Convergence Divergence): Used to determine trend direction and momentum. The crossover below the zero line suggests a transition from bearish to bullish momentum.
  2. RSI (Relative Strength Index): Acts as a confirmation filter. By requiring the RSI to be below 50 at the time of the MACD crossover, the strategy ensures it is entering at a relatively lower price point rather than chasing a late-stage trend.

The code includes a "Start Date" filter, allowing users to define a specific historical window for the backtest results.

Settings

Backtest Time Window

  • Start Date: Sets the day of the month to begin the backtest calculation.
  • Start Month: Sets the month to begin the backtest calculation.
  • Start Year: Sets the year to begin the backtest calculation.

MACD Configuration

  • Fast Length: The period for the shorter EMA used in MACD calculation (default is 12).
  • Slow Length: The period for the longer EMA used in MACD calculation (default is 26).
  • Signal Length: The period for the EMA of the MACD line, used to generate signal crossovers (default is 9).

FAQ

How do I use the MACD+RSI Strategy?

Apply the script to your chart and adjust the MACD lengths to suit your specific timeframe. The strategy will automatically execute trades in the Strategy Tester based on the crossover and RSI confirmation logic.

Can this strategy be used for shorting?

While the logic for a short exit exists via the MACD crossunder, the default script settings restrict the strategy to long-only entries to simplify the trading approach for newer users.

Where can I access this tool?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.