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!

Submit your code

Doulble MA Cross Draw Histogram MT5

An (optional) include file to enhance error code handling experience.

Indicator Camarilla Points "Stocks & Commodities V. 31:3 (pg. 10-15)"

An (optional) include file to enhance debugging experience.

define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically

Indicator "The 2 Pole Butterworth Filter". was created by John Ehlers ("Cybernetic Analysis For Stocks And Futures", p. 192)

define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically

Keltner channel with standard averaging and averaged over the ATR indicator.

This strategy is the well known set & forget with the ALERTING system. It is very useful on different trading scenarios. I urge you guys to always use trading tools that will make your live easier. So instead of watching the charts and the time and all day long, you can use this indicator that will watch the charts for you.

Trend indicator

without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later

McGinley dynamic (official version - as described by John R. McGinley)

Minimum / maximum support resistance zones

For day traders. 2 highly important indicators to turn strategies into extreme winning ones. The Win/Loss ratio and the Reward/Risk ratio will allow us to identify the best times and days our strategy works the best

Define an object that encapsulates how a set of objects interact mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently

For day traders, this is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best TIME during the day to trade when the market moves the most as well

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation

Indicator DayPivotPoint System with Signal and Alert for MetaTrader 5

Given a language, define a represention for its grammar along with an interpreter that uses the representation to interpret sentences in the language

This is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best days to trade when the market moves the most as well as the worst days to trade in order to prevent trading during these days.

A logging library similar to Log4j but for MQL.

Gann high/low activator (oscillator)

The Gann High Low Activator Indicator was described by Robert Krausz in a 1998 issue of Stocks & Commodities Magazine. It is a simple moving average SMA of the previous n period's highs or lows.

Encapsulate a request as an object thereby letting you parameterize clients with different requests. Queue or log requests, and support undoable operations

Most traders keep losing money because they focus on money rather than planning their trades based on Percentage risk.

Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it

Are you tired and lost when it comes to creating an attractive market watch list ? You always see pro traders creating an attractive market watch list in which they draw support/resistance and create all possible scenario ? Well we will guide you step by step to create your own attractive market watch list for potential entries.

We use the ADX and Moving average convergence divergence (MACD) to estimate trend strength, and determine possible variance value by comparing the difference between the two lows and highs.

Slightly improved version of the previous one.

This script is to get the last deal history data, for example : profit, deal type, etc, and put the Comment on the chart.

Provide a surrogate or placeholder for another object to control access to it

Use sharing to support large numbers of fine-grained objects efficiently

Provide a unified interface to a set of interfaces in a subsystem; facade defines a higher-level interface that makes the subsystem easier to use

This indicator shows the amount of price movement within a certain time, compared to the actual price movement range. Good to detect consolidation areas, as well as new trends being formed

This script displays useful information.

This strategy is the well known set & forget accompanied by the martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

Attach additional responsibilities to an object dynamically; and provide a flexible alternative to subclassing for extending functionality

Trading panel that allows user to define levels of trade by simply dragging lines.

This strategy is the well known set & forget accompanied by the anti-martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

Create an object tree which represents part-whole hierarchies, so that the client would treat objects and compositions of objects uniformly.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170