MACD Signal Bands

Category: Indicators By: Nicolas Created: April 27, 2017, 9:25 AM
April 27, 2017, 9:25 AM
Indicators
6 Comments

This indicator is a new version of the classic MACD. The coloured line is the difference between 2 moving average (a fast one and a slow one), you can modify their periods and their type in the settings.

A “band” made of a standard deviation act as a support or resistance and also as a filter to give accurate long and short signals. The widen of the band can be modify with the “dev” setting which is the multiplier of how many standard deviation is used for the calculation of the band.

Like the classic MACD, this oscillator can be also used to spot divergences and potential trend reversing.

I retrieved this code in my platform, so I’m sharing it. Enjoy.

//PRC_MACD Signal Bands | indicator
//27.04.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

//---Settings
//fastLength=12
//slowLength=26
//fastMAtype=1 //moving average type variable
//slowMAtype=1 //moving average type variable
//length=12
//dev=1
//---End of settings

fastema=average[fastLength,fastMAtype]
slowema=average[slowLength,slowMAtype]
mmacd = fastema-slowema

sstd = std[length](mmacd)
upper = (sstd*dev+(average[length](mmacd)))
lower = ((average[length](mmacd))-(sstd*dev))

if mmacd>upper then
 r=0
 g=200
 b=0
endif
if mmacd<lower then
 r=200
 g=0
 b=0
endif

return mmacd coloured(r,g,b) style(line,5) as "macd", upper style(dottedline) as "upper", lower style(dottedline) as "lower"

 

Download
Filename: PRC_MACD-Signal-Bands.itf
Downloads: 697
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...