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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
//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" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi Nicolas, this sentence is correct??
ftmp0 = (1-falpha)*price + falpha*tmp0[1]
I think that the correct sentence is:
ftmp0 = (1-falpha)*price + falpha*ftmp0[1]
Thanks in advance…