OPEN-SOURCE SCRIPT

HARSI Fisher Transform & Divergence

896
# HARSI Fisher Transform & Divergence — Publication Description

## Description
This indicator runs a Heikin-Ashi RSI (HARSI) based oscillator through a
single-pole Fisher Transform filter to produce a cleaner, lower-lag turning/
momentum line. HARSI candles are plotted on the same visual scale as the
Fisher line (auto-scaled to volatility), so you can read both the raw HARSI
candles and the smoothed Fisher line in a single pane.

The indicator includes two independent divergence engines — one running on
the Fisher line, the other on the raw HARSI candles. Both engines compare
against real price highs/lows to detect regular (reversal) and hidden
(continuation) bullish/bearish divergence, with an optional maximum
pivot-distance filter and a separate alert condition for every signal type.

## Source Code & Credits
- **HARSI (Heikin-Ashi RSI) calculation** (`f_zrsi`, `f_rsiHeikinAshi`
functions): based on **JayRogers'** open-source **"Heikin Ashi RSI
Oscillator"** (Pine v4) script, ported to Pine v6 for this indicator. See
the original author's TradingView profile for the source script.
- **Fisher Transform concept**: developed by John Ehlers and considered
public domain; this script contains its own continuous, single-pole
implementation of the technique.

## Original Contributions Added In This Version
Beyond the underlying HARSI calculation, the following parts are original
to this script and constitute a significant improvement:
- A continuous single-pole Fisher Transform layer applied to HARSI HL2
- A dual divergence engine running **separately** on the Fisher line and on
the HARSI candle (regular + hidden, bullish + bearish — 8 signal types
total)
- An optional maximum pivot-distance filter to discard stale pivot pairs
and reduce false signals
- Auto-scaling of the HARSI candle body to share the Fisher line's pane
(a `ta.stdev`-based ratio, floored/capped against sudden spikes)
- A dedicated `alertcondition` for every signal type
- Pine v4 → v6 port and general code cleanup

These additions go beyond a minor style or naming change to the HARSI base —
they add an independent layer that extends the indicator's function and
purpose.

## Open-Source Note
This script is **open-source**; because it builds on JayRogers' original
open-source HARSI logic, it is published as open-source rather than
protected/invite-only.

## How to Use
Settings are organized into four groups: HARSI candle settings, Fisher
Transform settings, divergence settings, and display settings. Defaults are
suitable for general use; the pivot left/right bar counts and maximum pivot
distance can be adjusted to tune signal frequency and lag.

*This indicator is for educational and analytical purposes only and does
not constitute investment advice.*

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.