MACD divergences from price

MACD divergences from price

The MACD divergences spot difference between the price and the MACD histogram on recent lower low and highest high.

This indicator use the ZeroLag version of the MACD indicator that can be found on the library here:  http://www.prorealcode.com/prorealtime-indicators/zerolag-macd/

Highest and Lowest point of the MACD are saved for divergence spotting only if the signal line of the MACD has crossed its histogram. 

This indicator code is not the one of the MACD divergence indicator already embedded in the platform. It may have some differences of results between these two. This one can be used for any automated trading strategy development. The code is adapted from the RSI divergence HK-LISSE one.

 

 

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. dakaodo • 06/02/2016 #

    This is a pretty useful indicator. I know how to identify divergences, but this definitely simplifies the task. I found that it is best used as an early warning signal, and then you open a trade on the next signal (on another indicator of your choice) confirming this one. e.g. every time if I had bought or sold based on this signal, I had a low chance of profit or breakeven. But if on this bullish signal, I waited for the next relative swing low to open my trade, I had about an 80-90% chance of profit or at least breakeven, even when it signaled countertrend during a larger opposite trend.I’m a little new to PRC, so maybe some other newbies will appreciate a minor tip: binary indicators like this one are visually easier when you set to Histogram and set the bullish color to green, bearish to red.

    • Nicolas • 06/02/2016 #

      Thanks for your comment about feedback and tips on this indicator. Maybe you could share with us how do you jump into a trade after the divergences signals? A new forum thread would be the best to share ideas around this. Cheers.

  2. lagjan • 06/02/2016 #

    Hello can some please help,,, if upload it j dont get the same as the above image

  3. stefou102 • 06/02/2016 #

    Hello Nicolas, in my opinion a divergence is only valid if between two low points or two high poins, the MACD histogram cross its centerline. Moreover, the bigger the difference between the two low/high points, the more powerfull is the divergence. Taking that into account, I don’t see real divergence in the chart you used as example. What do you think?

    • Nicolas • 06/02/2016 #

      Divergences are made from tops and bottoms of MACD spotted when the histogram is crossing its signal line. It is a nice and smart framework developed by someone else, it is very useful because it doesn’t use any loops or arrays!

  4. thomas2004ch • 06/02/2016 #

    Hi Nicolas,

    >>This indicator code is not the one of the MACD divergence indicator already embedded in the platform…

    What’s the name of the indicator embedded in the system?

    • Nicolas • 06/02/2016 #

      Hi, I’m not the author of this indicator. The MACD divergence source code of the one embedded in the platform is not available.

  5. thomas2004ch • 06/02/2016 #

    I think I’ve found it.

    My questions:
    1. Do you have the source code?
    2. The following is a screenshot. It seems sometimes it hasn’t recognized the divergence?

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Iván De nada!
lkiklkik merci ! which time frame would be the best .?
Iván Depends on the asset you are trading, so you need to test it first.
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
el titi Bonjour, merci beaucoup pour ce partage. Je vais regarder avec attention ce script et analys...
Armand2020 Bonjour , super taf!! serait il possible de faire un poc dynamique en timeframe 5 min en mod...
philippe59139 voici ce qu'il faudrait faire ou ajouter: //poc dynamique defparam calculateonlastbars=1...
Iván
4 weeks ago
Iván I personally like it in daily timeframe
oliTR Many thanks Ivan, I copy/paste your code to try it but could only get a constant stable unif...
Iván Hi, I've copied the code above and it works... what asset are you trying? $indices array ...
francis59 Hello Ivan, thanks for this very nice and powerfull indicator. Could you have time to create...
Iván Hi We could find stocks with sweep on: //PRC_Sweep Institucional //version = 0 //28.0...
inverse Like the way you think Ivan ... :)
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
Ciccarelli Franco Sembra molto interessante e volevo dei chiarimenti se possibile :Le righe commentate vanno l...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Fgats https://www.prorealcode.com/topic/indicateur-3-sigma-documentation/ lien pour la documentat...
DELBERT Bonjour , merci pour le partage et la traduction , je vais essayer d'assimiler ce nouvelle i...
Iván
1 month ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...

Top