The goal of this script is to minimize risk in all situations, especially when the shit hits the fan. This script provides the best and the fastest possible risk mitigation available thru MT4 by utilizing some unique logic not found in any other close-all scripts.
Operation Summary:
Operation Summary:
- Net positions are calculated per symbol (sum of all open trades).
- Symbols are prioritized to manage net-positions from larger (more risk) to smaller.
- Hedge orders are sent in the order of priority to close all exposure at once regardless of the number of trades.
- Once all open-expo is hedged the program prioritizes pending orders
- Pending orders are deleted in order of highest risk of being executed
- Remaining hedged positions (closed by hedge) are then reconciled on the broker server and there are no costs/spread/commissions charged on the hedge (it is literally treated like a closed position)
Note: This only works on non-FIFO hedging brokers. I have also included a different script that closes orders on FIFO brokers (slowww compared to hedging brokers).
You may also like the Hedge Trade Panel
Attached File(s)
FIFO_CloseAll_Options.mq4
3 KB
|
865 downloads
HedgeAccountCloseAll.mq4
7 KB
|
999 downloads