VR Close Orders - Close and delete all orders
The VR Close orders script is designed to close positions in the terminal at a profit or loss mark set by the trader. The program is written as a script and can work together on the same chart with any other indicators and expert advisors. The program has a simple visual panel and is easy to configure with the mouse. With this program's help, the trader can automatically close positions and delete orders depending on the conditions set.
There is often a situation when you need to close positions of a working expert advisor. the VR Close Orders script will help you close positions in profit, loss, or all at once with the specified settings
- It can close positions based on profit in points, percentage of the balance, and profit in the deposit currency.
- It can close positions on a loss in points, a percentage of the balance, or a loss in the deposit currency.
- It can work together on the same chart with another expert advisor or indicator.
- It can close positions one at a time or all at once under the specified conditions.
- It can be used to open locks.
- Suitable for both beginners and professionals.
- It can work with any financial instruments (Forex, Crypto, CFD, Futures, Metals).
- It can work on any timeframe.
Algorithm of operation
The script's algorithm may seem complicated at first glance, but it's actually quite simple.
Closing positions on profit.
- Profit button - activates the function of closing positions on profit.
- Input field - the trader enters the value of the desired profit in points, percentages, or deposit currency.
- Buttons for selecting the type of profit - P - points, % - percentage, $ - deposit currency.
- Buy button - tells the script to close only those positions for which the profit is greater than or equal to the one set by the trader.
- Sell button - tells the script to close only those positions for sale that have a profit greater than or equal to the one set by the trader.
- All button - tells the script to count the total profit and close all positions if the total profit is greater than the specified one.
- Buy + All buttons - tells the script to close all buy positions if their total profit is greater than the one set by the trader.
- The Sell + All buttons - tells the script to close all positions for sale if their total profit is greater than the one set by the trader.
- The Buy + Sell + All - tell the script to close all buy and sell positions if their total profit is greater than the one set by the trader.
- Check mark button - confirms the application of settings and activates the script.
Important note for Buy + Sell + All, if the amount of lots for buying and selling is the same, this mode will not work. Reason: the same volume of lots to buy and the same volume of lots to sell make it impossible to make a profit or loss, since all positions are fully locked.
Closing a loss position.
- It works the same way as closing a profit position, only the loss value is specified in the input field.
Additional buttons and capabilities of VR Close Orders.
- The Delete Pending button - indicates to the script an additional action, after closing all market positions, to delete pending orders if there are no market positions.
- Push button - tells the script to send a message to the smartphone about the script completion.
- Goggles button - Displays information about current And closed positions.
- Check Mark button - confirms the application of settings and activates the script.
This program is a script for closing positions and orders, the profitability of such a program can not be calculated.
It would be a good solution to assign scripts a hotkey in the MetaTrader terminal. This way you will always be able to close all orders and positions as quickly as possible.
- Magic Number - filter by unique order number:
- -1 - all orders (expert Advisor Orders + orders opened manually);
- 0 - only orders opened manually;
- >0 - number of orders opened by another expert Advisor.
- Slippage - slippage.
Version 20.103 - 14.10.2020
Update history - latest 5 versions
Version 20.102 - 13.10.2020
Version 17.031 - 30.03.2017
Fixed the behavior of settings:
When setting the value for closing by profit (Profit = Value) equal to the value (Value), the value Off was previously dropped.
To hide the update history
At the moment, there are no plans for further development.
You can suggest an idea or revision in the "Reviews and discussions" section.
How to test
You can't test the script in the strategy tester, but you can test it on a training or demo account. To conduct tests, it is enough to open a large number of different types of orders on a demo account, and then run the script. You can open a training account with any of our partner brokers.
What's in the archive
For MetaTrader 4
- VR-Close-Orders-RU.ex4 - Russian version program file
- VR-Close-Orders-EN.ex4 - English version program file
For MetaTrader 5
- VR-Close-Orders-RU.ex5 - Russian version program file
- VR-Close-Orders-EN.ex5 - English version program file
- VR-Close-Orders-RU.pdf - user's manual in Russian
- VR-Close-Orders-EN.pdf - user's manual in English
Question:how do scripts differ from expert advisors and indicators?
Answer:Unlike expert advisors, which work all the time, a script works once, so you run a script, it does its job and deletes itself. This is a one-use code. There are ways to loop scripts, that is, the script runs until the user deletes it. You can also delete looped scripts when you change a financial instrument or chart period. The advantage of looped scripts is that they can work even if another expert advisor is already running on the chart. The script works in the general flow of the terminal.
Reviews and discussions