Scripts: CloseAll

 

CloseAll:

A collection of scripts for closing various types of orders.
  • closeall_comment - closes all orders based on a specific comment
  • closeall_loss - closes all orders that whose profit/loss goes over a specific loss threshold value
  • closeall_loss - closes all orders that whose profit/loss goes over a specific profit threshold value
  • closeall_magic - closes all orders by order magic number
  • closeall_market - closes all market orders
  • closeall_pending - closes all pendingorders
  • closeall_complete - contains all the features of the 6 scripts + option for closing for symbol

Author: Enrico Lambino

 

Hi Enrico, can you please help me install the script I do not know how.

 
PKTrading:

Hi Enrico, can you please help me install the script I do not know how.

Hi,

To use the install the software on your platform, you may use either by installing directly from MetaEditor (http://www.metatrader5.com/en/metaeditor/help/interface/toolbox/toolbox_codebase), or by manually downloading the source and header files. After installation, you will need to compile the main source file to be able to use it on the platform.

I am working on a market version for this script. I will let you know as soon as it gets published by MQ. That way, users can readily get the executable installed on their platforms. 

If you have any questions or suggestions, just let me know.

Regards,

Enrico

 
Hi If i can use this to close an open order, will it repeat with every open order that crosses a threshold, which will be a Moving Average line. How do i adapt the script to include the moving average. You can guess i`m still learning coding so excuse my lack of knowledge !
 
Hi, if you use this as a script, no, it would not close it. The scripts self-terminate once their task is complete. However, if you are going to incorporate the code to an EA, it would largely depend on how you program the expert advisor on using the functions used by this script.
 

Thanks

good collection

*****

5 stars 

 

when a close all script is chosen does it take into consideration FIFO? I have tried several other scripts to close all open trades, but they close first in first out. This is how it is in U.S.

Reason: