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

MQL5 Source Code Library for MetaTrader 5 - 72

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code
latest | best

Analyzes bars whose opening time (hour and minute) is equal to the current bar opening time.

This is a trend trading system based on the signals of two Kolier_SuperTrend indicators.

Many traders are interested in native work with the BTC-e exchange directly from MetaTrader. In the exchange API, it is necessary to send data with the confirmation of parameters validity through HMAC-SHA512. The algorithm of SHA512 and HMAC calculation is implemented in this class.

Total Power Indicator in the semaphore-arrow form, generating alerts and sending emails and push notifications.

Total Power Indicator, in which values are fixed in the range from zero to one hundred.

Shows an appropriate value for the last three bars on each timeframe: "1" if the bar is bullish, and "0" if the bar is bearish.

The indicator sets the "Fixed scale" property to a chart window and holds the first bar in the middle of the window.

The WmiVol indicator with the timeframe selection option available in input parameters.

Two colored filled rectangles drawn between the values ​​of two GRFLeadingEdger indicator channels on one bar.

Two colored filled rectangles drawn between the values ​​of two Keltner channels on one bar.

Two colored filled rectangles drawn between the values ​​of two Bollinger channels on one bar.

The library makes indicators' Init/Deinit synchronized

The indicator shows the current spread using a color line.

The Exp_XFatlXSatlCloud trading system is based on change of the trend direction displayed by the XFatlXSatlCloud indicator

A histogram of maximum and minimum values of parameters SYMBOL_SESSION_BUY_ORDERS — "the total number of current buy orders" and SYMBOL_SESSION_SELL_ORDERS — "the total number of current sell orders". The drawing style is DRAW_HISTOGRAM.

A Moving Average indicator, for which the values of two levels can be specified from the code.

The XFatlXSatlCloud indicator with the timeframe selection option available in its input parameters.

The ColorXMUV indicator with the timeframe selection option available in its input parameters.

Average True Range (ATR) indicator values from other timeframes in a digital format, displayed as text on the chart.

The drawing of this Moving Average is based on Demark's "Daily Range Projections" method.

The Expert Advisor moves trailing stops of all positions on the current symbol.

The indicator finds fractals of any dimension.

The indicator displays the change in price as a percentage relative to the Open price of the current candlestick.

The indicator displays the change in price as a percentage relative to the Open price of the current candlestick.

Plays a sound when position is closed.

The script deletes all orders of the type specified in settings, on the current symbol.

The script deletes all pending orders on all symbols at a time.

The script closes all pending orders on the current symbol.

Trading based on preset candlestick combinations (patterns) Candlesticks are marked as "1" (bullish) and "0" (bearish). TakeProfit, StopLoss

The indicator displays the candlestick size (High-Low) and its direction in the form of a colored histogram.

The script calculates the maximum lot size that can be used to open a position using the entire free margin available on the deposit.

Ten 'Parabolic Stop and Reverse system' indicators in one window

The Expert Advisor calculates the maximum lot size that can be used to open a position using the entire free margin available on the deposit.

A script for placing two Buy Stop Limit and Sell Stop Limit orders at an equal distance.

A script for placing a SellStop Limit order.

A script for placing a BuyStop Limit order.

The Exp_Stochastic_Chaikins_Volatility Expert Advisor based on the Stochastic_Chaikins_Volatility indicator color change.

The Stochastic_Chaikins_Volatility indicator with the timeframe selection option available in its input parameters.

The script allows to quickly remove indicators from charts.

Bollinger bands at extended Fibonacci levels.

1...656667686970717273747576777879...172