Watch how to download trading robots for free
Find us on Twitter!
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 - 3

Submit your code

Stochastic beginner tutorial to learn how to code in MQL5

Alligator beginner tutorial to learn how to code in MQL5

This is an indicator with a rainbow-like display, both for trend or pullback prediction.

MQL5 version of harmonic moving average

A volume oscillator is a useful technical analysis indicator that predicts the strength or weakness of price trends

Volatility Stop - indicator of stop levels by volatility

Capture widescreen screenshots by pressing the 's' hotkey on the keyboard

MovingAverages.mqh Part II A multi timeframe version is available with colors for orientation, for developers or profitable traders for free. Offer under conditions. Other multi timeframe indicators are also available.

A demonstration on how to modify objects in an indicator without having the source code

This script saves all the OHLCV data available on the chart to a CSV file.

Symbol Swap Panel: Effortlessly switch the active symbol on your chart while simultaneously adding the new symbol to Market Watch. This tool ensures seamless integration and access to real-time market data, optimizing your trading workflow.

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.

In Part 6 of the "MQL5 Programming for Traders", we will study a key component of the MQL5 language – trading automation. We will start with a description of the fundamental entities, such as financial instrument specifications and trading account settings. These are prerequisites for creating properly operating Expert Advisors.

The default CCI in MT5 doesn't have the shift parameter. This script implements the shift.

Horizontal Grid Controller with KeyEvents

Chande Kroll Stop indicator - stop levels for short and long positions.

Monitoring of memory leaks in the strategy tester

This function allows you to retrieve and return the filling policy of a symbol in MetaTrader 5. This is useful for making trading decisions based on the filling policy of a specific financial instrument.

This is an edit of the Mod_ATR_Trailing_Stop by MQL5 user @Scriptor found here https://www.mql5.com/en/code/20423 . MT5 indicator .mql5 and .ex5 files, report any bugs, I'll fix.

Multi_BreakEven is a script file that enables setting multiple entry positions to breakeven, either through pips or a target price, once the trade becomes favorable.

This Expert Advisor does not trade. A simple panel, implemented using the standard Canvas library, allows you to draw digits with the mouse. The trained mnist.onnx model is used to recognize the digits.

This is a simple program to compare asynchronous and synchronous all close. It is a sample program, so feel free to modify it for your own testing purposes, such as adding conditions.

The MT5 custom indicator, named "wd.Multi_LineMA.mq5," is designed to offer traders valuable insights into Moving Average values from a higher timeframe (MTF Multi TimeFrame). It encompasses additional visual features for in-depth analysis, such as the ability to view trails for a specified number of bars and a dynamic MA horizontal price line.

Here are some examples of codes for set counters based on "Count"

Know Sure Thing (KST) oscillator indicator based on the rate of price change (ROC)

Select the last closed deal (trade) to further work.

Ergodic oscillator Stochastic Momentum Index (SMI)

Standard Bollinger Bands indicator with averaging features added

It will delete all objects on the chart when the compiled executable is dragged onto the chart

Indicator displays the value of defined stop loss and or take profit in the deposit currency. Note: It calculates an estimated value based on a simple calculation and does not take into account brokerage commissions.

higher confidence to get into trade

The CDebugLogger class is a flexible and comprehensive logging utility designed for use in MQL4/5 environments. It allows developers to log messages at various levels of importance (INFO, WARNING, ERROR, DEBUG) with options to include timestamps, function signatures, file names, and line numbers in the log entries. The class supports logging to both the console and files, with the ability to save logs in a common folder and in CSV format. Additionally, it offers functionality to silence logs based on specific keywords, ensuring that sensitive information is not logged. This class is ideal for developers looking to implement robust logging mechanisms in their MQL4/5 applications, with customizable features that cater to a wide range of debugging and monitoring needs.

Perfect Seconds chart indicator allows you to convert minute candles of live data into seconds. 1. Choose any number of seconds to close a bar with accurate time. 2. This is Live OHLC rates based data, It works even if ticks are not available. 3. No external DLL required, it works smoothly on VPS 4. Fast and optimized code 5. Supports Crypto Pairs such as BInance, Kucoin and all other exchanges where Futures live chart can be converted into seconds easily. 6. Support all type of symbols such as Gold and Forex pairs. 7. Options to delete symbol and rates.

The simplest class for logging in MetaTrader 5 with support for levels, message format, include and exclude filters on substrings.

This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.

this is a copier template

Creating profit labels on deals (closed trades) which also show in the strategy tester

Prototype for data collection. Dummy buffers for the data window (for data collection purposes) for the hour of the day, and an additional buffer for the hour of the day. Comments the hour of the day.

This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. It is ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. This is a customizable starting point to adapt to any specific needs.

This script was developed for displaying saved Strategy report from the Strategy Tester into a chart.

12345678910...188