The script closes all positions for which the profit is more than 5 pips. It only works on an open pair (on an open chart).
The terminal must have the “Algo Trading” mode enabled.
It is effective if there are many open positions that need to be closed quickly.
The script does not replace the trailing stop or the Expert Advisor. The script checks all open trades and closes those that meet the condition (profit greater than 5 pips) once at the time of launch.
For the subsequent closing of new profit positions, you need to run the script first.