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

Top MQL4 and MQL5 source codes based on user ratings - 7

Submit your code

Download all the ticks from your broker for all the symbols in the market watch. Download all history or until a specific date in the past if available.

Whether you’re running multiple trading robots simultaneously or just one sophisticated strategy, keeping track of each Expert Advisor’s performance can be surprisingly time-consuming. MetaTrader 5 (MT5) conveniently displays orders and positions in its “Toolbox,” but when numerous robots share the same account, it becomes harder to know which EA is generating your profits—or losses. A single account might have dozens or hundreds of trades, each opened by different EAs, making it difficult to separate the results of one robot from another.

The goal is to make the function readily available for any Telegram integration task in MQL5 development. By adding this file to your CodeBase, you can simply include it in your Expert Advisors and call the function directly from the included module. This eliminates the need to redevelop the code from scratch repeatedly, ensuring reusability across multiple projects.

Better Volume is an advanced indicator designed to analyse the behaviour of volume on price charts. It combines volume information with metrics such as candlestick range and moving averages to identify important patterns in the market, such as buy/sell climaxes, churn and weak candles. With its dynamic visual interface and volume categorisation, the indicator offers valuable insights for traders who want to make informed decisions based on volume flow.

This is a piece of code to add to an existing Expert advisor to track withdrawals from your account where the EA is running. It helps the user to monitor his or her withdrawals from a particular account.

This Bot detects the open of a new candle on any set timeframe, thereby making it easier to run a one-time code, place trades and call other functions. The code is written in the OnTick() function.

EquiPeak Drawdown Tracker is an indicator designed to monitor and record the maximum drawdown of your trading account in real time. It's not just a current drawdown indicator; it's especially useful for visually comparing your current drawdown with the maximum historical drawdown you expect or have previously recorded.

The Custom MA Cross with RSI Indicator for MT5 is a versatile trading tool designed to help traders identify trend changes and filter entries using momentum. This indicator combines two moving averages (MA) with the Relative Strength Index (RSI), offering clear buy and sell signals.

This indicator calls 3 other subwindow indicators. All files go in your Indicators folder.

This Expert Advisor (EA) helps traders manage risk by automatically adjusting position sizes and stop-loss levels based on market volatility, using the Average True Range (ATR) indicator. The EA calculates the optimal position size for each trade according to a user-defined risk percentage and the current ATR value, ensuring consistent risk exposure across all market conditions. It also offers an ATR-based stop-loss option to adapt to volatility, while employing a simple moving average crossover strategy to open buy trades. Ideal for traders seeking to automate risk management without complex trading logic, this EA prioritizes account protection and simplifies the trading process.

Custom MACD for MetaTrader 5 enhances the classic MACD with real-time signal alerts sent to your phone. Detect trends and reversals with customizable parameters, intuitive visuals, and automated buy/sell notifications.

A dynamic trendline-based evolution of the Donchian Channel

This is a Moving Average indicator based on Heiken-Ashi candles instead of raw market price.

Parallel use of the MetaTrader 4 and MetaTrader 5 order systems.

The VR Alert NT5 indicator warns the trader about the price reaching a specified level.

The Slope Direction Line indicator is displayed as a colored moving average line indicating the average market movement direction.

Multiple runs/optimisations in Tester.

Holt's double exponential smoothing with linear forecasting

This version can use one of the 4 basic averages types for smoothing.

Serialization and deserialization of JSON protocol. The code is ported from a high-speed С++ library.

Adaptive Laguerre filter trend.

Highest high & lowest low support resistance

This is MQL5 version of Shved Supply and Demand written by Shved and upgraded by eevviill7 with history mode.

Detecting the start of a new bar or candle in an Expert Advisor's OnTick() event handler.

To use martingale money management when a position is in loss and price hits any of specific distances.

This is the exact conversion of pivotshigh and pivotslow functions from pine script v4 as an mql5 indicator.

This function performs the main logic of opening a trade. Calculates the opening price, take profit levels and stop loss based on symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information, such as symbol, volume, order type, deviation, comment, magic number, etc. Call the OrderSend function to send the operation request and get the result. SetTypeFillingBySymbol function: Determines the order fill type (Fill or Kill, Immediate or Cancel, or Return) based on the symbol's filling policy. GetMinTradeLevel function: Calculates the minimum operating level based on the freeze level and the symbol stops level. Adjusts the minimum level to make sure it is within certain limits and returns the result.

Indicator based on basic slope moving average and cloud around. Indicator shows two types of signals: prepearing - dot and entry - arrow.

When applied to financial markets this method is usually used to determine the moments of prices extreme deviation from a "standard" level.

Class for displaying multi-line comments.

YMA

Moving average for prices (O+C+H+L)/4.

A variation on the T3 theme that was made as a sort of envelopes using T3 for basic value.

The Aroon indicator in the new visualization.

The newest version of ALMA.

The Dynamic Trend signal indicator draws a two-color trend direction line and adds signal arrows.

The library and iCanvas class simplify writing programs using Canvas.

Signal indicator iCrossAD. It shows possible reversals or price roll-backs.

ATR adaptive SMA (simple moving average)

Raymond Cloudy Day For EA, a revolutionary trading tool created by Raymond and expertly developed for the MT5 platform. This innovative indicator integrates a cutting-edge calculation method with advanced algorithms, surpassing traditional Pivot Points to enhance trading strategies with unparalleled precision.

This is a indicator displaying candlesticks patterns on a chart.

1234567891011121314...189