Heikin Ashi Smoothed oscillator

Category: Indicators By: Nicolas Created: June 15, 2018, 8:59 AM
June 15, 2018, 8:59 AM
Indicators
2 Comments

 

The Heikin Ashi Smoothed Oscillator indicator is a momentum indicator made of smoothed Heikin Ashi candlesticks formation.

According to its original author, mladen:

Heiken Ashi Oscillator tends to have a lot of signal. So many signals that sometimes it is impossible to use it reasonably in trading. This version is attempting to bring that into reasonable bounds.

Instead of using the “regular” Heiken Ashi for oscillator calculations, this version is using the smoothed Heiken Ashi. That makes the number of false signals fall dramatically, and, when pre-smoothing is applied to Heiken Ashi, the lag is in acceptable bounds. That way it becomes a good trend assessment tool. Along with a signal line, you have multiple choices how to use this indicator in trading.

Indicator converted from a MT5 code version as requested in the Spanish forum.

//PRC_Heikin Ashi Smoothed Osc | indicator
//15.06.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT5 version

// --- settings 
inpMaPreSmoothPeriod = 7 // Pre smoothing average period
inpMaPreSmoothMethod = 2 // Pre smoothing average method
inpMaPosSmoothPeriod = 7 // Pos smoothing average period
inpMaPosSmoothMethod = 2 // Pos smoothing average method
inpMaPeriod = 2 // Signal period
inpMaMethod = 0 // Signal method
//MA method: 
//0 = SMA
//1 = EMA
//2 = WMA
//3 = Wilder
//4 = Triangular
//5 = End point
//6 = Time series
// --- end of settings 

if barindex>inpMaPreSmoothPeriod+inpMaPosSmoothPeriod then 
 maOpen = average[inpMaPreSmoothPeriod,inpMaPreSmoothMethod](open)
 maClose = average[inpMaPreSmoothPeriod,inpMaPreSmoothMethod](close)
 maLow = average[inpMaPreSmoothPeriod,inpMaPreSmoothMethod](low)
 maHigh = average[inpMaPreSmoothPeriod,inpMaPreSmoothMethod](high)
 if barindex>0 then 
  haopen = (workha2[1]+workha3[1])/2
 else
  haopen = (open+close)/2
 endif
 haClose = (maOpen+maHigh+maLow+maClose)/4.0

 workHa2 = haOpen
 workHa3 = haClose
 workHa4 = average[inpMaPosSmoothPeriod,inpMaPosSmoothMethod](haOpen+haClose)/2

 if barindex>0 then 
  val = workHa4 - workHa4[1]
 endif

 r=244
 g=164
 b=96
 if val>0 then 
  r=135
  g=206
  b=250
 endif

signal = average[inpMaPeriod,inpMaMethod](val)
 if signal>signal[1] then
  rs=30
  gs=144
  bs=255
 else
  rs=255
  gs=127
  bs=80
 endif
endif

RETURN val coloured(r,g,b)style(histogram), signal coloured(rs,gs,bs)style(line,5)

 

Download
Filename: PRC_Heikin-Ashi-Smoothed-Osc.itf
Downloads: 672
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...