OPEN-SOURCE SCRIPT

RSI Candlestick Oscillator [LuxAlgo]

14 144
The RSI Candlestick Oscillator displays a traditional Relative Strength Index (RSI) as candlesticks. This indicator references OHLC data to locate each candlestick point relative to the current RSI Value, leading to a more accurate representation of the Open, High, Low, and Close price of each candlestick in the context of RSI.

In addition to the candlestick display, Divergences are detected from the RSI candlestick highs and lows and can be displayed over price on the chart.

🔶 USAGE

syot kilat

Translating candlesticks into the RSI oscillator is not a new concept and has been attempted many times before. This indicator stands out because of the specific method used to determine the candlestick OHLC values. When compared to other RSI Candlestick indicators, you will find that this indicator clearly and definitively correlates better to the on-chart price action.

Traditionally, the RSI indicator is simply one running value based on (typically) the close price of the chart. By introducing high, low, and open values into the oscillator, we can better gauge the specific price action throughout the intrabar movements.

Interactions with the RSI levels can now take multiple forms, whether it be a full-bodied breakthrough or simply a wick test. Both can provide a new analysis of price action alongside RSI.

An example of wick interactions and full-bodied interactions can be seen below.

syot kilat

As a result of the candlestick display, divergences become simpler to spot. Since the candlesticks on the RSI closely resemble the candlesticks on the chart, when looking for divergence between the chart and RSI, it is more obvious when the RSI and price are diverging.

The divergences in this indicator not only show on the RSI oscillator, but also overlay on the price chart for clearer understanding.

syot kilat

🔹 Filtering Divergence

With the candlesticks generating high and low RSI values, we can better sense divergences from price, since these points are generally going to be more dramatic than the (close) RSI value.

This indicator displays each type of divergence:

  • Bullish Divergence
  • Bearish Divergence
  • Hidden Bullish Divergence
  • Hidden Bearish Divergence


From these, we get many less-than-useful indications, since every single divergence from price is not necessarily of great importance.

The Divergence Filter disregards any divergence detected that does not extend outside the RSI upper or lower values.

This does not replace good judgment, but this filter can be helpful in focusing attention towards the extremes of RSI for potential reversal spotting from divergence.

syot kilat

🔶 DETAILS

In order to get the desired results for a display that resembles price action while following RSI, we must scale. The scaling is the most important part of this indicator.

To summarize the process:

  1. Identify a range on Price and RSI
  2. Consider them as equal to create a scaling factor
  3. Use the scaling factor to locate RSI's "Price equivalent" Upper, Lower, & Mid on the Chart
  4. Use those prices (specifically the RSI Mid) to check how far each OHLC value lies from it
  5. Use those differences to translate the price back to the RSI Oscillator, pinning the OHLC values at their relative location to our anchor (RSI Mid)


🔹 RSI Channel

To better understand, and for your convenience, the indicator includes the option to display the RSI Channel on the chart. This channel helps to visualize where the scaled RSI values are relative to price.

syot kilat

If you analyze the RSI channel, you are likely to notice that the price movement throughout the channel matches the same movement witnessed in the RSI Oscillator below. This makes sense since they are the exact same thing displayed on different scales.

🔹 Scaling the Open

While the scaling method used is important, and provides a very close view of the real price bar's relative locations on the RSI oscillator… It is designed for a single purpose.

The scaling does NOT make the price candles display perfectly on the RSI oscillator.

The largest place where this is noticeable is with the opening of each candle.

For this reason, we have included a setting that modifies the opening of each RSI candle to be more accurate to the chart's price candles.

This setting positions the current bar's opening RSI candlestick value accurately relative to the price's open location to the previous closing price. As seen below.

syot kilat

🔶 SETTINGS

🔹 RSI Candles

  • RSI Length: Sets the Length for the RSI Oscillator.
  • Overbought/Oversold Levels: Sets the Overbought and Oversold levels for the RSI Oscillator.
  • Scale Open for Chart Accuracy: As described above, scales the open of each candlestick bar to more accurately portray the chart candlesticks.


🔹 Divergence

  • Show on Chart: Choose to display divergence line on the chart as well as on the Oscillator.
  • Divergence Length: Sets the pivot width for divergence detection. Normal Fractal Pivot Detection is used.
  • Divergence Style: Change color and line style for Regular and Hidden divergences, as well as toggle their display.
  • Divergence Filter: As described above, toggle on or off divergence filtering.


🔹 RSI Channel

  • Toggle: Display RSI Channel on Chart.
  • Color: Change RSI Channel Color

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.