Close All Trades Script

To add comments, please log in or register
gkozlyk
328
gkozlyk  

Is there a way to create (unless one already exists) a script that can be run to close all open trades of all currencies? When one is testing an EA over multiple pairs (the ability to open trades), one needs to "reset" so that there aren't open trades. Is there a way to create a script that can do this.

Thanx

Sergey Golubev
Moderator
110457
Sergey Golubev  
gkozlyk:
Is there a way to create (unless one already exists) a script that can be run to close all open trades of all currencies? When one is testing an EA over multiple pairs (the ability to open trades), one needs to "reset" so that there aren't open trades. Is there a way to create a script that can do this. Thanx

There is some thread here https://www.mql5.com/en/forum/173000

But seems these scripts do not work for some people. It works for me and I really don't understand why.

gkozlyk
328
gkozlyk  
newdigital:
There is some thread here https://www.mql5.com/en/forum/173000 But seems these scripts do not work for some people. It works for me and I really don't understand why.

Very helpful. Thanks

WNW
632
WNW  

"CloseOnTime" SCRIPT?

Attached is the "CloseOnTime" EA.

I'd like to attach this to one open trade only.

Can someone please convert this to a script for just one position?

Thanks.

Files:
Kevin Lynch
107
Kevin Lynch  

This shoul do the trick just enter the order number in the external variable Order_Ticket

Files:
Sergey Golubev
Moderator
110457
Sergey Golubev  

The other EAs from the same author (KimIV):

- EA to close all the orders by percent of the profuit and close Metatrader after that automatically.

- Open on time. EA can opne the order at selected time:

TimeTrade="19:51" - time to open the order

Sell=False - True - Sell, False - Buy

MagicNumber (it has magic number option)

NumberAccount=0 (0 - any account)

WNW
632
WNW  
faqcya:
This shoul do the trick just enter the order number in the external variable Order_Ticket

Excellent! Thanks very much.

To add comments, please log in or register