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

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

automatically converts M1-data to M5/M15/M30/H1/H4/D1 in a single run

The script allows to use MetaTrader4 as netting platform. It has some advantages compared with MetaTrader5.

It saves the current expert parameters for all the experts attached to charts.

It's easy to use, just input your lotsize, stoploss and take profit values (in points) and trade.

The script shows the price level, where total profit for all of the opened positions will be non-negative (without loss level, or break-even price level).

The script deletes objects from the chart.

Creates a synthetic Hedge for any open position that you select. Use it only if are you completely understand synthetic derivatives or triangular arbitrage.

This code will get the current time , wait until a certain amount of Seconds has passed and then continue processing.

Graphic displaying of the statement, carring of a data from the *.htm table to the graph, for the convenience of analysis.

The library contain several functions to get an additional information about the symbols, loaded into the client terminal. ATTENTION: Undocummented solution, it may not work in the other versions of MetaTrader

This script will allow you to use the information about the market watch and the client terminal settings. It can be very useful to study the client terminal and market watch options.

Clears the chart of all objects with the name beginning on the specified prefix

Script for calculation average daily range for last agoYear-"calendar" years, last agoMonth - calendar months, ......

Two scripts to automate opening multiple positions simultainiously with SL and TP.

Drag & Drop the script at chart on point where StopLoss should stay. Script will compare desired StopLoss with the current price and determine the type of the order - Buy or Sell. The next step is calculating the volume according Free Margin and the Risk

Script for vertical grid lines plotting

Script for horizontal grid lines plotting

action just like pressing home key, esc to exit,

Scripts deletes all objects from the diagram.

It's version 2 of Customized Buy and sell v1 .... http://codebase.mql4.com/4901

Code sample

2 SCRIPS TO AUTOMATE OPENING MULTIPLE POSITIONS SIMULTAINIOUSLY

Cut Off All trade , But keep the queue Trade

some people worked as ib , they used to need to calclute total trade lotes. here it is.

Buy Sell Customized With RefreshRates and Lots Manager

The calculation of the amount of lots through the specified percentage of free assets.

The script for simultaneous placing of several orders by different symbols.

The UploadExport script is a universal program tool. It is developed to ease the working of the analyst and the trader with regard to the daily routine actions of wave analysis using the ELWAVE program.

Scripts to Close Orders under various conditions

You pick the script and drag it on a chart's point. Then it uses this point to modify all stop/take profit levels of the chart's currency.

The script is the calculator of the simple, complex, nominal and continuously charged percents.

An example of automatic running of the script when the timeframe or symbol is changed.

The script selectively clears the chart by the part of the name and/or by the type of the object.

The script closes any position using the Drag'n'Drop method, i.e. the method of "drag the script with the mouse and drop it on the order lines".

The script is intended for gathering some statistics by the symbols and its comparison.

A script for uploading the history by all known currency pairs, metals, indexes, CFD's and for controlling the "hole" in the history.

A determination of a bar and trend direction.

Uploading of history of all symbols from the Market Watch window by all TF. The recording to a file of names and trading condtions by all symbols from the Market Watch window.

Spread, swap, minimum stop limit, price of a point, calculated maximum lot!!!

A script for reinitialization of all indicators attached to the current window.

123456789