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 Source Codes of Scripts for MetaTrader 4 - 8

icon

Scripts are small applications that perform one-time actions. For example, you can delete all objects from a chart or place a set of orders for an open position. Find here hundreds of applications that can automate small analytical or trading functions.

Scripts are free to download and run in MetaTrader 4.

Submit your code
latest | best

A set of scripts that are intended for the automation of some routine operations in the terminal.

The script closes all opened Buy and Sell positions in the active window.

The script moves the StopLoss at the Distance from the market.

The script opens a SELL position with the specified part of the FreeMargin.

The script moves the TakeProfit by the Distance from the market.

It deletes a pending order or closes an opened order in accordance with your selection. It is necessary just to drag the script to an order. The script will choose the closest one and will close or delete it.

The script shows the conditions of the correct and closest placing of the StopLoss and TakeProfit of the orders.

Pi

The calculation of pi character.

The script extracts the list of symbols from the *.set file and saves it as the csv file.

The script swaps out all the symbols available in the Market Watch window into a csv file.

Well, the functions of file operations are used in the system library of kernel32.dll. It is this library that we import into the EA. The code is attached.

The script automates the drawing of time lines of opening/closing of a calendar day and the price lines of opening/closing of the days.

An example of the script that writes the values of the RSI indicator to a CSV file.

Placing two pending stop orders for breaking through some trade range, for example, before the important news are published.

It reverses all the positions on the current symbol.

The script performs the calculation of the average volatility of the symbol on the specified interval.

The modification of an order (position) using the mouse - the second script from the "GMO" ("Graphical Management of Orders") series.

A script for visualization of trades on the chart. It is useful when you change the account/PC.

A script for valuation of trades history that is uploaded to the client terminal. The valuation is performed in points.

Placing a pending order using the mouse - the first script from the "GMO" ("Graphical Management of Orders") series.

The amplitude of price movement statistics in a text file. Quickly and comfortably.

The script draws on the chart the curve of the Polynomial regression with the channel of the mean square deviation.

The analysis of history data for the absence of bars, identifies their size, length and gap.

Unloading quotes from the selected period into an external file.

Drawing all results from a strategy tester report file into a chart.

A step-by-step passing of historical data for manual testing of trading.

Script interception of pressing keys or mouse buttons in the windows of MetaTrader 4. It can be helpful in writing controls.

Report generator

A DLL to manage and exchange data between MT4 and MS Excel. OLE is used. The description of the DLL functions is given in the attached example. The example is a script that sends quotes to Excel and builds the diagram of daily price changes. At exiting,

The script should solve the "fading charts" problem - the situation when the charts stop being updated while the connection to the server remains ok

Automated volume calculation for the preset risk factor, and order(s) opening.

A script tool for those who develop programs in MQL4. It allows to display the contents of any font in your chart.

A toy script that demonstrate the way of displaying some text information in a chart.

The script draws a set of up/down levels that are at a certain-percentage distance from the price of the bar selected by user.

A script aimed at loading of history for all available currency pairs, metals, indexes, CFD, and at checking of history for "holes".

The script places stop orders. The orders are placed for the market/pending orders specified in custom variables High (variable Hi) and Low (variable Lo).

Three scripts for quick preparation and manual placing of trade orders.

Drawdowns are calculated, too.

It measures all sections that join the ZigZag breaks, the resulting values are given in points.

The script pumps over all quotations.

123456789