A set of popular Forex scripts for MT4 - for all occasions!

A set of popular Forex scripts for MT4
Get advice on your broker
  • THIEF?
  • SCAM?
  • SCAM?

Often in trading there is a need for some corrective action on the pairs chart in MT4 or to perform some small actions. Forex scripts help a lot with this.

What is a script and what is it for?

A script is a program for MT4 created to perform some one-time functionality. After applying the script to a specific chart, it is usually deleted. To use it again, you need to run it again.

I often use scripts to automate some scenario: for example, calculate the total loss or quickly place orders with a given lot, etc.

Script for closing a deal by time

The script closes an open order at a specified time, if it is a pending order, it will simply be deleted.

Script settings:

  • Ticket — ticket of an open order;
  • CloseTime – time of closing the transaction in the following sequence: 1970.01.01 00:00. To quickly change this setting, highlight and delete the default value, and then press Enter, the variable value will be filled with the current date, then change the date (time).


Script for opening and closing an order by time

Script for opening and closing an order by time. The script opens an order only for Buy or Sell at the specified time and closes in the same way according to the settings.


  • extern bool BuyOpen - If: true then opens Buy otherwise it will be Sell;
  • extern int TP — Take profit.
  • extern int SL — Stop Loss;
  • extern double Lots — the volume of the opened lot;
  • extern int Slippage — slippage in points;
  • extern int Magic — order number;
  • extern bool OpenAtTime - If true, then opens at the configured time, otherwise - no;
  • extern string TimetoOpen – Time to open, for example 12:30 (by terminal);
  • extern bool CloseAtTime - If true, then closes, otherwise - no;
  • extern string Time to Close – Time to close, for example: 15:30.


Script to delete all objects

Script to delete all objects. Removes all objects placed on the charts by simple dragging. The script has no settings.

Such a script can do quite a good job and save time if, for example, there are a lot of constructions on the charts and you need to quickly clear everything and start over.


Script for placing pending orders on 15 pairs at once

The multi-currency script can place pending orders on 15 pairs at once, depending on the settings.

The set contains 2 files, one for displaying only on Buy, the second only on Sell. Both scripts only work in one direction.

Script options:

  • lots: lot volume Kolord: the function is not clear;
  • TPdelta: fixed take profit;
  • SL delta: stop loss level;
  • val1: currency symbol, for example EURUSD, if 0 then no.


Script for pending orders with customizable parameters

Script for pending orders with customizable parameters. The script places pending orders in accordance with the specified parameters.

List of configurable parameters:

  • stop loss — SL setting level, if 0, then SL is not set;
  • takeprofit — TP setting level, if 0, then TP is not set;
  • delta — distance between orders;
  • MaxOrders — number of grid orders in each direction;
  • Magic — a unique order number, not to be confused with other open or pending orders;
  • SELL — open only SELLSTOP orders;
  • BUY — open only BUYSTOP orders.


Script to open two immediate orders for Buy and Sell

A simple, convenient and working script for the immediate opening of 2 opposite orders for Buy and Sell with fixed parameters Stop Loss, Take Profit and slippage level.

The script has a few simple settings:

Script for placing two opposite pending orders Sell Stop and Buy Stop at once

  • lots – lot volume for orders;
  • stop-loss – stop loss level to limit losses;
  • Take Profit – fixed take profit for taking profit;
  • slippage - slippage in case of a sharp price movement.


Script for placing two opposite pending orders Sell Stop and Buy Stop

The script immediately places two opposite pending orders Sell Stop and Buy Stop with a specified offset from the current price, stop loss, take profit, slippage and lot volume.

The script has a few simple settings:

  • lots – the volume of the opened lot;
  • stop-loss – stop-loss order value;
  • Take Profit – the planned profit amount at which the order will be closed;
  • distance set – distance to the current price in points for placing a pending order;
  • slippage - slippage (with a strong price movement - it sometimes writes that there are NO PRICES, for example, if you make money on the news, this must be taken into account).


How to install a script in MT4?

Installing the script is very simple, launch the terminal and select "Data Directory" from the menu:

Next, you need to move the downloaded archive to a folder along the following path: terminal data directory/MQL4/scripts

To install the necessary script on the pair chart, open the tab in the MT4 menu in the top menu: View → Navigator or press Ctrl+N.

Next, right-click on the name "Scripts" and select "Update" from the drop-down menu:

You will see the scripts you added, if for some reason they are not shown, restart the terminal.

To execute any script, you need to hold it with the left mouse button and transfer it to the chart of the selected pair. Further, during the transfer (depending on the functionality of the script), a window with parameter settings will be displayed, where you can make any changes (if necessary) and click OK!

Scripts will be updated from time to time!

Script files

To get forex scripts for MT4 for free - you need to leave a comment on this article, tell us what you think about the use of scripts in forex trading.


Like this post? Please share to your friends:
Уведомить о
18 Commentary
Межтекстовые Отзывы
Посмотреть все комментарии