OPEN-SOURCE SCRIPT

Timeframe Heikin Ashi RSI Oscillator

935
T-HARSI • Timeframe Heikin Ashi RSI Oscillator (HTF Edition)

What it is

An RSI-based oscillator that renders RSI values as Heikin Ashi candles instead of a line, with a full higher-timeframe (HTF) signal engine layered on top. The core idea — originally from JayRogers — is that translating RSI into HA-style OHLC preserves the oscillating nature of RSI while smoothing out noise and making trend/exhaustion visually obvious. The gggoaaat mods add a multi-condition overbought/oversold signal system that runs entirely on a user-selectable HTF.

How it's built

Everything is zero-median: RSI values have 50 subtracted so the oscillator swings around 0 instead of 50, with configurable OB/OS and "extreme" OB/OS bands above and below. Three core pieces generate the visuals:

  1. HARSI candles — RSI is computed separately on close, high, and low, then combined into synthetic OHLC using Heikin Ashi math. Open smoothing biases toward the prior open for cleaner trend reads.
  2. RSI overlay line + histogram — a second RSI (independent length) plotted on top, optionally smoothed using a recursive HA-style average of current vs prior RSI.
  3. Stochastic RSI ribbon — stoch computed from that RSI, with K/D smoothing and a vertical scaling knob so it doesn't distort the channel.


The HTF signal engine

All stateful logic lives inside f_signalLogic() and is pulled through a single request.security call, so every counter, ta.barssince, and crossover naturally operates on HTF bars. The engine produces two composite signals:

  1. bullishWays (overbought / fade-long / 🔥OB label) fires when RSI has been above the extreme upper band for N consecutive HTF bars and a confirming reversal condition hits within a hold window — either a crossover-based resistance touch or a reversal-candle pattern where the HARSI close flips bearish near the extreme.
  2. bearishWays (oversold / fade-short / 🥶OS label) is the symmetric opposite at the lower extreme.


A barsBetweenCalls cooldown prevents back-to-back repeats, and an htfBarEdge gate (ta.change(time(tf))) ensures plotshapes, circle-dot plots, and alerts fire exactly once per HTF bar transition rather than repeating across every chart bar that falls inside the same HTF window.

What you see on the chart

HARSI candles in the pane, OB/OS channel bands with tinted fills, optional RSI line and stoch ribbon, background shading when RSI is sustained beyond an extreme, warning triangles when the sustained-extreme threshold first trips, and 🔥OB / 🥶OS labels with orange/teal price dots on the main chart when a full composite signal fires. Alerts fire on confirmed HTF bar close for both directions.

Intended use

A mean-reversion / exhaustion tool — the signals flag spots where an HTF RSI has pushed to an extreme, held there, and then showed a reversal confirmation. Best paired with trend context on the main chart; the HARSI pane tells you when the stretch is exhausted, not which direction the trend actually is.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.