HPT Heikin Ashi Smoothed

Category: Indicators By: Nicolas Created: April 25, 2017, 9:35 AM
April 25, 2017, 9:35 AM
Indicators
39 Comments

This trend following indicator is another attempt to filter the noise of the price by using Heikin Ashi candlesticks construction. This one double smoothed the price information by using 2 set of moving average. Of course, it is lagging but it has the capabilities to reduce considerably the market noises. It can also be used to find turning point of the market or a good way to jump into a trend. Someone ask me recently to convert it to prorealtime, so here it is.

The indicator embed 2 external variables (“long” and “short”) that can be used to be imported into trading strategies to launch BUY or SELL orders on market.

 

 

//PRC_HPT Heikin Ashi Smoothed | indicator
//25.04.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from MT4 indicator code

//---settings
//MaPeriod=6
//MaPeriod2=2
//---end of settings

once maOpen=Open
once maClose=Close
once maLow=Low
once maHigh=High

if barindex>0 then
 maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod
 maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod
 maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod
 maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod

 haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2
 haClose=(maOpen+maHigh+maLow+maClose)/4
 haHigh=Max(maHigh, Max(haOpen, haClose))
 haLow=Min(maLow, Min(haOpen, haClose))
 if (haOpen<haClose) then
  r=0
  g=191
  b=255
  ExtMapBuffer7=haLow
  ExtMapBuffer8=haHigh
 else
  r=255
  g=10
  b=0
  ExtMapBuffer7=haHigh
  ExtMapBuffer8=haLow
 endif
 ExtMapBuffer5=haOpen
 ExtMapBuffer6=haClose

 ExtMapBuffer1=weightedaverage[MAperiod2](ExtMapBuffer7)
 ExtMapBuffer2=weightedaverage[MAperiod2](ExtMapBuffer8)
 ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)
 ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)
endif
 DRAWCANDLE(ExtMapBuffer3,ExtMapBuffer2,ExtMapBuffer1,ExtMapBuffer4) coloured(r,g,b)

short = ExtMapBuffer7[1]>ExtMapBuffer8[1] and ExtMapBuffer7[2]<ExtMapBuffer8[2] and ExtMapBuffer7[0]>ExtMapBuffer8[0]
long = ExtMapBuffer7[1]<ExtMapBuffer8[1] and ExtMapBuffer7[2]>ExtMapBuffer8[2] and ExtMapBuffer7[0]<ExtMapBuffer8[0]

RETURN long as "long signal", short as "short signal"

 

Download
Filename: PRC_HPT-Heikin-Ashi-Smoothed.itf
Downloads: 1152
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...