Automatic closing of all profitable positions
This script allows you to automatically close all profitable positions in your trading terminal. However, orders are only closed when a certain profit level in points is reached.

This means you can't just click your mouse and close all your profitable trades; it's essentially a take-profit , but with more advanced features and settings.
It can be used if there is a fast trend in the market and you simply do not have time to manage orders physically
For example, if there is an upward trend, we open a buy position, the trend continues, profit continues to grow, then we open another order, and in the script settings we specify a profit of 10 points.
As soon as the price reaches the required value, one order will close, followed by another.
Setup.
Setting up this script is quite simple and has only a few parameters:
Positions – close all positions regardless of direction, close only short or only long.
Allow the advisor to trade – this checkbox must be checked after each order is closed, otherwise the script will not work.
Profit – the amount of profit in points, after which the closing will occur.
Overall, it's a pretty handy tool, but it takes some getting used to, but when tested in MetaTrader 4 it worked fine.

