Candlestick patterns recognition

Candlestick patterns recognition

This indicator recognize about 13 candlestick patterns and draw their names with green and red arrows on chart:

  • Doji
  • Evening star
  • Morning star
  • Shooting star
  • Hammer
  • Inverted hammer
  • Bearish harami
  • Bullish harami
  • Bearish engulfing
  • Bullish engulfing
  • Piercing line
  • Hanging man
  • Dark cloud cover

I know a lot of people are looking for codes for candlestick pattern recognition, I stumble upon this pinescript code at TV so I decided to convert it to prorealtime.

The patterns tests are stored into “data” variables, so these codes snippets can be taken to make other indicators, trading strategies or screeners with ease.

Text colour can be changed with the R.G.B. values at the beginning of the code.


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. AleX • 07/17/2016 #

    Bug on 10.2? Errore di sintassi: Linea 12, carattere 9Uno dei seguenti caratteri sarebbe più appropriato di “(“:– “,”– “=”

    • Nicolas • 07/17/2016 #

      This indicator is only compatible with version 10.3, because it draws graphical components.

  2. AleX • 07/17/2016 #

    Ok, i’m waiting for release. Thanks for this sharing, very very interesting. 

  3. Doctrading • 07/17/2016 #

    Nice work !

  4. Pierre • 07/17/2016 #

    Very nice !
    This has been requested many times by PRT users.

  5. Sofitech • 07/17/2016 #

    Bonjour Nicolas. Superbe indicateur. Peut-on l’utiliser pour des stratégies ? Visiblement oui mais dans le module backtest, je ne vois apparaître que le nom de l’indicateur lorsque j’essaye de saisir des conditions d’achat / vente …Comme faire ?J’ai la même question avec le Fractal ZigZag, seul le nom de l’indicateur apparaît. 
    Merci pour tes lumières. Cette version semble très prometteuse.

    • Nicolas • 07/17/2016 #

      En effet, puisque tu remarques que la fonction RETURN ne retourne rien comme variable. Dans la version 10.3 on peut se permettre de le faire lorsque on souhaite juste faire des indications graphiques.
      Pour utiliser ces patterns dans ton code, il te suffit juste de faire des copier/coller des lignes “data” et de les vérifier comme des conditions banales : IF DATA14>0 THEN ..

  6. Sofitech • 07/17/2016 #

    ok merci. Je vais tester cela…

  7. Ashevs21 • 07/17/2016 #

    how do i get version 10.3??

    • Nicolas • 07/17/2016 #

      You can get an access to the beta version at

  8. Pascal • 07/17/2016 #

    Ça va être très intéressant d’avoir un retour statistique sur ces figures chartistes, merci!

  9. CarlosFC • 07/17/2016 #

    Hello Nicolas and thanks a lot for your excellent work.
    I have been trying to use this indicator but, after importing it from PRT version 10.3, nothing happens.

    • Nicolas • 07/17/2016 #

      Please add it on the price chart using the wrench at the left upper side of the chart.

    • CarlosFC • 07/17/2016 #

      Oh yes! It works.
      Thanks a lot Nicolas.

  10. Cavok • 07/17/2016 #

    Bonsoir, comment modifier le texte blanc en une autre couleur, le blanc étant extrèmement difficile à lire?
    Un grand bravo pour votre travail.

    • Nicolas • 07/17/2016 #

      La définition de la couleur blanche a été volontairement laissé accessible pour modification aux lignes 3,4,5 pour les utilisateurs n’utilisant pas un fond noir pour leurs graphiques (valeurs Rouge, Vert et Bleu à modifier à votre convenance).

  11. Ciccio • 07/17/2016 #

    There is this Metatrade 4 code that I found around, and it seems more complete than the one posted here
    Could someone kindly convert it to Prorealtime code?
    Thanks in advance

    • Nicolas • 07/17/2016 #

      Please use the forums instead! Don’t copy/paste codes of entire indicator in comments 🙂 You can upload file in a new forum post query for indicator translation.

  12. Reddi • 07/17/2016 #

    Great Nicolas and Thx,
    Nice work. IG has released today PRT 10,3 in Germany and I added the function immediately.

  13. Nicolas • 07/17/2016 #

    Another indicator for almost 40 candlesticks patterns identification has been released by Ciccio and it is available here:

  14. darraghcoyle77@ • 286 days ago #

    Hi Nicolas,
    Can this be edited to only show bullish/ bearish engulfing .

  15. guinsu2000 • 256 days ago #

    hello excuse my english, but i didn’t see spinning candle detection ?  can you add it please !

    • Nicolas • 256 days ago #

      You should have a look at this other candlesticks patterns indicator:

  16. Gregorinho • 214 days ago #

    Hi Nicolas,

    Thanks for the wonderful work? Do you know if there’s a way to say if the candlestick is a hammer and a doji, only write Doji? Because it’s often the same …



  17. kem2709 • 67 days ago #

    Dear Nicolas,
    Thank you very much for your work.
    As a beginner, I’m not yet a pro of coding as you are so may I kindly ask for your help? Would it be possible to add the following patterns, too? As per this source (, some patterns are more efficient than others. The following 6 ones aren’t included in your code and are claimed to be good: 1/ 3 line strike bearish, 2/ 3 line strike bullish, 3/ 3 black crows, 4/ matching low, 5/ abandoned baby bullish, 6/ breakaway bearish. Thank you sooo much in advance, you are the best!

    • Nicolas • 67 days ago #

      Did you try this one?

  18. kem2709 • 67 days ago #

    Wow, I’m speechless, so complete…
    Thank you!

Register or


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

+9 more likes

Related users ' posts
Sofitech What is the timeframe(s) you woul suggest to use for this method ?On Forex and/or on stock m...
Doctrading Hello, Higher timeframes are better. I suggest D1 or H4.Best regards,
Boursomaniac In addition, if you want to get more information on how to use the candlestick and evening a...
Francesco78 Merci, tres interessant
finplus Bonjour, merci pour ce screener qui m'intéresse énormément. Etant nul en codage, je souhaite...
Nicolas Je pense qu'il faudrait poster un nouveau sujet dans le support ProScreener du forum, on y s...
kajsy88 I'm using prorealtime suplied by ig markets so that's potentially why then !
davidspain It would be possible to use this screener at the same time than the recent one about high vo...
Jean-Pierre Poulain Hello, I am in version 10.3 but it does not work  
Cavok Bonjour, Comment utiliser cet indicateur comme screener? Merci.
Doctrading Sure, I will :)
farridin Hi Doctrading thank you very much for this code. One question as I'm new to coding, what wou...
Degardin Arnaud Many thanks for this indi! Good results on SPA35 con Timeframe 130min, I only modify this "(...
Doctrading Maybe you can also change the hourly beginning of the day (not 23PM but 12AM, OOH in french)...
Duccio Hi Doctrading,there is a way to control the max loss of the positions in this code? For exa...
Doctrading Hello, Yes, there is a command I think, but I don't know it. Nicolas knows it. You can als...
fesxeurex Thanks for posting, Apologies if this is a dumb questions but like Chinese say "If you ask ...
GraHal Hi fesxeurex After the bar has formed because the code / criteria  would be checked at the ...
Doctrading Hello fesxeurex, It can display both : when it is in formation, and when it has been formed...