14.08.2021

Forex scripts - making life easier. Build a grid of pending orders of the Limit type. GrailMeter script - measure the gravity of your robot


Forex scripts are executable files in MetaTrader 4 that are executed only once. They are ideal for routine tasks and time-consuming tasks where speed is important. The script is executed the moment the trader places it on the chart. After the task is completed, the script is removed from the chart. You can manually remove it before the task completes. These are the main differences between Forex scripts and trading advisors. The EA works all the time, but it uses price ticks to update. That is, in order to start working or for the changes in the EA parameters to take effect, the price must change. The frequency of the market price changes during the day. This means that the period between the EA updates is unpredictable. The predictability of the script (it starts immediately) makes it more suitable for some trading tasks than a trading advisor.

Installing the script in the MT4 terminal.

You can install the downloaded script into the MT4 terminal in the following ways:

  1. In the main menu, select "File", in the menu that opens, the item "Open data directory", in the "MQL4" folder, drop the script into the "Scripts" folder.
  2. Through the Meta Editor. Open the Meta Editor, then the "Scripts" folder and place the script there.

How to change parameters of a Forex script?

If you have enough knowledge in MQL4, you can change individual script parameters for yourself. To do this, you need to change the script code in the Meta Editor section of the trading platform. Here you can change the current properties of the program.

A list of useful scripts is easy to find on the Internet at almost any Forex-related website. I offer my list of useful Forex scripts.

Useful Forex scripts.

In order to quickly work with a large number of orders in the MT4 platform, scripts from the Close All series may come in handy.

Below are a few scripts that close all orders with a single click of a button. Moreover, depending on the market situation, you can use a specific script and close only pending orders or only open ones, only for BUY or SELL, or in general all orders for all currency pairs.

Description of scripts of the Close All series.

And today we will touch on an equally important topic - Forex scripts. When using scripts, you can fully concentrate on your trading system, study or conduct technical analysis, without being distracted by monotonous trading operations. This is especially necessary when you are using a scalping strategy or trading using an order grid, that is, when the profitability of your strategy depends on a quick decision. See also what are.

What are Forex scripts?

Forex scripts are a program code that was specially developed for one of them to simplify trading in the foreign exchange market. With their help, a trader can abandon the monotony of trading and devote all his time to improving the trading system. Scripts open up new opportunities in trading on, reducing the risks associated with the human factor. Now there is no need to carry out complex trading operations where attentiveness and quick reaction are required. For example, to launch a grid of orders, there is no need to manually open a series of orders when there is a script that will build a series of orders in a second, place or delete pending orders.

The advantages and disadvantages of scripts

Forex scripts can perform not only trading, but also analytical operations. But unlike those that work constantly, the scripts must be launched manually each time, that is, they require the direct participation of the trader to activate them. The capabilities of scripts are limited by requests that are embedded in a special code, so they are inferior to advisors and some. However, sometimes it is required to perform a series of simple actions that are beyond the power of advisors, this is where scripts come in handy. Modern trading platforms, for example, allow the simultaneous use of various advisors and scripts, which makes Forex trading even more functional and attractive.

Using scripts in practice

The MT4 trading terminal already has a number of standard scripts that you can use in your trading. With their help, you can modify or close orders, as well as place. You can find them in the "Navigator" window in the "Scripts" section. By clicking on the plus sign, you will see a full list of scripts available for use.

To run this or that algorithm, you need to transfer the script to the chart or double-click on the selected script. As a result, you will see the following window:

You must select "Yes", after which the script will start its work. It should be borne in mind that the script does not always perform a certain action when it is activated. It all depends on its purpose. For example, if the script is used to transfer an open position to, then this process will occur only if the necessary conditions are present (the price has crossed a given level on the chart). When it comes to deleting, then the script should start immediately. As soon as the script completes its task, it will be automatically deleted. To perform new actions, you need to re-run this script. If you want to terminate the script, then you need to right-click in any free space on the chart and select "Delete script" from the menu that opens.

How do I modify scripts?

For those who have the necessary knowledge in programming in the MQL 4 language, they can change the parameters of the scripts according to their requests. For example, you can change the lot size for the script that opens orders, or any other setting. To do this, right-click on the selected script and select the "Change" item in the menu.

As a result, the MetaEditor application window will open, in which you can change the script parameters. If you do not know what any of the parameters means, then you should not change it, as the script may stop working. After all the necessary settings have been changed, you need to save them. To do this, press the Compile button and close MetaEditor.

How do I install additional scripts in MT4?

In order to install the script in the MT4 trading terminal, you must first unpack it, and it must have the .mql or .ex4 extension. Next, in the trading terminal, click "File" and select "Open data directory".

In the open window, go to the "MQL4" section, go to the "Scripts" directory and copy the contents of our archive there. Then you should close the folder and restart the trading terminal.

After starting the terminal, you need to make sure that the script works properly. To do this, go to "Service", select "Settings", in the "Expert Advisors" tab, check the boxes indicated in the screenshot below and click OK.

Now you can open any chart and drag the script you need onto it.

Where can I find useful Forex scripts and download them for free?

In addition to the standard scripts built into MT4, there are many other useful scripts that can be downloaded from various Forex forums. However, it is easy to get confused among such a variety of auxiliary programs, so we decided to select the most popular Forex scripts, which you can download absolutely free:

1. Closing unprofitable orders

The script closes all unprofitable positions, the loss of which is greater than the Min_Loss parameter. Unprofitable positions are closed on all currency pairs for which orders are opened, regardless of which currency pair you set this script to.

2. Closing all positions upon reaching the total loss

This script closes all open positions after the total loss becomes greater than the General_Loss parameter, which is manually set by the trader in the deposit currency.

Free download Forex script:

3. Closing all positions upon reaching the total profit

The script closes all orders after the total profit exceeds the value specified in the General_Profit parameter in the deposit currency.

Free download Forex script:

4. Closing an order by time

This script closes a specific deal at a specified time with an indication of the ticket of an open order. If the open deal is a pending order, then it will be deleted. The following parameters must be specified in the script settings:

    Ticket - here you need to place a ticket for an open order;

    CloseTime - order closing time. To quickly change a parameter, select and delete the default value. Next, you should press Enter, as a result of which the field will be filled with the current date and time, and then correct it to the value that you need.

Free download Forex script:

5. Reversal of current positions

If you see that your open trades will soon close with a loss, and you are confident that the price will continue to move in a given direction, then this script will help you open an opposite position at the stop loss level of a losing order.

Free download Forex script:

6. Removing pending orders

This script deletes all previously placed pending orders for one of the currency pairs. For example, if you install a script for the GBPUSD currency pair, then pending orders will be closed only for this currency pair.

Free download Forex script:

7. Transfer to breakeven

This script transfers all open positions to breakeven.

Free download Forex script:

8. Trawl

This script maintains open orders with the specified take profit and stop loss parameters.

Free download Forex script:

9. Lot calculation

The script automatically calculates the lot size based on the MaxRisk parameter, which indicates a percentage of yours (by default, MaxRisk is equal to five percent).

Free download Forex script:

10. Building a grid of orders

Using this script, you can place any number of pending buy or sell orders. To start the script, you need to drag it to the price mark on the chart, from which you want to place a grid of pending orders. You can also manually specify the opening price of the first order opposite the extern double Price parameter, lot size (extern double Lot), number of orders (extern int SetOrders), distance between orders (extern int Step), stop loss level (extern int StopLoss) and take profit (extern int TakeProfit), as well as enable or disable a sound signal when an order is triggered. In addition to setting a standard take profit or stop loss, you also have the opportunity to specify the total profit (extern bool GeneralProfit) and loss (extern bool GeneralStop). After specifying the values ​​for all parameters, you must click OK, and you will be prompted to choose which pending orders to use - stop or limit.

Free download Forex script:

As you can see, Forex scripts are not so difficult to apply in practice, and in most cases they are still auxiliary elements in Forex trading. With their help, you can greatly facilitate the work of a trader, and spend your free time on improving the trading system and personal growth.

Forex scripts are executable files in MetaTrader 4 that are executed only once. They are ideal for routine tasks and time-consuming tasks where speed is important. The script is executed the moment the trader places it on the chart. After the task is completed, the script is removed from the chart. You can manually remove it before the task completes. These are the main differences between Forex scripts and trading advisors. The EA works all the time, but it uses price ticks to update. That is, in order to start working or for the changes in the EA parameters to take effect, the price must change. The frequency of the market price changes during the day. This means that the period between the EA updates is unpredictable. The predictability of the script (it starts immediately) makes it more suitable for some trading tasks than a trading advisor.

Installing the script in the MT4 terminal.

You can install the downloaded script into the MT4 terminal in the following ways:

  1. In the main menu, select "File", in the menu that opens, the item "Open data directory", in the "MQL4" folder, drop the script into the "Scripts" folder.
  2. Through the Meta Editor. Open the Meta Editor, then the "Scripts" folder and place the script there.

How to change parameters of a Forex script?

If you have enough knowledge in MQL4, you can change individual script parameters for yourself. To do this, you need to change the script code in the Meta Editor section of the trading platform. Here you can change the current properties of the program.

A list of useful scripts is easy to find on the Internet at almost any Forex-related website. I offer my list of useful Forex scripts.

Useful Forex scripts.

In order to quickly work with a large number of orders in the MT4 platform, scripts from the Close All series may come in handy.

Below are a few scripts that close all orders with a single click of a button. Moreover, depending on the market situation, you can use a specific script and close only pending orders or only open ones, only for BUY or SELL, or in general all orders for all currency pairs.

Description of scripts of the Close All series.

Hello dear readers of my blog and fellow traders.

Today's article is essential for everyone who wants to make their trading life easier, because we will talk about Forex scripts.

In Forex trading, you often need to be able to make decisions quickly and make them as quickly as possible. This is especially important when.

That is, trading is such a thing that it is necessary:

  • Quickly assess the market situation for one or several currency pairs;
  • Instantly carry out various calculations regarding money management;
  • Constantly monitor the current situation in open trades (tighten the stop, move the trade to breakeven, close several trades in a row, etc.);
  • Remember the conditions that are necessary for making new transactions
  • Etc.

Doing all this yourself, alone and with your own two hands and just one head, be it even three times "golden" is not very fun and can take quite a lot of time and effort.

Currently, in any field of activity, whether it be business processes or trading, it is necessary to be able to automate routine operations that are repeated from time to time.

With the help of forex scripts, you can solve these problems quite effectively.

Script, Is a small program written in MetaQuotes Language 4 (MQL 4). An editor for writing / editing scripts is included in the MT4 terminal.

Forex scripts are necessary to perform any one-time actions. Unlike Expert Advisors, scripts are executed on demand, not tick-by-tick. That is, in other words, having launched an advisor once, it works almost constantly, and the script, on the contrary, having executed its function once, exits.

Such one-off functions can be, for example:

  • closing all transactions that are in profit;
  • transferring the transaction to breakeven when a price level is reached.
  • etc.

To find the script you need in the Metatrader4 terminal, open the "Scripts" tab in the "Navigator" left panel of the trading terminal. It contains the default list of scripts that perform all sorts of operations.

To run the script we need, just drag it onto the chart of the instrument being traded, or simply double-click on the script. Then confirm the operation.

After the script completes its function, it will automatically be removed from the chart, but if you suddenly need to remove the script ahead of time, then right-click anywhere on the chart and click delete script.

How to install a script in Metatrader4?

  1. To get started, you must have the MetaTrader4 program
  2. Find the script you need and download the archive with it. Next, we unpack this archive. Copy the resulting ex4 and / or mql files to the MQL4 / scripts folder , which is located in the data directory of your terminal .
  3. You can get to the data directory by clicking in the terminal File -> Open Data Directory

Find MQL4 in the opened folder, then the Scripts folder and copy the script files there. After that, restart the terminal.

Attention! For the scripts to work correctly, you need to go to the Expert Advisors menu and configure everything as in the screenshot below. To do this, click Service-> Settings... Select the Expert Advisors tab and check the boxes. Then click ok.

This completes the installation process. Now you can run the script for work by dragging it onto the chart of the working instrument.

How to customize the script for yourself?

Sometimes it becomes necessary to change some of the basic parameters of the script for yourself. To do this, you need to make changes to the script code.

1. Find the script you want in the terminal, right-click on it and select change.

2. In the appeared editor window, change the parameters. But remember that you cannot change anything superfluous so that the script does not stop working correctly.

So, that's all with installing and changing the parameters of the scripts.

Below is a list of useful scripts in forex trading.

Useful forex scripts - a selection for daily trading

  • Breakeven level- shows the breakeven level;
  • set 2 stop orders - Places two opposite stop orders;
  • reverse - reverses all open positions;
  • close all loss - closes all loss orders;
  • close all profit orders - closes all orders in profit;
  • close all gtc - closes all pending orders;
  • close all orders - closes all open orders;
  • PipValue- shows the point size in the quote currency;
  • fromHistoryOnGraph- transfers all closed deals to the chart. It is much more convenient than dragging and dropping one deal from history to the chart.
  • Calculation of the 3rd Elliott wave- the script calculates the third Elliot wave using the Williams algorithm from the book "Trading Chaos".

To download scripts, as well as to get access to the catalog of other useful Forex materials, enter your name and E-mail in the form below. Download links will come to your email.

The portfolio of technical tools of a Forex trader that facilitate trading, in addition to trading systems, indicators and, may include such instruments as Forex scripts... Everyone has heard of them, but not every trader uses them in his arsenal for the banal reason of ignorance of their features and merits. So what are scripts, how are they installed and used in the MetaTrader 4 terminal? - you ask. Let's take everything in order!

The script is small program written in MQL4 and used to facilitate the trading process. Such a program is intended for one-time execution of any action. After performing this action, the script is usually deleted, and only its repeated launch will again perform the required operation. Scripts are used to automate a number of actions that a trader uses in his trading activities and carries out them all manually, which can sometimes take a lot of time. For example, do you want to delete all open orders with one click of the mouse? Or place two pending bidirectional orders at a specified distance from the price, again, with one mouse click? No problem - the appropriate Forex scripts will help you with this!

Despite the fact that the capabilities of scripts are limited, their usefulness for a trader cannot be underestimated, given that the main and most useful ones can be found on the Internet for free. Each trader can select a set of scripts, depending on his goals, the characteristics of his trading tactics and used.

Useful scripts for the MT4 terminal.

Below we will present to you for free download a number of scripts, the most popular and useful, that extend the trading functions of the MT4 terminal and facilitate the trading process. The installation procedure is standard. The downloaded archive is unpacked, and the \ MQL4 \ folder obtained after unzipping is copied to your trading terminal, after which the MT program must be restarted. After rebooting, the installed script will appear in the Navigator - Scripts window, from where it is dragged onto the chart, in the settings window (if there are settings for the script!) The necessary parameters are set (their set depends on the tool's functions) and the OK button is clicked to activate the script.

So, we bring to your attention useful scripts for the MetaTrader 4 trading terminal. You can download the archive with the corresponding script from the link after its short description:

  • - Close All Order - the script closes everything, both market and pending (has no configurable parameters);

    Download close-all-order.rar (downloads: 215)

  • - Remove Pending Order - the script removes all pending orders (has no configurable parameters);

    Download remove-pending-order.rar (downloads: 119)

  • - Remove Loss Order - the script closes only unprofitable orders (the Stop variable sets how much the order should be "in the red" to close, by default - at least 5 points);

    Download remove-loss-order.rar (downloads: 123)

  • - Close Profit Order - the script closes only profitable orders (the Profit variable sets how many points the order should be "in plus" to close, by default - at least 5 points);

    Download close-profit-order.rar (downloads: 134)

  • - Reverse Orders - the script closes the current orders for the selected trading instrument and opens in the opposite direction (has no configurable parameters);

    Download reverse-orders.rar (downloads: 124)

  • - Delete All Graf - the script deletes all graphical objects from the chart (has no configurable parameters);

    Download delete-all-graf.rar (downloads: 126)

  • - Open Buy Sell Order - the script allows you to open two pending or market orders in opposite directions from the current price level. It will be useful for those who like to trade on level breakouts during the exit (it is not difficult to understand the adjustable parameters);

    Download open-buy-sell-order.rar (downloads: 252)

  • - Open One Order - the script allows you to open one market order with the specified Stop Loss, Take Profit, and Magic Number. It is used if it is necessary for the Expert Advisor installed on the chart to "catch" a manually opened order. To open the required order for one of the variables (SELL or BUY), set the value to true (by default, both variables are set to false);

    Download open-one-order.rar (downloads: 149)

  • - Zero Level - the script will place SL for orders opened in one direction to the breakeven level. It also takes into account commissions, the accuracy is +/- size (it has no configurable parameters);

    Download zero-level.rar (downloads: 163)

  • - Uroven Bezubytka - the script will calculate and show orders for all open orders for this currency pair (it has no configurable parameters);

    Download uroven-bezubytka.rar (downloads: 157)

  • - Balance Profit All - the script will calculate the account balance, profit or loss in the deposit currency and as a percentage of it when the price reaches the flickering line. To change the information, drag the flickering line to the desired level. If this line is removed, the script will set take profit (stop loss) at the specified level and exit (it has no configurable parameters).

    Download balance-profit-all.rar (downloads: 159)

All scripts have been tested in the latest version of the trading terminal at the time of this writing - this is MetaTrader Version 4.00 Build 745.


2021
mamipizza.ru - Banks. Deposits and deposits. Money transfers. Loans and taxes. Money and the state