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 - 52

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.

To post a new code, please log in or register
latest|best

Original mathematical functions taken from different places, which either do not have analogues or perform much faster than alternative implementations

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

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

A script for placing a SellStop order

A script for placing a BuyStop order

A script for placing a SellLimit order

A script for placing a BuyLimit order

A simple trend indicator based on the smoothed Average Directional Movement Index drawn in the main chart window.

A trend indicator based on the intersections of Parabolic Sar and a moving average.

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

A simple trend indicator based on the smoothed Average Directional Movement Index.

The indicator draws colored candlesticks of a larger timeframe as color filled rectangles using DRAW_FILLING buffers. Rectangles are color filled in accordance with the colors of the StreamСCandles indicator candlesticks, if there are any.

The script closes all positions of the current symbol.

The script closes all open positions on the current account.

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

The Expert Advisor is based on the indicator with the same name. Lot is calculated based on the risk value as a percentage of free margin.

The indicator finds candlesticks with a minimum or maximum shadow size. Limitation on the size of the candlestick body.

The indicator finds candlesticks without an upper or lower shadow. The indicator style is DRAW_ARROW.

The Expert Advisor closes all positions opened on the account, if the current server time has exceeded the time limit specified in the input variables.

The Expert Advisor closes all the current symbol positions opened on the account, if the current server time has exceeded the time limit specified in the input variables.

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

The indicator colors candlesticks whose size multiplied by volume exceeds a preset value.

The WATR_HTF_Signal indicator shows a trend direction or a trade signal generated by the WATR indicator at the chosen bar as a graphical object with colored trend indication or deal direction. It also triggers alerts and plays audio signals.

The XOSignal_HTF_Signal indicator shows a trend direction or a trade signal generated by the XOSignal indicator at the chosen bar as a graphical object with colored trend indication or deal direction. It also triggers alerts and plays audio signals.

A trend indicator implemented as NRTR, with the possibility to generate alerts and send emails or push-notifications.

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

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

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

The Cronex T RSI BBSW indicator for MetaTrader 5.

MetaCOT 2 CFTC ToolBox Indicators is a set of MetaCOT 2 indicators that provide access to CFTC reports. MetaCOT 2 supports COT, Disaggregated COT, TFF and CIT reports. It allows to draw COT charts straight in the MetaTrader terminal. All indicators are available as source code, and anyone can use them to create their own trading system.

It is the MQL5 version of ZeroLag MACD.

A channel based on standard deviation of close price.

This is a binary options simulated trading indicator on MetaTrader 5 client, novice traders can use to practice trading strategies, program interface have simplified Chinese and English.

This time-series library brings lightning-fast timeseries access to MQL5 for time-sensitive applications while implementing the familiar methods of MQL4, e.g. iBarShift.

Hedge The Hedge Trader EA.

The indicator displays the Renko bars on the MetaTrader 5 chart.

We look for N identical candles in a row. If the found candles bull - we buy, if bear - we sell.

The average spread for the "averaging period". You can set the background transparency and transparency of the text. CCanvas.

Advisor on the signals of the indicators Bollinger Bands and Moving Average.

High and Low. For levels, you can specify an offset. You can specify the interval (PERIOD_D1) on which to search for levels.

1...454647484950515253545556575859...150