Jurik MACD

Category: Indicators By: Nicolas Created: January 2, 2017, 10:26 AM
January 2, 2017, 10:26 AM
Indicators
1 Comment

The Jurik MACD is the classical Moving Average Convergence Divergence indicator made of JMA (Jurik MA).

Someone asked me recently to put on website the Jurik’s indicators, this one is the first of the series. Jurik Research has made a lot of indicators built upon its lag-free moving average called “JMA”.

This is a description of the JMA from the Mark Jurik Research website:

What is JMA?

Ideally, you would like a filtered signal to be both smooth and lag-free. Lag causes delays in your trades, and increasing lag in your indicators typically result in lower profits. In other words, late comers get what’s left on the table after the feast has already begun.

That’s why investors, banks and institutions worldwide ask for the Jurik Research Moving Average (JMA). You may apply it just as you would any other popular moving average. However, JMA’s improved timing and smoothness will astound you.

 

//PRC_Jurik MACD | indicator
//02.01.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- parameters

//fast = 12
//slow = 26
//signal = 9
//pow = 1
// ---

Data=Customclose
price=Data

if barindex>slow then
 //fast MA
 fbeta = 0.45*(fast-1)/(0.45*(fast-1)+2)
 if pow=1 then
  falpha = fbeta
 elsif pow=2 then
  falpha = fbeta*fbeta
 elsif pow=3 then
  falpha = fbeta*fbeta*fbeta
 elsif pow=4 then
  falpha = fbeta*fbeta*fbeta*fbeta
 elsif pow=5 then
  falpha = fbeta*fbeta*fbeta*fbeta*fbeta
 else
  falpha = fbeta
 endif

 ftmp0 = (1-falpha)*price + falpha*tmp0[1]
 ftmp1 = (price - ftmp0[0])*(1-fbeta) + fbeta*ftmp1[1]
 ftmp2 = ftmp0[0] + ftmp1[0]
 ftmp3 = (ftmp2[0] - ftmp4[1])*((1-falpha)*(1-falpha)) + (falpha*falpha)*ftmp3[1]
 ftmp4 = ftmp4[1] + ftmp3[0]
 fastMA = ftmp4

 //slow MA
 beta = 0.45*(slow-1)/(0.45*(slow-1)+2)
 if pow=1 then
  alpha = beta
 elsif pow=2 then
  alpha = beta*beta
 elsif pow=3 then
  alpha = beta*beta*beta
 elsif pow=4 then
  alpha = beta*beta*beta*beta
 elsif pow=5 then
  alpha = beta*beta*beta*beta*beta
 else
  alpha = beta
 endif

 tmp0 = (1-alpha)*price + alpha*tmp0[1]
 tmp1 = (price - tmp0[0])*(1-beta) + beta*tmp1[1]
 tmp2 = tmp0[0] + tmp1[0]
 tmp3 = (tmp2[0] - tmp4[1])*((1-alpha)*(1-alpha)) + (alpha*alpha)*tmp3[1]
 tmp4 = tmp4[1] + tmp3[0]
 slowMA = tmp4
endif

JMACD = fastMA-slowMA

signalMACD = average[signal](JMACD)

return JMACD as "Jurik MACD", signalMACD as "Signal"

 

Download
Filename: PRC_Jurik-MACD.itf
Downloads: 357
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...