Supertrend with Stochastic OB/OS Arrows
Oct 7, 2023

The Supertrend with Stochastic OB/OS Arrows indicator combines trend-following logic with momentum-based reversal signals to provide a comprehensive view of market direction and potential entry points.
Usage
Traders can use this tool to align momentum exhaustion with the prevailing trend. The script identifies specific moments where price action and momentum diverge within a trend:
- Buy Signals: A green triangle appears below the bars when the Supertrend indicates an uptrend but the Stochastic %K line falls below the defined Oversold Level. This highlights potential "buy the dip" opportunities within a bullish structure.
- Sell Signals: A red triangle appears above the bars when the Supertrend indicates a downtrend but the Stochastic %K line rises above the defined Overbought Level. This highlights potential "sell the rally" opportunities within a bearish structure.
The tool also provides a visual representation of the trend through color-coded background fills between the price and the Supertrend line, helping users maintain orientation during volatile periods.
Details
The script integrates two classic technical analysis concepts:
- Supertrend: Calculated using the Average True Range (ATR) and a multiplier, this component defines the primary trend direction. It stays green while the trend is bullish and red while the trend is bearish.
- Stochastic Oscillator: This component measures the location of the price relative to its high-low range over a set period. By identifying overbought and oversold conditions, it signals when a correction within a larger trend might be ending.
The logic is designed to filter out momentum signals that go against the trend, only showing arrows when the oscillator suggests a reversal back into the direction of the Supertrend.
Settings
Supertrend Settings
- ATR Length: The period used for calculating the Average True Range.
- Factor: The multiplier applied to the ATR to determine the distance of the Supertrend line from the price.
Stochastic Settings
- K Length: The period used to calculate the raw %K value.
- K Smoothing: The length of the moving average applied to the %K line.
- D Smoothing: The length of the moving average applied to %K to create the %D signal line.
- Overbought Level: The threshold (typically 80) above which the market is considered overbought.
- Oversold Level: The threshold (typically 20) below which the market is considered oversold.
FAQ
How do I use the arrows for trading?
The arrows are intended to signal potential trend continuation entries. A buy arrow suggests a bullish trend is intact but price is temporarily oversold, while a sell arrow suggests a bearish trend is intact but price is temporarily overbought.
Can I change the sensitivity of the trend?
Yes, by adjusting the "Factor" or "ATR Length" in the Supertrend settings. A lower Factor will make the indicator more sensitive to price changes, while a higher Factor will make it react more slowly to volatility.
How can I access Supertrend with Stochastic OB/OS Arrows?
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.