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

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 Simple Trade Management Script

This Script Closed All Open Orders At Once (Except Pending Orders)

Draw trade history onto chart

Plot entry and exit as line objects from MQL5 signal CSV onto chart

This Script is the example of using function LineNotify that use to send message to LINE APP via Line Notify service As the function LineNotify use webrequest to send HTTP request so it can be used in EA or Script program only , can't use in Indicator program

This simple quick & dirty script code will output a CSV file of all the Signals' properties as reported by the MQL4 Trade Signals functionality.

Just simple codes to Disable/Enable Auto/Algo-Trading in both MT5 and MT4. Of course, DLLs must be allowed, This cannot be done without DLLs

Export the history of transactions on the MT4 trading account.

Just a Basic Functions For BreakEven.

This is an EA based on Bollinger band crossover with prices.

Simple stoploss script

it saves the current chart to default template , it just helps to do it faster than a manual save. you can assign a hotkey for it. it has no confirmation and immediately saves the template, if you want it to save to a template other than default just edit the code and replace "default.tpl" to any other name you want.

This code helps beginners in MQL4, specially those migrating from C++ to perform some basic fie operation.

The script is best use to clean up all drawings ( Delete All Object, Comment, horizontal line, vertical line, arrows etc) on current chart. Please feel free to modify based on your needs.

This Is Just A Normal Trailing Step Function.

This Is a Normal Trailing Function For All Open Order In MT4.

A script that displays MarketInfo and SymbolInfo data through a button list built from MarketWatch.

Script to download EVZ data for Euro FX Vix indicator

Building good trading habits by seeing things in terms of percentage not in terms of money.

Custom Function To Get Comma Separated Things From String.

This Custom Function Will Help To Get Round Time For Any Given Timeframe And Time.

Building good trading habits by seeing things in terms of percentage not in terms of money.

This one may not be the fastest, but it will definitely close all your positions.

The currency strength meter is a trading tool that is used to identify trending and consolidating markets based on the percentage rate of change in price from one period to the next.

The breakout strength meter is a trading tool that is used to identify which currencies are the strongest to breakout, and which currencies are the weakest to breakout

In MetaTrader 4, we intend to calculate the intersection coordinates of two straight line objects with different slopes using MQL4.

With this script, you can send a message from MetaTrader 4 to Telegram.

Script that opens 2 orders - one set to close percent of position when profit equals stoploss, another set to close at TP

This script was developed in order to help us detect if a chart is actually trending or going nowhere.

The 8 effective steps to build a robust day trading plan using Fibonacci retracement

For day traders. 2 highly important indicators to turn strategies into extreme winning ones. The Win/Loss ratio and the Reward/Risk ratio will allow us to identify the best times and days our strategy works the best

For day traders, this is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best TIME during the day to trade when the market moves the most as well

This is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best days to trade when the market moves the most as well as the worst days to trade in order to prevent trading during these days.

Most traders keep losing money because they focus on money rather than planning their trades based on Percentage risk.

Are you tired and lost when it comes to creating an attractive market watch list ? You always see pro traders creating an attractive market watch list in which they draw support/resistance and create all possible scenario ? Well we will guide you step by step to create your own attractive market watch list for potential entries.

This strategy is the well known set & forget accompanied by the martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

This strategy is the well known set & forget accompanied by the anti-martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

Short description: This Script will draw a line from the open to the close for each order in you account history. please show all history in account history before using this script.

Mark your historical trades in you mt4 with lines and arrows. You can load data from your history or load data from a csv file.

Simple script to delete all object on the current chart.