Stochastic & RSI
Jun 20, 2021

The Stochastic & RSI indicator combines momentum and trend strength metrics into a single interface to help traders identify potential entry points and market conditions more efficiently. This tool integrates the Stochastic oscillator, Relative Strength Index (RSI), Average True Range (ATR), and Average Directional Index (ADX) to provide a comprehensive view of price action and volatility.
Usage
The Usage section describes how the script can be used to refine trading strategies. Traders often use the Stochastic and RSI components to identify pullbacks and momentum shifts.
- Trade Entries: A common approach is to look for Stochastic crosses while the RSI is positioned relative to the 50 level. For example, a bullish Stochastic cross with the RSI above 50 can signal a long entry.
- Trend Strength: The integrated ADX value, displayed in the corner table, helps determine if the market is trending (e.g., ADX > 25) or ranging.
- Volatility and Risk Management: The ATR value provides a real-time measure of volatility, which is useful for setting stop-loss distances based on current market behavior.
- Visual Cues: The RSI plot changes color based on its position relative to the 50 level, allowing for quick trend bias assessment.
Details
The script calculates the Stochastic RSI based on user-defined lengths and smoothing parameters. It also computes two distinct RSI lines and an EMA of the primary RSI to offer additional layers of trend confirmation. To assist with risk and trend analysis without cluttering the chart, the indicator uses a table to display the most recent ATR and ADX values. The Stochastic calculation is derived from an RSI source, following the traditional construction of the Stochastic RSI.
Settings
Main Settings
- Smooth K: Determines the smoothing factor for the %K line.
- Smooth D: Determines the smoothing factor for the %D line.
- RSI Length: Sets the lookback period for the primary RSI.
- RSI2 Length: Sets the lookback period for the secondary (optional) RSI.
- EMA Length: Sets the length for the EMA applied to the primary RSI.
- Stochastic Length: Sets the lookback period for the Stochastic calculation.
- RSI Source: Determines the price source (e.g., close) used for RSI calculations.
Visuals
- Upper level: Defines the overbought threshold (default 70).
- Lower level: Defines the oversold threshold (default 30).
- Show RSI color: Toggles color changes for the primary RSI line based on the 50 level.
- Show RSI2 color: Toggles color changes for the secondary RSI line.
FAQ
How do I use the ADX and ATR table?
The table in the bottom-left corner displays the latest ATR and ADX values. Use the ATR to calculate stop-loss placement and the ADX to confirm if there is sufficient trend strength to take a trade.
What do the different RSI colors mean?
By default, the RSI turns green when it is above 50 (bullish momentum) and red when it is below 50 (bearish momentum).
How can I access the Stochastic & RSI indicator?
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.