MACD + Stochastic + RSI (Long + Short)
Dec 29, 2018

The MACD + Stochastic + RSI indicator is a trend-following strategy tool that combines momentum, oscillator, and relative strength data to identify high-probability entries during market breakouts.
Usage
The script identifies potential long and short entries based on the alignment of three popular technical indicators. It is particularly effective on higher timeframes, such as the Daily or 1H charts, during periods where the market is breaking out from consolidation.
- Long Entry: Occurs when the MACD line is above the Signal line, the Stochastic %K is above 50, and the RSI is above 50.
- Short Entry: Occurs when the MACD line is below the Signal line, the Stochastic %K is below 50, and the RSI is below 50.
- Exits: Positions are closed based on MACD crossovers. A long position is closed when the MACD crosses below the Signal line, and a short position is closed when the MACD crosses above the Signal line.
The indicator also features optional bar coloring to visualize the current trend state directly on the price action.
Details
This tool leverages a confluence-based approach to filter out market noise. By requiring the MACD (momentum), Stochastic (oscillator position), and RSI (relative strength) to all align above or below their respective midpoints/signals, the script ensures that a trend has sufficient strength before signaling an entry. Unlike many strategies that use fixed take-profit or stop-loss levels, this implementation relies on the MACD trend reversal for exits, allowing traders to capture extended moves.
Settings
- MACD fast moving average: Sets the period for the fast EMA in the MACD calculation (Default: 12).
- MACD slow moving average: Sets the period for the slow EMA in the MACD calculation (Default: 26).
- MACD signal line moving average: Sets the smoothing period for the MACD signal line (Default: 9).
- Stochastic Length: The lookback period used for the Stochastic oscillator calculation.
- Smoothing of Stochastic %K: The period for the simple moving average applied to the Stochastic %K.
- Moving Average of Stochastic %K: The period for the signal line (%D) of the Stochastic.
- Enable MACD Bar Color?: Toggles the visualization of trend-based bar coloring on the chart.
FAQ
How do I interpret the bar colors? Green bars indicate a bullish confluence (MACD > Signal, RSI > 50, Stoch > 50), while red bars indicate a bearish confluence. Yellow or gray bars indicate neutral or transitional phases where the MACD signal has reversed but the other conditions may not yet be met.
Which markets work best with this strategy? While it can be applied to various assets, it is designed primarily for trending markets like stocks and futures, especially following consolidation phases.
How can I access MACD + Stochastic + RSI? 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.