All indicators

Range Strat - MACD/RSI

Aug 22, 2022

Static chart image
SignalsOscillatorsMoving AveragesTrailing-Stop

The Range Strat - MACD/RSI indicator is a trend-following and momentum-based strategy designed to identify entry and exit points specifically within range-bound markets. By combining the Moving Average Convergence Divergence (MACD) for trend direction and the Relative Strength Index (RSI) as a confirmation filter, the script aims to capture price swings while suppressing signals at extreme price levels.

Usage

The indicator generates Long and Short signals based on MACD crossovers while using RSI thresholds to ensure momentum supports the trade.

  • Long Entry: Occurs when the MACD line crosses above the Signal line, provided the RSI is below the user-defined Oversold Threshold.
  • Short Entry: Occurs when the MACD line crosses below the Signal line, provided the RSI is above the user-defined Overbought Threshold.

The strategy is optimized for the 4-hour timeframe and is particularly effective in cryptocurrency markets during periods of lateral movement or "chop." Users can adjust the RSI thresholds to be more or less restrictive depending on their risk tolerance and the specific volatility of the asset.

Details

Unlike typical mean-reversion RSI strategies, this tool uses RSI as a gatekeeper. Because MACD and RSI can provide contrary signals, the strategy requires generous RSI threshold settings (often near the midpoint) to ensure signals are triggered effectively. The logic is built to capture the "ping-pong" effect of an established range, aiming to enter near range highs and lows. It includes built-in stop-loss functionality to mitigate risks during strong breakout trends.

Settings

Backtest Range

  • Start Date: Sets the beginning date for backtesting performance.
  • End Date: Sets the concluding date for backtesting performance.

RSI Settings

  • RSI Source: Determines the price source (e.g., Open, Close) used for RSI calculation.
  • Length: Sets the lookback period for the RSI oscillator.
  • Over Sold Threshold: The maximum RSI level allowed to trigger a Long signal.
  • Over Bought Threshold: The minimum RSI level allowed to trigger a Short signal.

MACD Settings

  • MACD Source: Determines the price source used for MACD calculation.
  • Fast Length: The period for the fast moving average.
  • Slow Length: The period for the slow moving average.
  • Signal Smoothing: The period for the signal line calculation.
  • Oscillator MA Type: Choose between SMA or EMA for the MACD oscillator components.
  • Signal Line MA Type: Choose between SMA or EMA for the Signal line smoothing.

Stop Loss Settings

  • Long Stop Loss (%): Percentage distance from the average entry price to place a stop loss for long positions.
  • Short Stop Loss (%): Percentage distance from the average entry price to place a stop loss for short positions.

FAQ

How do I access Range Strat - MACD/RSI? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What timeframe is best for this strategy? This strategy is primarily designed for the 4h timeframe. Lower timeframes may increase the frequency of false signals.

Can I use this on assets other than Bitcoin? Yes, while it was designed for range-bound crypto markets, it can be applied to any asset showing a clear observable price range.

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.