Download MetaTrader 5

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!

Standard VWAP (Volume Weighted Average Price) calculation, but with configurable start position.

Returns the profit of a position in points, as well as commission, swaps and profit in money based on the trading history.

Trades on PERIOD_M1 (M1). Calculates bullish and bearish candlesticks.

Closing all open positions with the specified profit percent.

The EA trades during two trading sessions, starting at the specified session beginning time. Stop Loss. Take Profit.

An assistant Expert Advisor. Only CLOSING positions.

Automated calculation of Stop Loss levels based on the ATR indicator.

The Expert Advisor uses three indicators: MA(150), RSI(3) with levels 80 and 20, Stochastic(6, 3, 3) with levels 70 and 30.

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

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

The EA uses the following indicators: CCI, fast and slow MA, Larry Williams' WPR.

The indicator implements a breakthrough system using the Color_PEMA_Envelopes_Digit channel.

The indicator implements a breakthrough system using the Color_QEMA_Envelopes_Digit channel.

A channel based on peaks and troughs of the Zigzag2_R_Color indicator.

A channel based on peaks and troughs of the ZigZag indicator.

A channel based on peaks and troughs of Boa_ZigZag

Trading strategy: the breakout of a High/Low in the selected time interval.

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

The indicator marks all performed trades with short horizontal lines.

Two ZigZag indicators are used for analysis.

The indicator draws a channel using the High and Low values of a candlestick of a higher timeframe specified in the indicator input parameters.

The indicator draws the open level of a candlestick of a higher timeframe specified in the indicator input parameters.

Envelopes using the Color_PEMA_Digit MA, with an indication of trend direction and display of the last values of channel borders.

Envelopes using the Color_QEMA_Digit MA, with an indication of trend direction and display of the last values of channel borders.

The Expert Advisor searches for N identical candlesticks in a row. It buys on bullish candlesticks and sells on bearish ones. The account type is taken into account, i.e. whether it is netting or hedging.

The Boa_ZigZag zigzag, with values displayed as fractal labels.

The Boa_ZigZag indicator with price labels of the ZigZag peak values.

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

The Expert Advisor trades based on signals generated by Stochastic Oscillator. Averaging. A limited number of positions. Trailing.

A simple system based on the crossover of two MAs.

The Expert Advisor searches for N identical candlesticks in a row. It buys on bullish candlesticks and sells on bearish ones.

The indicator shows the statistics of the "Evening Star" pattern.

A redrawing channel with a colored background.

ZigZag with unusual properties

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

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

This is a trend indicator

The Exp_XROC2_VG_X2 trend-following trading system is based on the signals of two XROC2_VG indicators.

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

The Exp_XROC2_VG_Digit_Tm Expert Advisor trades based on signals generated by the XROC2_VG oscillator.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104