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 • 330 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
Pelle Nævestad Thanks Nicolas, this is a keeper!
Chicane23 Hi, when uploaded the WAE isnt showing histogram; only line. Is there a way to modify?
Nicolas Change the way the lines are displayed in the indicator settings window : histogram, lines, ...
Bard Did anyone get an error with lines 25 and 26?
Nicolas
9 years ago
Nicolas Just replace the last line with this : RETURN dm as "Volume Weighted MACD", masignal as "Si...
thomas2004ch I happen to read this article. I would say the formel 'd = maslow - mafast' could be inverse...
Nicolas You are right! but still the picture is looking good. The formula is inverted! dunno why :) ...
Nicolas
9 years ago

Top