gidien

Heikin Ashi Advanced

Category: Indicators By: gidien Created: January 15, 2024, 1:47 PM
January 15, 2024, 1:47 PM
Indicators
4 Comments
Heikin Ashi Advanced

This is my first indicator with prorealcode for learning the language.

It is a smoothed Heikin-Ashi with possibility to hide Heikin-Ashi and only color the “normal” candles.

// ############# Heikin-Ashi Advanced ##################################################
// Written by GSL


bo = Average[MAX(1,sma1),AverrageType1](Open)
bh = Average[MAX(1,sma1),AverrageType1](high)
bl = Average[MAX(1,sma1),AverrageType1](low)
bc = Average[MAX(1,sma1),AverrageType1](close)


IF BarIndex <= sma1 + 1 THEN
haOpen =  bo
haClose = bc
haHigh = bh
haLow  = bl
//PRINT(haClose)
ELSe
haOpen = (haOpen[1] + haClose[1]) / 2
haClose = (bo + bc + bl  + bh ) / 4
haHigh = MAX( MAX(bh , haOpen), haClose  )
haLow  = MIN( MIN(bl  , haOpen), haClose  )
ao = Average[MAX(1,sma2),AverrageType2](haOpen)
ah = Average[MAX(1,sma2),AverrageType2](haHigh)
al = Average[MAX(1,sma2),AverrageType2](haLow)
ac = Average[MAX(1,sma2),AverrageType2](haClose )


ENDIF

if hidden THEN
IF ao < ac THEN
DRAWCANDLE(open, high, low, close) COLOURED(0,55,30)
ELSIF ao > ac THEN
DRAWCANDLE(open, high, low, close) COLOURED(55,15,0)
ELSE
DRAWCANDLE(open, high, low, close)
ENDIF

ELSE
IF ao < ac THEN
DRAWCANDLE(ao, ah, al, ac)
ELSIF ao > ac THEN
DRAWCANDLE(ao, ah, al, ac)
ELSE
DRAWCANDLE(ao, ah, al, ac)
ENDIF
ENDIF
RETURN

Download
Filename: Heikin-Ashi-Advanced.itf
Downloads: 386
Download
Filename: haadvhide-17049895554pc8l.png
Downloads: 112
gidien
gidien New
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

Cram13
3 years ago
#

Bonjour, qu'elles sont les valeurs des variables ? Avec mes remerciements Marc

gidien
3 years ago
#

SMA1 = MovingAverage Length applied to the source candles (high , low, open, close) AverrageType1 = Type of the first Average (simple , expo .....) SMA2 = MovingAverage Length applied to the heikin ashi candles (hahigh , halow, haopen, haclose) AverrageType2 = Type of the second Average (simple , expo .....) hidden = If enabled you will only see the original candle , but with the color of the underlying heikin ashi candle. If disable you will see the original candle and the heikin ashi candle. SMA1 = 1 AND SMA2 = 1 is same the same as the normal Heikin Ashi Candles

MICH
3 years ago
#

Caro Gidien How can I set up a trading system to test this indicator?

gidien
3 years ago
#

This indicator will not return any value. You can change the last line to : return ao AS "HA Open", ac AS "HA Close, al AS "HA Low" , ah AS "HA High" After that you can call this indicator in your code and use his values.

ProRealCode ProRealCode
Loading...