Stochastic RSI w/ Crossover Alerts (EMA)
May 30, 2021

The Stochastic RSI w/ Crossover Alerts (EMA) tool is an enhanced momentum oscillator that combines classic Stochastic RSI calculations with trend-filtering moving averages and visual crossover signals. It provides traders with clear, color-coded alerts when momentum shifts occur in alignment with the prevailing trend.
Usage
The tool is primarily used to identify high-probability momentum reversals. It features background highlights that trigger based on specific technical conditions:
- Bullish Crossover: The background turns green when the %K line crosses above the %D line, provided the crossover occurs below the middle level (50) and price remains above the selected Moving Average (e.g., 200 EMA).
- Bearish Crossover: The background turns red when the %K line crosses below the %D line, provided the crossover occurs above the middle level (50) and price remains below the selected Moving Average.
Traders can utilize these highlights to identify entry points during trend pullbacks or momentum shifts within a broader trend.
Details
This script is built upon the standard Stochastic RSI formula, which applies the Stochastic calculation to RSI values rather than price. The added value lies in the integration of trend filters (EMA/WMA/SMA) and conditional logic for crossovers. By requiring crossovers to happen on a specific side of the 50-level relative to a long-term moving average, the indicator filters out many low-probability "noise" signals that occur in range-bound markets.
Settings
Stochastic RSI
- K: Sets the period for the %K line smoothing.
- D: Sets the period for the %D line (signal line) smoothing.
- RSI Length: The lookback period for the underlying RSI calculation.
- Stochastic Length: The lookback period for the Stochastic calculation applied to the RSI.
- RSI Source: The price source used for the RSI calculation (default is Close).
Bands
- Upper Band: Defines the Overbought threshold (default 80).
- Middle Band: Defines the equilibrium point (default 50).
- Lower Band: Defines the Oversold threshold (default 20).
Crossover Alerts
- Crossover Alert Background Colour (Middle Level): Enables background highlights for crossovers relative to the 50-level.
- Crossover Alert Background Colour (OB/OS Level): Enables background highlights specifically for crossovers occurring in Overbought or Oversold zones.
Moving Average
- MA Type: Choose between EMA, WMA, SMA, or None to act as a trend filter.
- MA Source: The price source for the trend filter calculation.
- MA Length: The period for the moving average (default 200).
FAQ
How do I use the trend filter?
In the settings, you can select the "MA Type." If set to 200 EMA, bullish signals will only appear if the price is above the 200 EMA, and bearish signals will only appear if the price is below it.
What is the difference between Middle Level and OB/OS alerts?
Middle Level alerts trigger based on crossovers occurring anywhere on the correct side of the 50-line, while OB/OS alerts are more restrictive, requiring the crossover to happen inside the extreme 20 or 80 zones.
How 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.