GAZ-53 GAZ-3307 GAZ-66

Download scripts for deleting pending orders in trading platforms. Forex scripts Scripts for placing pending orders

The metatrader 4(5) trading terminal has many additional features, but for comfortable work, you still need to use additional forex scripts. These programs can greatly facilitate trading, and therefore increase its efficiency. They do not analyze the trend and do not supply trading signals, but only add some functions to the trader's terminal.

Forex scripts allow you to place pending and instant orders with the mouse, close all orders with one click, calculate the breakeven level, manage already open positions, and also provide a lot of other features. All presented programs are absolutely free, by choosing the necessary program you can download it on our website.

Make waiting more enjoyable with Game 5ftee Puzzle

In trading, there are often moments when you have to wait a long time for the price to reach a certain mark.

In order to somehow occupy themselves, someone is talking on the phone, someone is listening to music, but you can also play a simple game right in the trader's terminal.

So to speak, spend time usefully training your mental and logical abilities, since this is what this game is aimed at.

Fifteen we all know from childhood in their offline version, you just need to arrange 15 numbers in a certain order on a square field.

The developers of the game have made a version that can be easily used in the Metatrader 5 trading platform, directly on top of the currency pair chart.

Trade Assistant (Trade Assistant MT5)

It so happened that someone trades on Forex, and someone tries to make this trade easier by creating various programs and scripts.

Today we will talk about the Trade Assistant program, which acts as a trader's assistant when placing orders.

That is, it helps to place market and pending orders taking into account the risk in relation to the deposit, as well as set the size of stop orders.

That is, now you do not need to think about the size of the transaction every time you change the amount of funds on the deposit, but simply set the percentage of risk in relation to the balance.

But this is only a small part of the capabilities of the script, which simply amazes with its functionality and visualization.

Gep statistics script for a currency pair

Such a phenomenon as a forex gap has brought quite a few troubles to many traders, it is this phenomenon that does not allow stop orders to work.

And to be more precise, they work, but only after the price gap has ended and at the price of its completion.

There are also a lot of strategies that use gaps as entry signals, and are guided by a pattern that says that each price gap must be closed.

Therefore, it is so important to choose a currency pair for which price gaps rarely occur, or vice versa, to find an instrument with the largest gaps.

For these purposes, a script for gap statistics on currency pairs was invented.

Script pending orders at a specified time

Trading using pending orders is quite multifaceted, there are just a huge number of strategies based on them.

At the same time, the standard capabilities of the Metatrader trading terminal only allow limiting the time of existence of a pending order.

But sometimes it is required the other way around, so that the order starts to operate from a certain time, that is, to delay the placement of a pending order.

This is done in order to enable the price to go a certain distance, after which to open a position at a better price.

You can add a new function to the trading terminal by installing a script for placing pending orders, which will set Buy Stop and Sell Stop on a specific day and at the right time.

Script money management

Most professional traders say that it is quite easy to make money in forex, it is much more difficult to keep the money earned.


One losing trade can easily wipe out the profit that was made from five successful ones.

Therefore, the money management system comes to the fore, which regulates aspects of money management, the ratio of profits and losses.

Many beginners neglect this point, preferring to plan the volume of transactions only based on the size of the desired profit.

This is largely due to the very process of calculating safe volumes of transactions, still nothing if we are talking about one or two positions, but what if you have a dozen orders open?

A simple script that allows you to determine the volatility for the period

What does the AccountInfoSample script show in the trader's terminal

The online trading industry does not stand still, and every year new auxiliary tools appear, the use of which will significantly simplify the analytical process.

In addition to indicators and tools for technical analysis, it is possible to integrate scripts into the MT4 platform - special programs written in MQL4.

Such add-ons can serve to perform various tasks:
trade automation:

Placing or canceling pending orders
making trading more comfortable
information functions

The last group of scripts is used most often.

These programs are designed to systematize information about trading, which allows the trader to objectively evaluate the effectiveness of the strategy, work on errors and make appropriate changes.

Automatic stop loss and take profit

Dynamic trading in the style of scalping, pipsing or grid trading requires maximum performance from the trader.

However, at such a huge pace, especially when it comes to pipsing, it is almost impossible to timely and quickly set the correct stop order or profit values.

Naturally, such a situation leads to the fact that the trader suffers losses, because a huge number of losing trades have to be closed manually and not all of them can be followed.

Naturally, not everyone can withstand such conditions, so many simply refuse scalping and pipsing as such.

Trailing Master Script

One of the ways to save profits and minimize losses is to use the Trailing Stop order in trading.

However, in many cases, the standard and familiar trailing does not meet all the requirements and does not solve the tasks that a trader can set for him.

Therefore, auxiliary scripts and Expert Advisors come to the rescue, which significantly expand the functionality of a standard order.

You can get acquainted with one of these scripts in this article.

The Trailing Master script is an auxiliary trader's adviser, the essence of which is to automatically perform both mass and single trailing orders when the price reaches a predetermined profit value on the order.

Script Limit orders Pro. Universal grid trader assistant for all occasions

The profession of an analyst is to draw beautiful forecasts, and if they do not come true, then be able to correctly explain why.


A trader rarely thinks for a long time, moreover, most trading strategies are focused not on making forecasts, but on working with the consequences of a particular price behavior.

That is why, against the background of the unpredictability of the market, grid trading strategies began to gain more and more popularity, where a trader, like a fisherman, sets traps for the price on its way and earns from almost any of its movements.

However, working with grids has its drawbacks, and one of them is a huge amount of routine with pending orders, which not all traders can handle.

The cost of any mechanical error is a huge loss. That is why most traders always use either advisors or auxiliary scripts that allow them to solve a number of problems. Actually, you will get acquainted with one of these scripts in this article.

Script for transferring history to a chart

Investing in the forex market is extremely risky, and even the huge potential return in many cases is broken against the reality of the efficiency and stability of managers.


How to find out if the manager will be able to conduct effective trading?

What is his strategy and, most importantly, are these indicators boosted due to the competent use of risky money management models, which give a beautiful picture of the profitability graph, but at the same time, the drain occurs suddenly and instantly?

In order to give answers to this question, it is necessary to study in detail the principle of a trader's trading, and the script for transferring history to a chart will help you with this.

The script for transferring history to the StrategyViewer chart is an auxiliary program for your MT4 that allows you to pull history from an Excel report, which often allows you to download various services for copying transactions and also PAMM sites.

It is worth noting that the script was developed specifically to pull trade histories onto the chart from the signal copying service from the metatrader developer, which are still directly in your platform.

Invisible feet. An expert who can keep your secret from a dishonest broker

One of the problems when working with brokers is the lack of output of transactions to the real interbank market, when all transactions are virtual and are carried out within the company.


Why would a broker do this, you ask? And what is the point of bringing traders to the real market if nine out of ten participants merge?

It is easier for a broker to arrange virtual trading and take the deposits of traders for himself, rather than give them to the market to be torn to pieces. There is practically no difference in trading within the company or in the interbank market if the broker withdraws profits.

But such a scheme of work presents a certain conflict of interest. After all, the company will never be interested in efficient traders, so unscrupulous brokers often interfere in the trade of traders.

The most important tool in the hands of a dishonest broker is a stop order and a trader's profit, which the company may not execute, reschedule or fix, as it is convenient for it.

Manipulating quotes in modern conditions is not possible, since such facts would be identified and made public very quickly, but the stop order and profit still remain the most vulnerable point.

Drawdown script. Be aware of what is happening on your account

Many traders pay attention to trading instruments, from trading strategies to forex advisors. However, in the pursuit of the Grail, stupid and ridiculous mistakes are often made, the price of which is a huge part of the trader's deposit.


For example, many do not even think about how important it is to track the situation on the account, because they think that the set profits and stop orders will always work.

And if only manual trading is used on the account, such a disregard is still excusable, but when advisors are used and full automation, any even the slightest failure that occurred due to a temporary disconnection can simply lead to terrible consequences.

However, not everyone can always be constantly at their monitor in order to track the drawdown on the account.

It is for this purpose that Push messages are provided in the trading terminal, and you can track the situation with their help using a special auxiliary script-advisor.

Binary Option open trade script. Instant opening of binary options trades

In the process of trading, it is very important to respond in a timely manner to the emerging strategy signals, as well as to open a position in time, so as not to miss a potential piece of profit.


It is especially important to work on the speed of opening deals for scalpers, as well as traders trading on the news, because at the time of the release of a certain economic indicator, the market covers a huge distance with lightning speed.

However, if the forex market has created a lot of scripts and assistant advisors that significantly implement this opportunity, then the binary options market can only dream of such opportunities.

Unfortunately, most binary brokers do not use a perfect trading platform, so many use additional terminals, which undoubtedly affects the speed of opening a transaction.

infopanel. Information script for MT4

In the process of trading, it is very important to have basic information right in front of your eyes.


The price of the asset, the size of the spread with the broker, the balance, as well as the profit on open positions, the number of open positions and the banal time until the close of the candle - all these small details, one way or another, are used in trading.

However, in the basic functionality of MT4, in order to find out about the same spread for the selected asset, you need to subtract prices yourself.

Moreover, if on four-digit quotes it is quite simple, then on five signs it is already difficult, and time is simply lost when you need to make a decision and conduct active trading.

Also, the function of displaying the time until the closing of the candle is one of the most important for traders trading binary options, but it is not available in the platform at all.

Script to move stop loss

One of the biggest problems faced by both novice and more experienced traders is the early exit of a position.


Such an approach to the market, in which the trader closes a profitable position at the slightest opportunity, leads to the fact that the ratio of risk to potential profit changes far from the trader's side.

The real way to deal with this situation is to use a trailing stop.

However, trailing, which is present in the classic form in the MT4 trading platform, is far from ideal, because at the moment when the price starts to correct, the position is closed early and profits are not received.

That is why many traders use two-way trailing, the essence of which is to move the stop order following the price at a certain distance from it. If you wish, you can automate the process if you use the StopLossMove script to move the stop loss.

Strategy evaluation script

Any trading trading strategy sooner or later lends itself to better testing for various indicators by the trader.


Profit factor, mathematical expectation, a series of profitable and unprofitable transactions, maximum and average drawdown, profit to loss ratio, as well as the average profitable and unprofitable transaction - all these indicators characterize the strategy and make it clear to the trader, as well as the investor, its potential.

Actually, in this article, you will get acquainted with a special script that will evaluate your trading strategy in a matter of seconds based on the history of your transactions and give it a qualitative assessment.

Tradingsystemrating is a custom script developed for the MT4 trading terminal, the main task of which is to evaluate your trading strategy, which is applied on the account.

The script evaluates a strategy to choose from using two methods. The first technique for evaluating a strategy was described by Van Tharp in the book “Super Trader.

The speed of opening a position plays a crucial role for traders who prefer news trading or scalping in sharp market jumps.


However, if the extensions for the MT4 trading platform called "One Click" allow you to quickly open a position, then you have to spend enough time setting stop orders and profits.

Such a delay for a trader whose profit is calculated in several points of profit is comparable to losses.

And if traders who trade with a static lot somehow smooth out this situation by quickly opening a transaction in one click, then what should a trader who uses a dynamic lot do, risking a certain percentage of risk per position?

The only way to solve the problem is to use auxiliary assistant programs, and in this article we are one of them.

Trading statistics with Iprofit Custom script

Each trader has his own goals, namely, someone stops trading after reaching a certain amount of profit, someone after reaching a certain percentage of the deposit, and someone stops trading after receiving a certain percentage of loss.


One way or another, no matter what strategy a trader uses, the main thing is to have clear tasks and limits that allow you not to give in to animal instinct and the desire to win back or conquer the forex market.

However, in practice, keeping such statistics is not easy, since on an ongoing basis you have to carry out additional calculations or register in special monitoring services.

That is why, in order to see all the trading statistics on the account and not resort to third-party services, special informational assistant indicators were created.

Volatility script

The volatility of a financial asset is the most underestimated characteristic of the market, because of which many traders fail.


The fact is that volatility displays the range of price movement in points for a certain unit of time.

Thanks to this indicator, each trader will be able to outline for himself certain goals that a particular currency pair can achieve during the day or even a couple of hours.

The VolScript volatility script is a special application for trading on the MT4 platform, thanks to which you can find out the current and average volatility in the market.

It is worth noting that, unlike many similar scripts and indicators that determine volatility, VolScript displays its hourly change, and also brings statistics by day.

Range Bars script. Remove market noise

The complexity of technical analysis, as well as the use of various technical indicators, is that the chart is simply oversaturated with market noise, which makes it quite difficult to assess the current market situation.


This is due to the fact that the chart construction we are accustomed to, whether it be candles or bars, is tritely tied to a time interval.

Yes, each new candle appears not because the price has overcome a certain distance, but because five or fifteen minutes have ended and even the minimum price shift is fixed on the chart.

That is why at the moment when the price is in a very narrow range, we can observe a series of horizontal candles, which do what they do to confuse every trader.

Due to the peculiarities of chart construction, indicators following the price can give a lot of false signals, because the instrument simply does not understand that the market is flat.

Script to reverse positions

In the process of trading, every trader is faced with a deceptive market maneuver, when at first glance a clear trend changes its direction in a matter of seconds.


Many traders accept their defeat and wait for a stop order to exit the forex market.

But you can also reverse the position, which will make it possible to profit from a new trend, while the amount of profit directly depends on how quickly the reversal is made.

Revers script is a great solution for traders who practice position reversal. Unlike many analogues, the script automatically remembers the volume and number of previously opened orders and performs a flip with exactly the same lot.

It is worth noting that this script is a universal tool and performs a one-time action, which does not overload your trading platform.

Indicator for screenshots of forex transactions

In the process of studying exchange literature, almost every author of the book advises his readers to start their own diary. Probably, you have repeatedly wondered why this is necessary, because the entire history of transactions is stored directly in the trading terminal and can be retrieved at any time in the form of a report.


However, it should be understood that the diary is not intended to preserve history, but to analyze it. We doubt that one of you, a month later, will be able to say why he opened a deal, what judgments he was guided by and corny, what mood he was in.

However, it is the work on oneself and one's mistakes that allows a trader to improve, improve his strategy and method of entering the market, identify patterns, and also identify his own vulnerabilities.

However, despite the fact that many agree to this step and start keeping a diary, they often do it wrong.

The vast majority of traders, and especially the older generation, keep their diary in a regular notebook or notebook, forgetting about the most important object of analysis - the trading chart at the time of transactions. Naturally, there is an opportunity to take a screenshot in the trading terminal, but this takes time and effort, which leads to the fact that the trader forgets to do this.

The best place to take profit - EasyTakeProfit

Many traders over-emphasize their own strategy entry system rather than exit points. No matter how strange it may sound, but the number of traders changing trading tactics one after another is simply thousands, but really those who thought about the reason for the loss of a unit deposit.


Often, two banal parameters like the profit level and the stop level can radically change the statistics of a forex strategy.

So, succumbing to emotions, many beginners set a too large stop order, or refuse it altogether. In the first case, with a large stop order, the ratio is violated, which subsequently leads to the loss of the strategy.

In the second case, the absence of a stop order generates the accumulation of a huge loss, which sooner or later will have to be closed.

With the increasing popularity of scalping among many traders, the practice of setting too small a stop order due to the unwillingness to lose a lot in one transaction has appeared.

Price movement speed script

When analyzing the foreign exchange market, it is necessary to pay attention not only to such characteristics as trend, flat and direction of price movement, but also to its speed in Forex.

Almost every practicing trader noticed that opening a series of transactions at different times of the day, but under the same conditions, the speed of its closing (reaching a profit or a stop order) will be radically different.

This is primarily due to the speed of price movement at a certain moment. So, if you are trading on the news, the speed of reaching a stop order and profit will be significantly different than when a deal is opened with the same goals and risks, but at a quiet time.

The price movement speed factor can directly affect the efficiency of the deals you open, because even experienced traders say that a deal is considered successful if it goes up in the first seconds, and does not stay in place.

How to write a forex script

Modern trading is already quite difficult to imagine without automation, and with the current level of development of computer technology, not only simple programs, but even artificial intelligence, which is capable of self-learning, come to the exchange.

However, if complex programs are affordable only for large hedge funds, banks and other large financial institutions, then simple software solutions such as scripts are affordable even for a student, and in most cases you can find a script for your tasks for free.

A script is a program that is designed to perform a one-time action. For example, if you have come across trading advisors, then you probably know that this program performs certain tasks as long as it is on the chart.

The script, on the other hand, differs from the Expert Advisor in the one-time execution of the command during drawing on the chart. Thus, the script can perform the task that the EA cannot handle.

For example, if you want to close only profitable trades from your series of open orders, then when you apply the script to the chart, the program will close only profitable trades once, when the EA will do this all the time.

GrailMeter script - measure the grailness of your robot

Almost every trader who is actively interested in automatic trading and various forex advisors has come across the so-called Grails.

Experts who show phenomenal results over a historical period, but in real trading conditions display a completely opposite result, are usually called the Holy Grail among stock market players.

As a rule, naive beginners who are prone to the desire for quick profit fall into the trap of the Grail.

The situation is quite typical, namely, that a person, having seen phenomenal results in the tester, puts an adviser on a real account and, due to increased trust and hope, quickly loses his deposit.

To avoid such situations, professional players always advise testing an Expert Advisor on a demo account before placing it on a real one.

GUI-Robot - automatic trading without programming knowledge

The modern realities of exchange trading are such that programmed algorithms have almost completely pushed traders away from manual trading.

As a rule, in modern realities, a trader is assigned the function of monitoring and confirming signals, as well as a master who will timely make changes to his pre-programmed algorithm.

However, the creation of an autonomous algorithm that can duplicate you and your strategy costs quite a lot of money, not to mention the fact that it is quite difficult for a programmer to explain what you want, since he writes programs, and has nothing to do with trading on the stock exchange.

Exhausted nerves and wasted money are just a small part of the troubles that you have to face if you yourself do not know the programming language. Of course, you can spend years learning the code, but you can go the other way.

Today, it is rather difficult to discuss the importance of graphical analysis, since even the most inveterate critic It is known that this tool has proven its effectiveness over time.

However, graphical analysis is a rather complicated approach, despite the clear, at first glance, the principle of constructing figures.

Do you agree that the head and shoulders in the book look so realistic that you can’t distinguish from a real person, but in the market, if you meet this once a year, it’s not anyhow what happiness.

The most common disease of traders, due to which dozens or even hundreds of accounts merge, is non-compliance disciplines in the field of capital management.

Moreover, I would like to separately note that it doesn’t matter if a trader uses an adviser or trades personally, the mistake of timely fixing profits and losses is common to everyone.

Separately, I would like to touch upon Expert Advisors, which for the most part use highly risky money management models like martingale or averaging, which leads to an instant loss of all funds.

Those traders who have ever encountered such robots know that in the event of a strong drawdown, you need to make a tough decision and fix the loss so as not to lose all your money. However, the banal hope that by opening the next order with an overvalued lot will lead to the expected resolution of the force majeure situation, we get a backlash to its aggravation.

One of the most striking trends in the analysis and trading in the financial markets is the use of the so-called grid strategies, all kinds of order pyramids and martingale.

The reason for this is the justified rejection of trying to predict the price, in favor of simply following it.

However, despite the wide popularity of these strategies, in practice their implementation is far from the ideal that is described in theory.

Trade high only with a leading broker

Dozens of pending orders in different directions, set distances and multiplication factors, as well as a constant series of deletions and additions of orders - in all this, even the devil will break his leg, not to mention beginners.

That is why such strategies are most often coded and used automatically.

However, a machine without a close look, due to a banal disconnection and a lost order, can fail sooner or later, so most traders prefer to trade in semi-automatic mode, and special auxiliary scripts help them with this.

Actually, in this article you will get acquainted with one of these scripts, which is an indispensable tool for all grid specialists and traders using averaging and martingale.

Pending Order Master is an auxiliary script for the Meta Trader 4 trading terminal, which allows you to place networks of pending orders of various types and at the same time set deeper individual conditions up to multiplication factors between orders, which is so necessary for strategies based on averaging.

The script itself is a universal development and will be useful to all categories of traders, since it can be used on absolutely all trading assets, be it stocks, currency pairs or indices.

It is also worth noting that the Pending Orders Master script can be used on all time frames, so it will be an effective tool for all strategies based on pending orders.

Installing the Pending Orders Master script

Despite the fact that it is practically impossible to successfully implement grid strategies with martingale elements in manual mode for a long time, the developers of the MT4 platform are in no hurry to correct this shortcoming and do not implement auxiliary scripts by default.

Therefore, to compensate for this weakness of the terminal, user scripts come to the rescue, and Pending Orders Master is one of them. In order to use it, you need to make a standard installation scheme.

The installation of Pending Orders Master is no different from the installation of any other user script and proceeds according to the standard scheme, namely, you will need to download the script file at the end of the article and place it in the appropriate folder of the terminal data directory.

You can find more detailed instructions for installing scripts, advisors and any other custom developments by clicking on the link.

In order for the trading terminal to see the script, it should be updated in the navigator panel or simply restarted. After restarting the platform

Pending Orders Master will appear in the list of scripts, and in order to use it, just drag the name onto the currency pair chart.

Principle of operation. Settings

The Pending Orders Master script performs a one-time action when it is applied to the chart, and the script can place both a series of orders at a certain distance from the current price, and at a certain price level, which will be specified directly in the settings.

The script allows you to open a grid of pending orders with both limit and stop orders.

Variables in the settings allow you to adjust the script to absolutely any trading strategy based on pending orders. So, in the Order Type line, a trader can choose one of four types of pending orders, from which he plans to build a grid.

The Lot variable allows you to set the position volume for the first grid order, while the number of grid orders can be changed in the Number of Orders line.

The Magic variable allows you to assign a unique code to orders, thanks to which auxiliary Expert Advisors, if used, can track and control trades opened by the script.

The Slippage variable allows you to limit placing an order with a large slippage of quotes, and the Multiplier variable allows you to change the order multiplier when using a martingale-based grid.

The Distance between orders variable allows you to change the offset in points between grid orders, and the Distance to the first order variable allows you to set the distance in points from the first order.

In the Use price for first order line, you can enable or disable the function of building a grid of orders from a given level, while the price level itself is set in the Price for first order line.

In conclusion, it is worth noting that the Pending Orders Master script greatly simplifies the process of working with

Manual trading in the Forex market is painstaking work that requires mental effort and time. This is especially true for scalpers and other traders who use lower timeframes to make a profit in the foreign exchange market. There are ways to automate routine actions of the same type. Scripts are used for this purpose. What are they and how to use them? How to simplify placing pending orders with a script? How to install the program in the broker's trading platform?

Forex scripts - what is it?

Scripts are trader's assistants that automate the usual routine processes, such as closing a large number of transactions with one click or placing stop orders. This is a regular program written in the same programming language as an Expert Advisor or an indicator. Scripts are less popular only because of the lack of sufficient knowledge of their capabilities among traders. How does the script work?

Unlike the Expert Advisor, which also works in automatic mode according to a given algorithm, the script works a little differently. It is aimed at a one-time action. In order to perform the action again, you will have to re-run the script. Only in this case, he will again do the necessary actions that are embedded in his algorithm.

Scripts cannot be called a miraculous pill that can work on the foreign exchange market instead of a trader. They have rather limited opportunities, but it is hard to overestimate the help that they can provide to a trader. So, you can delete pending orders using scripts and create a grid from them, close only profitable deals, delete all plots from the working chart of a currency pair, set a stop loss at the breakeven level, and so on. The script functions for traders who prefer active trading are more than enough to simplify the work.

Installing scripts in the trading terminal

Installing the script in the trading terminal is as simple as installing an indicator or an adviser. It is necessary to act according to the same algorithm. Initially, you need to open the "File" menu and select the "Open data directory" item. This will take you to the root directory of the trading platform (terminal installation folder).

In the folder that opens, select the MQL 4 folder and place the script file in the corresponding folder. She and is called - Scripts. After restarting the trading platform, the script will appear in the corresponding drop-down menu in the navigation window of the MetaTrader 4 trading platform. To activate it, you need to drag the script onto the working chart. After these steps, he is ready to go. This is how it looks in practice (screenshot from the terminal of the company Forex4You).

Pending orders

There are a lot of tools for automatically placing pending orders with a script, both simple and complex. The script called Remove Pending Order removes all pending orders on its own. It does not need to be configured (it has no settings options).

The Open Buy Sell Order script is able to open two pending orders in the opposite direction. The reference point is the current price. It has customizable options. If you use trading strategies based on breaking through levels, a price corridor, then you will surely appreciate such a script.

The following script can open a grid of pending orders in one go. Its name is OpenStopOrderNet. It has several customizable options. In the settings, you can set the size of stop loss and take profit in points. If you specify the number 0 in this line, no losses and profits will be fixed. You can also specify in the settings the maximum number of orders in the grid, the distance between them, the volume of the transaction and the type of order (Sellstop or Bystop).

Another script called CloseStopLimitOrders ensures that all orders are closed. It does not need to be configured, since it does not have parameters for configuration.

The following pending order script called cm script OpenGread also performs the function of opening a grid of orders, but it has a larger set of functions. So with its help, you can set the time of placing an order and its lifetime, different distances between transactions, the coefficient of increase in the lot of opened orders, the number of attempts that the script must make before opening a transaction.

The algorithm of the scripts is similar to the algorithm of the Expert Advisors, however, the scripts are designed only to simplify and facilitate the work, and the entire responsibility for the financial result lies with the trader. With their help, you can automate only part of the processes, but they only mechanically perform the task, and this differs from advisors.

Remember that the profitability of trading is very dependent on

The MQL programming language, which is used to translate algorithms into functions understandable for MetaTrader, is used to write not only indicators and Expert Advisors, but also scripts. With their help, any one-time operation is performed, after which they are turned off. In this article you will be able download script for deleting pending orders and learn how to use it correctly.

Recall that pending orders (OO) are a special type of orders given by a trader to the trading terminal, which leads to the opening of a position not immediately, but under specified conditions. Most often, these conditions are understood as a specific level, at which the quotes reach a transaction. Many trading strategies are based solely on the use of pending orders.

For example, channel TS, the varieties of which involve trading on a pullback or a breakdown, involve placing pending orders at the boundaries of the channels. Another example of using pending orders is trading using the Martingale principle, according to which a position is sequentially opened when the quote passes a certain interval.

When a script is required to remove pending orders

When trading with the described methods, a very large number of pending orders can be placed (especially in short-term Martingale trading). At the same time, after the occurrence of certain events, it is required to quickly remove those that did not work. Doing it manually is quite laborious and time consuming. It is for such cases that the script for deleting pending orders is intended (download ) called Delete All Pending.

Best Broker

To use it, you must first place it in the Scripts folder, which can be found in the MQL4 section of the MT4 data directory (Fig. 1). Then you should mark all the items of the "Expert Advisors" tab of the "Settings" window, opened from the "Service" menu of the terminal. After that, in the "Scripts" section of the updated "Navigator" window (you can update it from the context menu or by restarting MT4), you need to find the required script (Fig. 2) and apply it to the required asset chart (this is done by dragging the script onto the chart or by double-clicking the left mouse button on the script name). As a result, all currently pending failed orders will be deleted.


Script for deleting pending orders by time

Some TS require pending orders to be active only for a specified period of time or until a certain moment (for example, until the end of a specific trading session or the current trading day). In this case, you should use the DelOrdersAfterVLine script (download ). Its activation leads to display on the chart at a distance of 10 candles from the current red vertical (Fig. 3). When it is reached, all pending orders will be canceled.


The moment of cancellation can be changed by moving the red vertical. This is done with the mouse - its pointer is directed to the vertical, the right button is pressed and the movement is made in the required direction. The script additionally calculates and displays the time (in seconds) at the top left of the chart window, after which the OO will close.

Other scripts for pending orders

In addition to the need to quickly delete pending orders, there is often a need for their quick placement (for example, to form a grid of pending orders). The following two scripts can be used for this purpose:

  1. LimitOrderGrid (download );
  2. StopOrderGrid (download ).

The first one ensures the formation of a grid of limit pending orders. In this case, if the script placement level is higher than the current price, then a grid of pending orders of the SellLimit type is built (Fig. 4), and if it is lower, BuyLimit is built (Fig. 5).


The second one ensures the formation of a grid of stop pending orders. If the script is placed above the current price level, then a grid of pending orders of the BuyStop type is formed (Fig. 4), and if it is placed below it, SellStop is formed (Fig. 5).

These two forex pending order scripts have input parameters:

  • the number of created OOs;
  • distance in points between neighboring TOEs;
  • StopLoss and TakeProfit OO (if they are not needed, then their values ​​are set to 0);
  • the volume (in lots) of the initial TOE;
  • multiplier for calculating the volume when averaging (according to Martingale).

(( reviewsOverall )) / 5 User rating (0 votes)

Your browser does not support images upload. Please choose a modern one

Today it is difficult to start trading in the Forex market without the use of advisors. However, sometimes it is necessary to use special scripts that help these tools to trade on the market.

In this article, we will look at scripts for placing a grid of pending orders. And to begin with, let's take a closer look at what they are and why they are needed at all.

What is an order in the Forex market?

In essence, an order is an order for a dealer to perform an operation to buy or sell a currency. In the foreign exchange market, two order options are noted. First - .

However, defining an order is quite simple. To do this, remember one simple rule. The order option is always determined directly in relation to the current value at the moment it is placed.

If you need to buy higher or sell lower, then we are talking about Stop/Loss. In the case when you should sell higher and buy lower, we are talking about Take / Profit.

At the same time, it is important to know that, depending on the purpose of a particular order, it can always be qualified as a simple mutually cancelable order and directly by execution.

So, simple order, (otherwise single) is used directly to enter or exit a position when the market reaches the value set in it. It is important to consider that an order can be placed no more than and no closer than ten points from the current market price.

Considering that traders always sell at the bid price and buy currency at the ask price. Mutually cancelable orders are a combination of the orders mentioned above. Usually this class of orders is placed when there is an open position. And it is necessary for better control over the position.

Its main advantage lies directly in the fact that when using this tool, if you use one order, the second one is automatically canceled. Execution orders are a bunch of several orders, in which one is simple, and one is mutually canceled, in some cases, maybe even two.

The peculiarity of this bundle is that the user does not need to constantly sit at the computer monitor to monitor the market. The dealer himself can open a position for you, and then control the state of this position until the moment any order in this bundle is triggered.

Pending order - types, commands

Now let's talk directly about the pending order. In fact, this is an order to the dealer to sell or buy a currency at a given price for a given number of lots when a certain type of price is reached.

Pending orders

As a rule, the New Order window is called to place pending orders. To do this, perform the following procedure. Find the “Service” command and then select the “New Order” section. After completing these tasks, you must press the F9 key. You can now double-click on Market Watch.

As for the “Order” window that opens, the option called “ Pending order". It is important to correctly fill in all the fields that relate to this section. After that you can start the installation. Do not hurry. You should gradually wait for confirmation of the acceptance of the order from the selected server. Information indicating the successful placement of the order should appear in the trading terminal window. Now, having familiarized ourselves with the basic concepts, we are ready to reveal the main essence of this article.

Scripts for placing a grid of pending orders. Easy Installation

This installation option provides for the installation of pending orders only with the mouse. This script allows the user to place pending orders directly in the trading terminals using only the mouse.

This really greatly simplifies the operations associated with installation, because you are given the opportunity to visually see where the value of the currency is located in a certain period of time. In addition, you get the opportunity to make all the adjustments and parameters necessary for the trading process.

The script for placing pending orders is a very convenient tool with which you can immediately set not just one order on the chart of the selected currency pair, but also settings that will help in triggering StopLoss/TakeProfit orders.

Basic settings of the script for placing (installing) a grid of pending orders

First of all, you should talk about the choice of positions. In this section, you can open either exclusively short positions, or, conversely, only long positions. At the same time, Long is the value of only buying, and Short is the value of orders exclusively for selling.

It should be understood that if you decide to choose Long and Short, then 2 pending orders may appear on the given chart, and in different directions.

Stop-loss allows you to set a risk indicator in advance, which will allow you to save a lot of money in some unprofitable transactions.

Take-profit is also an important value that refers to a take-profit order. It is responsible for determining the amount of profit, especially when determining the amount of profit within which automatic closing of the instrument is achieved.

Slippage is an indicator of slippage.

In addition to these settings, there are also a number of other parameters, however, which are of less importance. Therefore, if you wish, you can find information about their settings, but they are of little use in trading. As for the script given in the example, I would like to note that it functions remarkably well in the MetaTrader 4 database.