Watch how to download trading robots for free

Find us on Facebook!
Join our fan page

Access the CodeBase from your MetaTrader 5 terminal

Couldn't find the right code? Order it in the Freelance section

How to Write an Expert Advisor or an Indicator

MQL4 and MQL5 Source Code Library

You don't know where to start learning the MQL5 or MQL4 programming language? Various programs for your MetaTrader terminal are available here. Download and study published code examples, develop your own indicators and Expert Advisors. Publish your applications in the largest library of MQL5 and MQL4 codes, and they will be available in every MetaTrader terminal and MetaEditor.

Your code examples in MQL4 and MQL5 will be distributed worldwide, and thousands of traders will know about you!

To post a new code, please log in or register

Synchronous change of a trading instrument in all charts

A collection of classic creational GoF design patterns

Ensure one instance of a class with a global point of access

Trend Follower Range Breakout System with Martingale.

Price momentum oscillator

Correlation trend indicator

I want to share with you this story. When I started trading, I learnt the scalping strategy in a volatile market. I really loved scalping especially when I see the price is moving fast. However, scalping for a long period of time is exhausting to me especially in a volatile market; volatile market requires fast analysis, actions and reactions; that is why I always reach a point that I loss concentration, focus and I start making those really stupid mistakes. That is why I created this EA, that is based on the indicator Identify potential entries, that helped me to automatically identify these potential entries (based on the formation of candlesticks) instead of doing all the work myself and it will trade these potential entries for me. I know there are plenty of Metatraders who also suffer from this and that is why I would like to share this EA with you, hopefully it will be beneficial. Do not forget to send you comments as well as rate these scripts. Happy trading!

If you can't watch your statistics and your game plan at all time, your emotions will take control and you will start taking ENTRIES such as revenge trade especially when you lose it.

Create objects by copying a prototype

An interface for creating an object that defers instantiation to subclasses. They decide which class to instantiate.

Ocean theory - natural market slope

The story behind this indicator is really interesting. I've published last week a script called "Identify potential Trends/Range (Pivot Points)" and a huge number of MQL5(ers) contacted me to ask if it is possible to have it as an indicator. So I was glad that lot of people actually like my scripts and indicators so that is why I've decided to convert the script to this indicator.

Random walk index (optimized version)

this expert opens trade in the direction of the trend when specific rate of average daily range has been passed.

For a complex object separate its construction from representation. Same construction process can create different representations

Step chart (upgraded version)

When I start learning about trading, I remember the trading pioneer Shawn Lucas (founder of Apiary-fund) saying "trading is simple, you go from bound range market to breakout market and vice versa". I looked at few charts and he was right. So I told myself, I have to always eyeball ranging market and trending market but with the help of an indicator. There are plenty for indicator that help us eyeball these ranging/trending market and they work really well, but I like using Pivot Points.

this script opens randomly selected charts and applies user-defined template.

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

I want to share with you this story. When I started trading, I learnt the scalping strategy in a volatile market. I really loved scalping especially when I see the price is moving fast. However, scalping for a long period of time is exhausting to me especially in a volatile market; volatile market requires fast analysis, actions and reactions; that is why I always reach a point that I loss concentration, focus and I start making those really stupid mistakes. That is why I created this indicator that helped me to automatically identify these potential entries (based on the formation of candlesticks) instead of doing all the work myself. I know there are plenty of Metatraders who also suffer from this and that is why I would like to share this indicator with you, hopefully it will be beneficial. Do not forget to send you comments as well as rate these scripts. Happy trading!

Modeling multiple inheritance with the Twin pattern.

short-term forex strategy for beginners.

I used to suffer from unnecessary losses and/or cutting my profit short since I wasn't fast enough to modify my SL and/or TP. That is why I've wrote these scripts that will allow me to react fast when I must modify my Sl and/or TP especially when I have many open and/or pending trades. I know there are plenty of Metatraders who also suffer from this and that is why I would like to share these scripts with you, hopefully it will be beneficial. Do not forget to send you comments as well as rate these scripts. Happy trading!

Provide a unified interface to a set of interfaces in a subsystem.

Simple script to see your current Profit Losses in Pips.

Compose objects into tree structures to represent part-whole hierarchies.

This script highlights Forex sessions for Sydney, Tokyo, London and New York with colored rectangles, according to the user time definitions.

Calculates the phase and amplitude of the expected wave

this is my first try at creating an EA from ground up - update 4

A basic container for storing an ordered list of basic data type objects.

A basic container for storing an ordered list of objects.

M1-based Moving Average. It gives more adequate estimation of average price per bar compared to any standard price type (close, open, median, typical, weighted, etc).

This MT5 indicator is to count down the remaining time of the current bar as the format HH:MM:SS

Frequent array operation methods.

Class for comparing two floating point variables.

Indicator WaveMTF Bull and Bear System with Signal and Alert for MetaTrader 5 with options to display signal on the chart.

Basket Closer Type EA.

Correlation market state

Correlation phasor

Correlation angle

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169