OPEN-SOURCE SCRIPT
Heikin Flow

Heikin Flow
by Ben Deharde, 2025
Overview
Heikin Flow is a trend and momentum oscillator built on a smoothed reverse-Heikin-Ashi baseline. It quantifies the distance between price and this baseline, then colors the histogram to reflect both direction and acceleration/deceleration. Use it standalone to read trend energy and shifts, or pair it with Heikin Rider for momentum-aware breakout confirmation.
What It Does
Computes a reverse-HA baseline and optionally smooths it with a selectable MA.
Plots a histogram of distance (price minus baseline) to visualize directional pressure.
Colors the histogram by trend state (above/below baseline) and momentum (accelerating vs. decelerating).
Provides alerts on zero-line crosses to spotlight potential momentum regime changes.
The histogram also helps to spot divergence between price and momentum (e.g., price making new highs while the histogram weakens).
How It Works
Reverse-HA Baseline
Heikin Flow derives a “reverse close” value from Heikin Ashi context (using prior HA open/close with current bar range) to capture underlying pressure. This value is range-bounded to avoid extremes, then optionally smoothed. The resulting line acts as a soft directional baseline.
Smoothing (Noise Control)
Choose SMA/EMA/HMA/VWMA/RMA and a length to control baseline responsiveness. Shorter lengths react faster, longer lengths emphasize trend consistency by filtering noise—useful when pairing with breakout tools like Rider.
Trend & Momentum Logic
Trend: If price is above the baseline, the environment is considered uptrend; below indicates downtrend.
Momentum: The change in distance bar-to-bar distinguishes acceleration (growing distance) from deceleration (shrinking distance).
This dual readout helps you see not just direction, but the quality of that direction—strong push vs. weakening move.
Coloring (Aligned with Heikin Rider Palette)
Deep Blue: Uptrend & accelerating
Light Blue: Uptrend & decelerating
Deep Red: Downtrend & accelerating
Soft Orange: Downtrend & decelerating
This mirrors the palette logic from Heikin Rider for immediate visual consistency across the suite.
How to use
Read the histogram above/below zero (price–baseline) as directional bias; watch color changes for momentum context.
Use zero-line crosses as momentum regime shifts; confirm with price action or Heikin Rider breakout signals.
Watch for divergence between price action and the histogram as an early clue of weakening moves.
Adjust smoothing method/length to fit your market and timeframe—faster for scalping, slower to highlight sustained trends.
Inputs
Smoothing Type & Length for the baseline (SMA/EMA/HMA/VWMA/RMA)
Info Box toggles (display and formatting)
Live Mode option for real-time vs. confirmed-bar behavior (avoids inadvertent lookahead)
Originality
Heikin Flow adapts the HA-driven methodology to an oscillator that focuses on distance-to-baseline and momentum quality, using a reverse-HA construction and flexible MA smoothing—complementing Heikin Rider’s smoothed HA envelope breakout design for a cohesive, momentum-aware workflow.
Alerts
Bullish Heikin Flow Cross — distance crosses above 0 (on bar close)
Bearish Heikin Flow Cross — distance crosses below 0 (on bar close)
by Ben Deharde, 2025
Overview
Heikin Flow is a trend and momentum oscillator built on a smoothed reverse-Heikin-Ashi baseline. It quantifies the distance between price and this baseline, then colors the histogram to reflect both direction and acceleration/deceleration. Use it standalone to read trend energy and shifts, or pair it with Heikin Rider for momentum-aware breakout confirmation.
What It Does
Computes a reverse-HA baseline and optionally smooths it with a selectable MA.
Plots a histogram of distance (price minus baseline) to visualize directional pressure.
Colors the histogram by trend state (above/below baseline) and momentum (accelerating vs. decelerating).
Provides alerts on zero-line crosses to spotlight potential momentum regime changes.
The histogram also helps to spot divergence between price and momentum (e.g., price making new highs while the histogram weakens).
How It Works
Reverse-HA Baseline
Heikin Flow derives a “reverse close” value from Heikin Ashi context (using prior HA open/close with current bar range) to capture underlying pressure. This value is range-bounded to avoid extremes, then optionally smoothed. The resulting line acts as a soft directional baseline.
Smoothing (Noise Control)
Choose SMA/EMA/HMA/VWMA/RMA and a length to control baseline responsiveness. Shorter lengths react faster, longer lengths emphasize trend consistency by filtering noise—useful when pairing with breakout tools like Rider.
Trend & Momentum Logic
Trend: If price is above the baseline, the environment is considered uptrend; below indicates downtrend.
Momentum: The change in distance bar-to-bar distinguishes acceleration (growing distance) from deceleration (shrinking distance).
This dual readout helps you see not just direction, but the quality of that direction—strong push vs. weakening move.
Coloring (Aligned with Heikin Rider Palette)
Deep Blue: Uptrend & accelerating
Light Blue: Uptrend & decelerating
Deep Red: Downtrend & accelerating
Soft Orange: Downtrend & decelerating
This mirrors the palette logic from Heikin Rider for immediate visual consistency across the suite.
How to use
Read the histogram above/below zero (price–baseline) as directional bias; watch color changes for momentum context.
Use zero-line crosses as momentum regime shifts; confirm with price action or Heikin Rider breakout signals.
Watch for divergence between price action and the histogram as an early clue of weakening moves.
Adjust smoothing method/length to fit your market and timeframe—faster for scalping, slower to highlight sustained trends.
Inputs
Smoothing Type & Length for the baseline (SMA/EMA/HMA/VWMA/RMA)
Info Box toggles (display and formatting)
Live Mode option for real-time vs. confirmed-bar behavior (avoids inadvertent lookahead)
Originality
Heikin Flow adapts the HA-driven methodology to an oscillator that focuses on distance-to-baseline and momentum quality, using a reverse-HA construction and flexible MA smoothing—complementing Heikin Rider’s smoothed HA envelope breakout design for a cohesive, momentum-aware workflow.
Alerts
Bullish Heikin Flow Cross — distance crosses above 0 (on bar close)
Bearish Heikin Flow Cross — distance crosses below 0 (on bar close)
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.