OPEN-SOURCE SCRIPT
HARSI PRO v2 - Advanced Adaptive Heikin-Ashi RSI Oscillator

This script is a fully re-engineered and enhanced version of the original Heikin-Ashi RSI Oscillator created by JayRogers. While it preserves the foundational concept and visual structure of the original indicatorusing Heikin-Ashi-style candles to represent RSI movementit introduces a range of institutional-grade engines and real-time analytics modules.
The core idea behind HARSI is to visualize the internal structure of RSI behavior using candle representations. This gives traders a clearer sense of trend continuity, exhaustion, and momentum inflection. In this upgraded version, the system is extended far beyond basic visualization into a comprehensive diagnostic and context-tracking tool.
Core Enhancements and Features
1. Heikin-Ashi RSI Candles
The base HARSI logic transforms RSI values into open, high, low, and close components, which are plotted as Heikin-Ashi-style candles. The open values are smoothed with a user-controlled bias setting, and the high/low are calculated from zero-centered RSI values.
2. Smoothed RSI Histogram and Plot
A secondary RSI plot and histogram are available for traditional RSI interpretation, optionally smoothed using a custom midpoint EMA process.
3. Dynamic Stochastic RSI Ribbon
The indicator optionally includes a smoothed Stochastic RSI ribbon with directional fill to highlight acceleration and reversal zones.
4. Real-Time Meta-State Engine
This engine determines the current market environmentneutral, breakout, or reversalbased on multiple adaptive conditions including volatility compression, momentum thrust, volume behavior, and composite reversal scoring.
5. Adaptive Overbought/Oversold Zone Engine
Instead of using fixed RSI thresholds, this engine dynamically adjusts OB/OS boundaries based on recent RSI range and normalized price volatility. This makes the OB/OS levels context-sensitive and more accurate across different instruments and regimes.
6. Composite Reversal Score Engine
A real-time score between 0 and 5 is generated using four components:
* OB/OS proximity (zone score)
* RSI slope behavior
* Volume state (burst or exhaustion)
* Trend continuation penalty based on position versus trend bias
This score allows for objective filtering of reversal zones and breakout traps.
7. Kalman Velocity Filter
A Kalman-style adaptive smoothing filter is applied to RSI for calculating velocity and acceleration. This allows for real-time detection of stalls and thrusts in RSI behavior.
8. Predictive Breakout Estimator
Uses ATR compression and RSI thrusting conditions to detect likely breakout environments. This logic contributes to the Meta-State Engine and the Breakout Risk dashboard metric.
9. Volume Acceleration Model
Real-time detection of volume bursts and fades based on VWMA baselines. Volume exhaustion warnings are used to qualify or disqualify reversals and breakouts.
10. Trend Bias and Regime Detection
Uses RSI slope, HARSI body impulse, and normalized ATR to classify the current trend state and directional bias. This forms the basis for filtering false reversals during strong trends.
11. Dashboard with Tooltips
A clean, table displays six key metrics in real time:
* Meta State
* Reversal Score
* Trend Bias
* Volume State
* Volatility Regime
* Breakout Risk
Each cell includes a descriptive tooltip explaining why the value is being shown based on internal state calculations.
How It Works Internally
* The system calculates a zero-centered RSI and builds candle structures using high, low, and smoothed open/close values.
* Volatility normalization is used throughout the script, including ATR-based thresholds and dynamic scaling of OB/OS zones.
* Momentum is filtered through smoothed slope calculations and HARSI body size measurements.
* Volume activity is compared against VWMA using configurable multipliers to detect institutional-level activity or exhaustion.
* Each regime detection module contributes to a centralized metaState classifier that determines whether the environment is conducive to reversal, breakout, or neutral action.
* All major signal and context values are continuously updated in a dashboard table with logic-driven color coding and tooltips.
Based On and Credits
This script is based on the original Heikin-Ashi RSI Oscillator by JayRogers. All visual elements from the original version, including candle plotting and color configurations, have been retained and extended. Significant backend enhancements were added by AresIQ for the 2025 release. The script remains open-source under the original attribution license. Credit to JayRogers is preserved and required for any derivative versions.
The core idea behind HARSI is to visualize the internal structure of RSI behavior using candle representations. This gives traders a clearer sense of trend continuity, exhaustion, and momentum inflection. In this upgraded version, the system is extended far beyond basic visualization into a comprehensive diagnostic and context-tracking tool.
Core Enhancements and Features
1. Heikin-Ashi RSI Candles
The base HARSI logic transforms RSI values into open, high, low, and close components, which are plotted as Heikin-Ashi-style candles. The open values are smoothed with a user-controlled bias setting, and the high/low are calculated from zero-centered RSI values.
2. Smoothed RSI Histogram and Plot
A secondary RSI plot and histogram are available for traditional RSI interpretation, optionally smoothed using a custom midpoint EMA process.
3. Dynamic Stochastic RSI Ribbon
The indicator optionally includes a smoothed Stochastic RSI ribbon with directional fill to highlight acceleration and reversal zones.
4. Real-Time Meta-State Engine
This engine determines the current market environmentneutral, breakout, or reversalbased on multiple adaptive conditions including volatility compression, momentum thrust, volume behavior, and composite reversal scoring.
5. Adaptive Overbought/Oversold Zone Engine
Instead of using fixed RSI thresholds, this engine dynamically adjusts OB/OS boundaries based on recent RSI range and normalized price volatility. This makes the OB/OS levels context-sensitive and more accurate across different instruments and regimes.
6. Composite Reversal Score Engine
A real-time score between 0 and 5 is generated using four components:
* OB/OS proximity (zone score)
* RSI slope behavior
* Volume state (burst or exhaustion)
* Trend continuation penalty based on position versus trend bias
This score allows for objective filtering of reversal zones and breakout traps.
7. Kalman Velocity Filter
A Kalman-style adaptive smoothing filter is applied to RSI for calculating velocity and acceleration. This allows for real-time detection of stalls and thrusts in RSI behavior.
8. Predictive Breakout Estimator
Uses ATR compression and RSI thrusting conditions to detect likely breakout environments. This logic contributes to the Meta-State Engine and the Breakout Risk dashboard metric.
9. Volume Acceleration Model
Real-time detection of volume bursts and fades based on VWMA baselines. Volume exhaustion warnings are used to qualify or disqualify reversals and breakouts.
10. Trend Bias and Regime Detection
Uses RSI slope, HARSI body impulse, and normalized ATR to classify the current trend state and directional bias. This forms the basis for filtering false reversals during strong trends.
11. Dashboard with Tooltips
A clean, table displays six key metrics in real time:
* Meta State
* Reversal Score
* Trend Bias
* Volume State
* Volatility Regime
* Breakout Risk
Each cell includes a descriptive tooltip explaining why the value is being shown based on internal state calculations.
How It Works Internally
* The system calculates a zero-centered RSI and builds candle structures using high, low, and smoothed open/close values.
* Volatility normalization is used throughout the script, including ATR-based thresholds and dynamic scaling of OB/OS zones.
* Momentum is filtered through smoothed slope calculations and HARSI body size measurements.
* Volume activity is compared against VWMA using configurable multipliers to detect institutional-level activity or exhaustion.
* Each regime detection module contributes to a centralized metaState classifier that determines whether the environment is conducive to reversal, breakout, or neutral action.
* All major signal and context values are continuously updated in a dashboard table with logic-driven color coding and tooltips.
Based On and Credits
This script is based on the original Heikin-Ashi RSI Oscillator by JayRogers. All visual elements from the original version, including candle plotting and color configurations, have been retained and extended. Significant backend enhancements were added by AresIQ for the 2025 release. The script remains open-source under the original attribution license. Credit to JayRogers is preserved and required for any derivative versions.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.