ZeroLag MACD

ZeroLag MACD

Here is the traditionnal MACD (Moving Average Convergence Divergence) indicator made with the “zero lag” calculation process.

The default values are : 26 (long) , 12 (short) and 9 for the signal line.

 

Share this

Risk disclosure:

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 : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. smnjnssn • 10/26/2015 #

    Hi.
    Can you please describe how you set the colors as in the attached screenshot? Thanks.

    • Nicolas • 10/26/2015 #

      Just set the two colors of the ‘SignalMACD’ curve in the indicator properties window.

    • sam00075 • 10/26/2015 #

      Hi Nicolas, can you please upload a version with TEMA, so those who don’t know how to code can download the .itf ? Thanks

    • Nicolas • 10/26/2015 #

      Use the MACD code here: https://www.prorealcode.com/topic/standard-prt-code-for-macd/#post-189640
      and change exponentialaverage with TEMA
      see instruction: https://www.prorealcode.com/documentation/tema/

  2. Lasse • 10/26/2015 #

    Hi Nicolas,
    When applying these codes for MACD zero lag above I don’t get the same result as the stadard MACD zero lag indicator embedded in the system, please see picture attached. Do you know what I am doing wrong? For this example I am using standard periods – 12/26/9. I am looking for the codes for MACD zero lag indicator in order to use it in the proscreener. thanks.

    • Nicolas • 10/26/2015 #

      Hi Lasse, because MACD is a line and not an histogram for the indicator embedded in the platform.

  3. Lasse • 10/26/2015 #

    ok, but even though I look at the line and compare it with the histogram in the default indicator it is still not the same result – …not really sure what you mean. What I am looking for, is a coding for the MACD Zero lag indicator in order to apply it as part of my proscreenings. Could you please post the link to the indicator codings if it’s available? thanks.

  4. Doctrading • 10/26/2015 #

    Hello,
    Here is a code with the same result as default indicator : 
     
    // MACD ZERO LAG
    // p= variable macd zerolag : 12 par défaut
    // q= variable signal : 26 par défaut
    // r= variable macd - signal : 9 par défaut // mettre histogramme

    p = 12
    q = 26
    r = 9

    z1=DEMA[p](close)
    z2 =dema[q](close)
    e= z1 - z2
    z3=DEMA[r](e)
    f=z3
    g=e-f

    return e AS \"MACD ZEROLAG\",f AS \"signal\",g as \"macd-signal\",0 as \"zero\"

     
    Best regards,

  5. absent1980 • 10/26/2015 #

    Hi, 
    How to build this into the system as a condition such as: “IF MACDZeroLag > MACDZeroLag[1] THEN …” When i call for this indicator probuilder shows an error because only one value out of three is used.
    Thanks

  6. ginko • 10/26/2015 #

    There are 2 versions of the MACD (almost) Zero Lag in the same Article introducing Zero-Lag MACD, (Patrick G. Mulloy), “Smoothing Data With Less Lag” article in TASC (Technical Analysis of Stock and Commodities) V12.2 pages 72-80.
    One version is indeed using a DEMA as shown in the code above, the second version in the article used a TEMA instead.
    Only the DEMA version is implemented in ProrealTime.
    The TEMA is faster (and has even less lag),
    BTW: Both versions are not truly zero-lag, but are “almost” zero-lag.
    Patrick Murphy stated that “Comparing the MACDs for TEMA1 with DEMA1” … “The DEMA1 MACD had two fewer trades, approximately a
    20% improvement in overall profit, and one fewer drawdown.”
    But he stated that with other period parameters, TEMA version was way better and showed a 50% improvement in overall profit vs the DEMA version. Please refer to the article for more clues.

    • Nicolas • 10/26/2015 #

      The TEMA instruction is available, so that’s easy to make an MACD with it. https://www.prorealcode.com/documentation/tema/

  7. Romina • 10/26/2015 #

    Buenas tardes Nicolás,
    Estoy intenando configurar este indicador MACD Retraso 0, y no se que debo poner en “defina la siguiente variable: EMAshort1.
    Espero sus noticias. Muchas gracias

  8. Alai-n • 317 days ago #

    Afin d’avoir l’Histogramme Macd il faut rajouter ligne18 : HistogrammeMacd = ZeroLagMACD – SignalMACD (et dans le) Return HistogrammeMacd as “HistogrammeMacd”(ligne19)

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
mangiaragni Buongiorno io non riesco a visualizzare nessun tipo di volume , mi torna sempre una linea dr...
Nicolas Assicurati che lo strumento che stai guardando abbia dei volumi! È il caso?
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
Marc Boliart dear nicolas, tyvm for your indicators and strategies, i have this following error when i ch...
Nicolas Your picture is too small, but for sure the problem is about the fact you are still using v1...
Rory Dryden Thanks. This looks useful.
TACBOLSA
7 years ago
RB-MACD TIMING
RB-MACD TIMING
0
Screeners
Lydia1948 Hi I really like this indicator - is it easy to change the colour of the blue dots to say g...
Nicolas Lines 23 and 24 are the Red and Blue value between 0 to 255, you can change the color of the...
mahdi how can I import itf file into mt4? please help
Nicolas That code is not for MT4, we do not offer free assistance for this platform, but you can ask...
guinsu2000 hello could you share your copy in a pdf or where you whant please ?
Francesco
7 years ago
oraclus Merci il lui ressemble bcp
juanj Think this is something we can experiment with in the 'universal' strategy along with the Bo...
ggolfet Hello Francesco, thanks for the code. Now I can do backtests on this indicator. I'm testin...
Lotech123 Thanks for this indicator. Working on a 3 M timeframe with the DJI, it can produce some inte...
JSTAR PRODUCTIONS Hi there, I downloaded the Indicator but the indicator does not show up on my charts. Am...
JSTAR PRODUCTIONS Hi, Worked it out. Thanks
CavalierDeCesDames Bonjour Nicolas, Thanks for your use full job. I tried this indicator on a shorter timefram...
Nicolas You are welcome. I'm glad you like it.
Bolbo It does not appear over the price indicator on V11. Thanks in advance.
Nicolas
7 years ago
Loop Hi All! Would it be possible to have the same indicator with the MACD calculated with the DE...
Nicolas Why not, but do you think it would make such a noticeable difference?
Loop Good question Nicolas! That's why I was curious to check it! MACD based on DEMA is usually m...
supertiti Thanks you so much Lucassen
dreif123 hi, copied the above code, not working on 10.3 the system says "return can only be used at ...
LUCASSEN Hallo , i have no problem , and i have the same versie 10.3, maybe you can ask Nicolas, tha...
Nicolas
7 years ago
Nicolas Para cambiar los colores del histograma, deben usarse las variables r, gyb entre las líneas ...
leofib Hello, I was looking for a MACD Histogram with red and green bars according to the value of ...
Helgart Hi, it's great to have this option of having a histogram coloured based on rising or fall...
SAM
7 years ago
Nicolas
7 years ago
Jurik MACD
Jurik MACD
1
Indicators
ramonjp Hi Nicolas, this sentence is correct?? ftmp0 = (1-falpha)*price + falpha*tmp0[1] I thi...
bolsatrilera
7 years ago
MACD MIRROR
MACD MIRROR
0
Indicators
Nicolas
7 years ago
soulintact Thank you very much Nicolas for this great indicator. I have tried to apply it to a trading ...
laitus No funciona este indicador ¿¿?? ¿Alguien sabe por qué?
Nicolas
8 years ago
ALMA MACD
ALMA MACD
7
Indicators
Arnaud HALVICK Great indicator, thank you!
JMat45 Hi Nicolas, just reviewing this indicator and noticed that you have double assigned the vari...
Nicolas That would not make any difference because the code is read from top to bottom.
MikeGC I don't know if you have used the variables a and b to optimise the parameters for the Super...
gianpiero75 I have not optimized, I multiplied the parameters for 6 (5,8), to use them on the 4  hoursTF...
bertrandpinoy bonjour Mike j utilise TrendChaser V2.0 et quand il prend position cela ne programme pas le ...

Top