pableitor

Higher time frame Heikin Ashi candles on a lower time frame chart

Category: Indicators By: pableitor Created: November 11, 2018, 1:26 PM
November 11, 2018, 1:26 PM
Indicators
15 Comments
Higher time frame Heikin Ashi candles on a lower time frame chart

This indicator is based on an idea of Nicolas (= heikin ashi of higher TF ), with the difference that the Heikin Ashi candles of a higher time-frame are now superimposed on the price window of a given TF. Heikin Ashi candles are wonderful to filter the noise in the quotes and allow to see more clearly the underlying trend.The period of the upper TF candles are set in minutes (1 Hour 60, 4 hours 240, one day 1440 etc.)The HA candle is drawn as a rectangle and inside the rectangle we can see next to the price bars other small bars that show us how the HA candle of the TF has evolved over time.

//Higher TF HA candles by pableitor 2018

// --- settings
// TimeframeHAminutes = 60 //higher TF minutes
// --- end of settings

defparam calculateonlastbars=3000 //increase this number to get more history
 
opd= openday

if (openhour = 0) then
 opd = openday + 1
endif

once hightf = 0
once lowtf = close * 100
once ha=0

Myminutes = opd*1440 + openhour*60 + openminute  //total minutes since beginning of chart

if (myminutes MOD TimeframeHAminutes < myminutes[1] MOD TimeframeHAminutes ) then //new HA candle
 opentf = open
 hightf = 0 //fake high
 lowtf = close * 100 //fake low
 haopen =( haopen[1]+haclose[1])/2
 hastart = barindex // position of new candle

 x1=hastart[1]
 x2=barindex[1]
 y1=haopen[1]
 y2=haclose[1]

 DRAWSEGMENT(x1,y1,x2,y1)coloured(r,g,0)
 DRAWSEGMENT(x1,y1,x1,y2)coloured(r,g,0)
 DRAWSEGMENT(x1,y2,x2,y2)coloured(r,g,0)
 DRAWSEGMENT(x2,y1,x2,y2)coloured(r,g,0)

 ha=1 // flag for first HA candle

endif
hightf = max(hightf,high)
lowtf= min(lowtf,low)
if ha = 0 then
 opentf = open //fake value when theres no HA candles
endif
if ha=0 then
 haopen = open
endif

haclose=(opentf+close+lowtf+hightf)/4

r=0
g=200
if haclose<haopen then
 r=200
 g=0
endif

DRAWCANDLE(haopen,haopen,haclose,haclose) COLOURED(R,G,0,40) BORDERCOLOR(R,G,0,40)

return

 

Download
Filename: Higher-TF-HA-MINUTES-v2.itf
Downloads: 517
pableitor
pableitor Master
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

Victor.Strand
2 years ago
#

Thanks Nicolas, I didnt know there was a multitimeframe support now... I will check it. This code was splendid although I have never been able to plot the close as a straight line. Can you suggest an indicator like this in the new PRT version, please? thx vm

Nicolas
2 years ago
#

to return a value of a Close of timeframe 1-hour, for instance : TIMEFRAME(1 hour) c = close return c

Victor.Strand
2 years ago
#

Hi Pableitor, Nicolas, I was wondering if you could help me with one doubt I have on this higher timeframe HA, its a bit difficult to explain but if you paste it in the code and see the chart you will probably understand . If you plot , after return, " haopen as "haopen", y2 as "y2" " you can get plain multitimeframe (MTF) values of HAopen and haclose (this one 1 period ago = haclose[1]). I cant understand why if one writes "haclose[1]" instead of "y2" the chart is different, but the question is, how can one get the haclose[0] in a chart but being a straight line for the period selected as MTF, like haopen and y2 before? Thanks/Merci

Nicolas
2 years ago
#

Thanks for create a specific thread in the forum in order to handle your coding query. I see that this code was made before the official multi timeframe support of the language, so it is much easier to code such higher timeframe candlesticks now.

Guibourse
5 years ago
#

Hi, I don't know why but I cannot add the 1 minute Heikin candles on a 100 ticks TF (but the 2 minutes or more works)

pableitor
5 years ago
#

Hi, this indicator was programmed for PRT 10.3 , I had to do the high TF detection by software which was difficult specially for the lower TF (seconds or ticks). The new timeframe instructions are easier to work with. Will update it ASAP to PRT 11

cv
cv
7 years ago
#

Hi All, I am not very knowledgeable with coding. I have tried to add this indicator and get the following message - Syntax error: The following variable is undefined: timeframehaminutes. I would really appreciate it if someone could tell me what I need to do to fix this. Thank you Corinne

Nicolas
7 years ago
#

Download the .itf file and import it into the platform, you'll get all the necessary settings that way.

Jean-Claude REGIS
7 years ago
#

Merci Nicolas de la rep oui bien sur que le prix a une position identique le but est d'avoir tout sur un seul graph (plus hauts + bas par unité de temps )

Jean-Claude REGIS
7 years ago
#

Il doit être possible tout simplement d'emprisonner les bougies dans des rectangles (+haut +bas et UT) d'unité de temps supérieures je ne saurais pas le coder donc ..... ex sur graph 5M rectangles pour les UT 15M H1 D1 d'un seul coup d'oeil cela permettrait de visualiser l'amplitude et la position du prix sur chaque UT ainsi que la tendance de fond et celle du moment cordialement

Nicolas
7 years ago
#

oui c'est possible. Cependant la position du prix,c'est la même sur chaque UT ;)

rollem
8 years ago
#

Thank you very much sir!

rollem
8 years ago
#

Thank you! Could you replicate this indicator using regular candlesticks instead of Heikin Ashi? I would appreciate it if you could!

pableitor
8 years ago
#

Done ! Pls check this https://www.prorealcode.com/prorealtime-indicators/higher-time-frame-candlestick-on-a-lower-time-frame-chart/

Matriciel
8 years ago
#

Well done, good job ! ;)

ProRealCode ProRealCode
Loading...