Indicator · Pine Script v4 · On the chart

Smoothed Heikin Ashi Signals

by shyrwinsia

This indicator calculates smoothed Heikin Ashi and typical price series to identify trend direction and generate directional signals.

View on GitHub

GitHub stars5on the repository
Pine versionv4older, still runs
Lines of code43
Settings1inputs
LicenceMIT
Last update5 years ago20 Apr 2021

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 v4 from Smooth Heikin Ashi Oscillator.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Smooth Heikin Ashi Oscillator.pine
//@version=4

study("Smoothed Heikin Ashi Signals", shorttitle="SHAS", overlay=true)
EMAlength=input(5, "Length")

src = ohlc4
haOpen = 0.0
haOpen := (src + nz(haOpen[1])) / 2
haC = (ohlc4 + nz(haOpen) + max(high, nz(haOpen)) + min(low, nz(haOpen))) / 4
EMA1 = ema(haC, EMAlength)
EMA2 = ema(EMA1, EMAlength)
EMA3 = ema(EMA2, EMAlength)
TMA1 = 3 * EMA1 - 3 * EMA2 + EMA3
EMA4 = ema(TMA1, EMAlength)
EMA5 = ema(EMA4, EMAlength)
EMA6 = ema(EMA5, EMAlength)
TMA2 = 3 * EMA4 - 3 * EMA5 + EMA6
IPEK = TMA1 - TMA2
YASIN = TMA1 + IPEK
EMA7 = ema(hlc3, EMAlength)
EMA8 = ema(EMA7, EMAlength)
EMA9 = ema(EMA8, EMAlength)
TMA3 = 3 * EMA7 - 3 * EMA8 + EMA9
EMA10 = ema(TMA3, EMAlength)
EMA11 = ema(EMA10, EMAlength)
EMA12 = ema(EMA11, EMAlength)
TMA4 = 3 * EMA10 - 3 * EMA11 + EMA12
IPEK1 = TMA3 - TMA4
YASIN1 = TMA3 + IPEK1

mavi = YASIN1
kirmizi = YASIN

longCond=mavi>kirmizi and mavi[1]<=kirmizi[1]
shortCond=mavi<kirmizi and mavi[1]>=kirmizi[1]

trendState = kirmizi < mavi ? true : kirmizi > mavi ? false : na
last_signal = 0
long_final = longCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)
short_final = shortCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)

plotshape(long_final, style=shape.triangleup, location=location.belowbar, color=color.teal, size=size.tiny)
plotshape(short_final, style=shape.triangledown, location=location.abovebar, color=color.orange, size=size.tiny)

Overview

Smoothed Heikin Ashi Signals derives synthetic Heikin Ashi values and applies multi-layered exponential and triple exponential moving average smoothing filters to both price streams. Signals are triggered when the smoothed price crosses above or below the smoothed Heikin Ashi line, filtered to ensure alternating signals. Triangle markers plot directly on the price chart to indicate long and short conditions. A single input controls the smoothing length.

Details

Published by

shyrwinsia on GitHub

Type

Indicator, Pine Script v4

Draws

On the price chart

Category

Trend, Moving averages

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.

Settings

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

SettingTypeDefaultVariable
Lengthint5EMAlength
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

948 stars

The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec

Indicator v4 TrendMoving averages
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
330 stars

This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab

Indicator v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of 3 EMA/SMA + Cross [Alorse]
318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages

NVDA Trend Ribbon

by longsurf-ai
277 stars

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre

Indicator v6 TrendMoving averages
Updated yesterday · MIT GitHub repository of NVDA Trend Ribbon
257 stars

Donald SPX - Options Trading is an overlay indicator designed for intraday SPX analysis. It plots a 200-period Weighted Moving Average (WMA) on the price chart while evaluating multi-timeframe market structure across Daily, 15-minute, 5-minute, and 2-minute ba

Indicator v5 Moving averagesTrend Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald SPX - Options Trading

60K均線

by TaichiS
219 stars

This multi-timeframe indicator calculates and plots 20-period and 60-period simple moving averages from the 60-minute timeframe directly onto the price chart. The 20-period average displays as a green line, while the 60-period average appears in blue. It serve

Indicator v4 Moving averagesTrend Repaints
Updated 5 years ago · None stated GitHub repository of 60K均線

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers