banner ad

Code Your Own Candle Identifier in MQL4

There are quite a few indicators available that will identify various candle patterns but why not write your own? It’s really not that hard and you can customize it to only show the candle formations that you’re particularly interested in.

As a simple outline I’ve written an indicator that will identify and mark inside bars and also give a sound alert if the last closed candle was an inside bar. You can see the process involved and how I identify the inside bar.

The alert code is also pretty interesting as it allows you to specify a set amount of time between alerts. There’s nothing worse than a badly coded alert that sounds on each and every tick and with this code that’s never an issue.

From there it should be a relatively straightforward task to add your own candle formations.

I’ve added comments so you can follow the code and if you get stuck you can always hit F1 and use the MQL help file that comes with MetaEditor.

Good luck and I hope you find the code useful.


Category: MQL Programming

About the Author (Author Profile)

Steve Fleming has been a professional programmer and Internet professional for over 15 years. is a way to empower the non-programmers and offers a FREE 5 day E-course showing how to build an EA (expert advisor). Steve also offers his mql programming services at very competitive rates and has programmed many, many strategies both for himself and his ever growing list of satisfied clients.

Comments (0)

Trackback URL | Comments RSS Feed

There are no comments yet. Why not be the first to speak your mind.

Leave a Reply