MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Update to MetaTrader 4 build 735 and Test the VPS for Free
To post a new code, please log in or register

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 Jobs section

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.

previous123next
latest|best

Simple script for apply template and/or timeframe to all charts opened.

When you drag this script onto the chart, it will calculate the price where you drop the script and use this price to figure out if a Sell Stop or Sell Limit pending order should be placed.

When you drag this script onto the chart, it will calculate the price where you drop the script and use this price to figure out if a Buy Stop or Buy Limit pending order should be placed.

A simple script that allows you to open a Short position using the current price location with a specified Risk Percentage and Reward Ratio.

A simple script that allows you to open a long position using the current price location with a specified Risk Percentage and Reward Ratio.

Modified scripts to change Charts(next,previous) and Timeframes(higher,lower) of all charts quickly by hotkeys.

A script to place straddle orders around current price level to catch price spikes around announcements.

The script allows to set transparency level of the client terminal window using Windows API.

The script calculates candles statistics (the minimal, maximal and average values of candles body and shadows) of the current chart.

The script is assigned to a hot key for quick change of charts around in a circle.

Easier visual analysis of graphical objects created by the strategy tester.

The script for searching the maximum, minimum and average values of candlestick size

The script demonstrates the example of using the FileWriteInteger() function

The script demonstrates the example of using the FileTell() function

The script demonstrates the example of using the FileSize() function

The script demonstrates the example of using the FileWriteDouble() function

The script demonstrates the example of using the FileWrite() function

The script demonstrates the example of using the FileReadArray() function

The script demonstrates the example of using the FileGetInteger() function

The script demonstrates the example of using the FileIsEnding() function

The script demonstrates the example of using the FileFlush() function

The script demonstrates the example of using the FileMove() function

The script demonstrates the example of using the FileDelete() function

The script demonstrates the example of using the FileCopy() function

The script is a simple example of using the FileFindFirst(), FileFindNext() and FileFindClose() functions

These scripts are designed to sell with fixed values of Stop Loss and Take Profit in points from the current price

These scripts are designed to buy with fixed values of Stop Loss and Take Profit in points from the current price

The OpenSellPosition_X script is created to sell at fixed values of Stop Loss and Take Profit in points from the current price. Position volume is determined on the basis of the level of losses.

The OpenBuyPosition_X script is designed to buy at fixed values of Stop Loss and Take Profit in points from the current price. Position volume is determined on the basis of the level of losses.

MPC is a script which measures (searches) the most frequently occurring candlesticks

The script imitating the One Cancel Other orders functional. When one order is triggered, the others are deleted.

Comparing the speed of a binary or a ternary search

The script for manual trade: when achieving the limit price the script sets stop order and logs out

The CSV file was written to write economic news but there was a problem that the Terminal does not distinguish lines, exactly their number when working with the CSV file. That is why I decided to share my solution of this problem.

The script calculates Pivot Point on all the symbols from the market watch and displays the results in html-file.

Export of all necessary instruments and time frames in one click with load and checking history

This script attempts to demonstrate the power of using support vector machines in solving classification style problems.

The simplest script to send instant PUSH-notifications to smartphone

This script displays several subcharts in a single chart window according to the number of currency pairs in Market Watch menu.

This is an informative script displaying data on the current trading pair in the chart window.

previous123