MACD Divergences on price and indicator

MACD Divergences on price and indicator

Here you are an indicator that shows divergences on price and MACD at the same time.

Indeed, you need to put 1 indicator on the price chart and another as a new indicator.

Divergences are drawn automatically and it does not repaint.




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?

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

  1. supertiti • 06/14/2018 #

    @ Jose
    Gracias por estos indicadores que parecen muy buenos !

    Puedes preguntar a PRT para tener los segmentos mas gruesos ?


  2. Jose7674 • 06/14/2018 #

    De nada, un placer. Adaptarlo a cualquier otro indicador es sencillo.
    Si el indicador es rapido (estocastico, rsi), N deberia ser 20.

    En indicadores mas “lentos” como un MACD estandar se puede subir el valor de N a 40

  3. juanj • 06/14/2018 #

    Neat! You should do the same for RSI and MFI. I usually validate divergence on all three.

    • Jose7674 • 06/14/2018 #

      It’s quite simple.
      Just change mimacd=rsi[14](close)
      On both and it’s done

      You can use any other indicator this way

  4. JohnScher • 06/14/2018 #

    fine work
    I’ve been looking for this for a long time.

  5. Inertia • 06/14/2018 #

    Well done !

  6. TAC Bolsa • 06/14/2018 #

    Muy Buen trabajo Jose… no lo he podido mirar hasta ahora… y me parece muy bueno…… sobre todo en otros indicadores, con tu permiso lo adaptare para otros indicadores como HPI.. la versión mejorada..

    • Jose7674 • 06/14/2018 #

      Claro, es muy sencillo de adaptar!
      Ya pondrás algún resultado o idea que saques. La idea surgió al ver tu indicador modificado. Creía que también dibujaba las divergencias … y ya empecé a pensar como hacerlo

  7. cc • 06/14/2018 #

    Excelente indicador @jose7674 Seria ideal que pudiera detectar las divergencias reales como lo hace y ademas las escondidas (hidden). Gracias

  8. tradingthelife • 06/14/2018 #

    @jose7674 este indicador es una auténtica joya, muchas gracias por compartirlo.
    Uno de los inconvenientes es la visibilidad, como comentaba @supertiti. Lo he tuneado un poco y después del drawsegment he añadido

    DRAWARROWDOWN(barindex[1], miRSI[1]) COLOURED(200,0,0)

    para las bajistas, y

    DRAWARROWUP(barindex[1], miRSI[1]) COLOURED(0,200,0)

    para las alcistas.

    Lo de las divergencias ocultas sería un plus. No tengo nivel para esto, pero @Francesco hizo también un gran trabajo con este indicador que sí las incluye:

    Saludos y gracias de nuevo por tu aporte.

  9. abhay • 06/14/2018 #

    divergence lines on MACD indicator are not showing. It shows only on Price chart

    • Nicolas • 06/14/2018 #

      Because you have to apply it on the price chart too.

  10. tradingthelife • 06/14/2018 #

    Hay alguna manera de hacer un proscreener para este indicador? Lo he intentado pero no lo consigo.
    Saludos y gracias.

    • franciscojbritop • 06/14/2018 #

      Hola tradingthelife, has tenido suerte encontrando un screener para este indicador? He estado un tiempo largo buscandolo y no logro conseguirlo tampoco. Saludos

    • franciscojbritop • 06/14/2018 #

      Hola Jose7674, Utilizas algun screener para encontrar candidatos que esten mostrando estas MACD divergences mostradas en tu codigo? Saludos

  11. thomas2004ch • 06/14/2018 #

    How can I just draw the latest divergency line? I try the following but no line is drawn.

    for i2=1 to N
    if mimacd[i2]=extremum11[1] then

    drawsegment(barindex[1], mimacd[1], barindex[zz2], mimacd[zz2]) coloured(0,200,0)

  12. thomas2004ch • 06/14/2018 #

    I use the break to get off after the first divergency line is drawn. But this seems not work.

  13. FrancoisB • 06/14/2018 #

    Nice, does anyone know how to show the hidden divergence as well?

  14. tradingthelife • 06/14/2018 #

    Hi friends, any help with a screener for this indicator? Best regards.

  15. Psg91450 • 161 days ago #

    Good evening José7674,
    First of all thank you for sharing on the macd. I would like to put an alert on the green and red color changes but I can’t do it. Can you help me and give me the code please.
    Thank you in advance.

  16. Bertone • 46 days ago #

    Great job. It really works, especially on the weekly chart.Awesome!! Can it be used as a Screener??

  17. pacorapvalle • 6 days ago #

    Gracias por el indicador y me uno a los que han preguntado si hay algun screener.

  18. Jose7674 • 2 hours ago #

    Intentaré poner el screener está semana

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+24 more likes

Related users ' posts
Violet Is there perhaps a problem with the code? It doesn't work, at least not on my PRT version 11
Stenozar Hi Juanj e thanks for your indicator; do you suggest any timeframe for a better use of it? t...
larouedegann It doesn't work
4 months ago
cfta Thanks for sharing, this may be a useful filter but I'm not sure if it's coded correctly sin...
stephane2.0 Yes, line 5 is truncated. I can't edit, please replace by:
stephane2.0 c=exponentialaverage[9](MACDLine[12,26,9](close))
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
Juanjo Hola, Buscando un sistema valido para operar el squeeze, he reprogramado el indicador para ...
mauro1966 BRAVO....
JackD I am getting a Syntex error when entering the code
Gianluca THANK YOU!!!!!
TAC Bolsa Thank you, Jan Any modification is good reference if it helps us win in the market.
marcov66 Hi, it seems a very useful indicator. Unfortunately the link here for the full explanation d...
TACBOLSA Discontinued indicator. we are sorry.
Nicolas Merci de poster la demande dans le forum des indicateurs prorealtime. Avec un titre explicit...
RV1974 Bonjour, j'ai une erreur Erreur sur ligne 48,49 62,63 et Fin de code non reconnu
Nicolas Afin d'éviter les mauvais copier/coller, il est toujours plus simple de télécharger le fichi...
FREDNC adx[14]>adxmin and adx[14] > adxr[14] and adx[14]>adxmin and adx[14] DIminus[3](clo...
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
jpm380 Merci pour ce super indicateur. Comment puis-je mettre une alerte dès changement dès croisem...
berga Hi, thank you very much for this very useful screener. I would like to get another very clos...
leoulve Hello, I uploaded correctly the screener and it is not selecting any. Is it normal? cheers
Oliviertrader2020 Hello, where do you find the ZeroLagMACDWeek indicator? You only posted the mtf-macd-diverge...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Alexander9 This code for metastock ?, can for amibroker . Thanks
AGTrader Interesante, muy visual Doc. Felicidades!!!
Andraxx simplemente impresionante Dom...te sigo en youtube. Me ha gustado tu canal. Gracias por comp...
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])
magicT I did a copy and paste of this code and PRT 10.3 returns a synthax mistake: OneTradePerD...
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...
leoulve Hello Nicolas, sorry for this dummy question, but what does express the orange 'square' on t...
Nicolas I don't know what you are talking about, this code doesnt plot anything on the price chart.
GenesisEX Thank you all for your contributions this is a great submission. Thanks for your inputs.
MaoRai54 Hi, first of all Happy New Year. Well, I've inserted your indicator in DAX 1h but I cann...
Vinks_o_7 Hi Mao Happy New Year ! This is just an improved RSI where you plot a standard price momen...
Angel Perez Ciao Francesco. First of all thanks for the indicator and also fro the screener. I do have a...
Denis Hello Francesco, I have the same problem as Bard, a blank indicator without any return val...
llsegard bonjour, merci pour cet indicateur très utile - Pouvez expliquer pourquoi l'indicateur ...