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.
//@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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
EMA Length 1
int
10
len
EMA Length 2
int
10
len2
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.
This indicator identifies candlestick patterns on the price chart by combining price action with momentum factors and trend filters. It calculates one of four selectable oscillators: Karobein Oscillator, Money Flow Index, RSI, or Stochastic, alongside trend ru
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
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
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
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
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