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 Codes of Scripts for MetaTrader 5

Scripts perform one-time actions in MetaTrader 5 using an MQL5 program and are deleted from the chart immediately afterwards. Sample functions include uploading trading history, generating a report and sending it by email, downloading and processing data from a file. Scripts can also be used to create graphical interface or quickly execute single-type trading operations, for example, close all positions immediately.

You can download and launch offered scripts in MetaTrader 5. The library of scripts is also available directly from MetaEditor development environment allowing you to learn MQL5 programming.

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

Simple risk management tool.

This script opens a buy or sell order randomly having equally spaced take-profit and stop-loss levels.

Simplified Script to find signals based on user parameters

First script selects symbols having spread below specified value on the marketwatch, then opens corresponding charts by appyling timeframe and template stated.

This script allows a user to find out instance_id of the running MetaTrader instance/installation.

Separate the construction of a complex object from its representation so that the same construction process can create different representations.

Define an interface for creating an object, but let subclasses decide which class to instantiate. Lets a class defer instantiation to subclasses.

Provides an interface for creating families of related or dependent objects without specifying their concrete class.

When the subject changes, it notifies and updates its observers, who know nothing about each other.

Encapsulating a family of interchangeable algorythms which can be modified independently from the client.

A way of sub-classing more functional objects, dynamically.

Export tool for OHLC prices, calculated prices & indicator buffers

This indi will draw OBJ_ARROW_BUY/OBJ_ARROW_SELL when find signals on Arrow Indi Buffers.

The script exports summary of closed trades grouped by each trading day to .csv file

The script exports summary of closed trades grouped by each currency pair to .csv file

A script to close all market positions and/or pending orders.

This script will change the SL and TP of all open trades of the symbol to the price where the script is dropped off.

Display interactive HTML graph of the account balance inside the web browser.

This is the version 2 of my script to export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. More columns were added and fixed minor errors. The code for processing and exporting data was rewritten.

This script will export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. Current version 1.0 does not add the takeprofit and stoploss. Any advice to improve this is welcomed.

Export history of deals from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

The script builds the Fibonacci Levels graphical object with the option of selecting the number of its segments

A script for automatically drawing the levels of the intraday High/Low on the FORTS trading session. There is also an option to draw the levels of the night High/Low prices (if the latter ones are beyond the intraday ones)

The script creates the Fibonacci levels graphic object with a large number of settings.

This is a utility for rounding the lot size correctly

The script calculates the average and weighted volatility of a symbol.

This script helps to save the objects into a file and show the objects on a new chart.

Export history of closed positions from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

A simple include file to print out the values and names of variables.

A script for showing the swap value on a financial instrument. The texts of positive and negative swaps are shown in different colors.

A script calculating the distance between a point and a line.

The script draws horizontal lines representing BUY (blue) and SELL (red) orders.

A library for working with a third-party tick archive.

Example of functions MathCeil, MathRound and MathFloor.

Display the actual stored value of a floating-point number (float or double type), with very high precision up to 55 decimal digits. This helps to debug exact value of floating-point numbers for other MQL5 programs.

VR Orders History MT5 Lite - a script for downloading trading history in the CSV format.

Counting the number of series of bullish and bearish bars. Displaying the result as a chart. Saving the screenshot of the resulting chart. The script uses the CGraphic class.

Counting the number of series of bullish and bearish bars. Displaying the result as a chart. Saving the screenshot of the resulting chart. The script uses the CGraphic class.

Script for checking the LeadLagRelationship indicator (https://www.mql5.com/en/market/product/26229)

The script has three independent functions for determining the current FORTS futures.

12345