Indicator · Pine Script v6 · On the chart

Smoothed Heiken Ashi Candles

by theonetrade

This indicator calculates Heikin-Ashi candles using EMA-smoothed open, high, low, and close prices, then applies a second EMA smoothing step to the calculated Heikin-Ashi values.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code43
Settings2inputs
LicenceMIT
Last update2 weeks ago7 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

43 lines of Pine Script v6 from assets/smoothed-heiken-ashi-chainsaffron-double-ema-noise-filter-with-trend-alerts.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

smoothed-heiken-ashi-chainsaffron-double-ema-noise-filter-with-trend-alerts.pine
//@version=6
indicator(title="Smoothed Heiken Ashi Candles", shorttitle="Smoothed HA Candles", overlay=true)

// Inputs
len  = input.int(10, title="EMA Length 1")
len2 = input.int(10, title="EMA Length 2")

// First smoothing (EMA on OHLC)
o = ta.ema(open, len)
c = ta.ema(close, len)
h = ta.ema(high, len)
l = ta.ema(low, len)

// Heikin Ashi calculations
haclose = (o + h + l + c) / 4

var float haopen = na
haopen := na(haopen[1]) ? (o + c) / 2 : (haopen[1] + haclose[1]) / 2

hahigh = math.max(h, math.max(haopen, haclose))
halow  = math.min(l, math.min(haopen, haclose))

// Second smoothing (EMA on HA values)
o2 = ta.ema(haopen, len2)
c2 = ta.ema(haclose, len2)
h2 = ta.ema(hahigh, len2)
l2 = ta.ema(halow, len2)

// Candle direction
bullish = c2 > o2
bearish = c2 < o2

col = bullish ? color.lime : color.red

// Plot candles
plotcandle(o2, h2, l2, c2, title="Smoothed Heiken Ashi", color=col)

// Alerts
bullishSignal = bullish and not bullish[1]
bearishSignal = bearish and not bearish[1]

alertcondition(bullishSignal, title="Bullish Signal", message="Smoothed HA turned Bullish")
alertcondition(bearishSignal, title="Bearish Signal", message="Smoothed HA turned Bearish")

Overview

Smoothed Heiken Ashi Candles plots these double-smoothed candles on the main price chart, displaying green candles when the smoothed close exceeds the smoothed open and red candles during bearish states. Input settings allow customization of both EMA lengths. Alert conditions trigger when the candle color flips, signaling potential trend reversals.

Details

Published by

theonetrade on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algorithmic-tradingbacktestingccxtcryptofair-value-gapheikin-ashiohlcvorder-flowpine-scriptpinescriptpynecorepythonquantitative-financesupertrendtechnical-analysistrading-indicatorstradingviewtradingview-indicatorsvolume-profile

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
EMA Length 1int10len
EMA Length 2int10len2
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

55 stars

This indicator overlays on the price chart and provides trend and momentum analysis. It calculates and plots three exponential moving averages with fixed periods of 20, 50, and 200 using yellow, orange, and blue colors respectively. The script also computes th

Indicator v6 TrendOscillators & momentum
Updated 7 months ago · Apache-2.0 GitHub repository of Trend & Momentum Analysis

Hanging Man - Bearish

by TWODS-CAPITAL
37 stars

This overlay indicator marks a bearish hanging man candlestick on the price chart. It looks for a small real body sitting in the upper part of the range, a lower shadow at least twice the body, and no upper shadow, and only while an uptrend filter is active. T

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Hanging Man - Bearish

Bjorgum SuperScript

by theonetrade
34 stars

Bjorgum SuperScript is a multi-indicator suite that plots visual trade signals, moving averages, and custom candle overlays directly on the main price chart. It combines elements such as Tilson T3 moving averages, HEMA, Parabolic SAR, Trend Momentum (TRM), and

Indicator v5 TrendMoving averages
Updated 2 weeks ago · MIT GitHub repository of Bjorgum SuperScript
29 stars

MWM EMA x VWAP Engulfing is an intraday indicator that plots an exponential moving average against session VWAP to evaluate buyer and seller control. It identifies up to five entry setups confirmed by engulfing bodies, rejection wicks, momentum bars, or band t

Indicator v6 Moving averagesCandlestick patterns
Updated 6 weeks ago · MIT GitHub repository of MWM EMA x VWAP Engulfing
29 stars

Zen EMA Pullback Patterns identifies pullback formations relative to an Exponential Moving Average on the price chart. It detects 3-bar pullbacks consisting of three consecutive bearish bars above the EMA or bullish bars below it, as well as 4-bar micro channe

Indicator v6 Moving averagesCandlestick patterns
Updated 5 weeks ago · MIT GitHub repository of Zen EMA Pullback Patterns

More Candlestick patterns scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers