Brief #
This is a tool to compress overgrown orders.dat file in place.
It has few modes:
- remove orphaned orders (where login equals to zero);
- remove expired pending orders;
- aggregate closed orders profit;
- aggregate balance orders profit;
- aggregate expired (on current date) credit operations profit.
It reads the file directly from disk and writes a compressed database back to disk. By default, it will make a backup of the original database. The tool uses users.dat database to perform double check its algorithms with relevant users' balances twice: on start and at the end.
It needs MT4 server to be stopped, to unlock database files to let the app read and write them.
Be aware, orders will be physically deleted from the database to reduce its size. Never delete backups until you are 100% sure you don't need them. Or else, you will not be able to rewind one step back and will need to take standard MT4 daily backups.
There is an option to specify user groups by using -groups
parameter with corresponding regular expression. Same option (-logins
) available for logins.
Files can be downloaded from our website: http://nuget.cplugin.com/feeds/apps/CPlugin.Tools.CompressMT4DB/versions
Licensing #
The license grants usage of the tool on a single computer.
But, even without a license, the program will run in read-only mode to calculate and demonstrate a possible result. You are welcome to try without worrying about your files consistency and to estimate outcomes in your environment before purchase.
Quick start #
To try out, how lesser your database might become after tool you can run it in read-only mode and do not specify starting and/or ending date. But you have to specify explicitly each mode you are going to use.
CPlugin.CompressMT4DB.exe -orders=c:\metatrader4\bases\orders.dat -users=c:\metatrader4\bases\users.dat -balance -closed -credit -orphaned -pending
Whenever you satisfied with results you can run in read/write mode by specifying -go flag.
Usage: #
example of included help by running app with '-?' parameter
Utility to compress orders.dat
-? : This help
-go : permit tool make its job, otherwise read-only mode will be used
-orders=<value> : full path to 'orders.dat' file
Type:System.String, Default value:'orders.dat'
-users=<value> : full path to 'users.dat' file
Type:System.String, Default value:'users.dat'
-nobackup : do NOT backup current file
-balance : compress balance trades
-closed : compress closed trades
-credit : compress credit trades
-orphaned : delete orphaned trades
-pending : delete expired pending orders
-groups=<value> : user groups to proceed (MQ mask)
Type:System.String, Default value:'*'
-logins=<value> : user logins to proceed (MQ mask)
Type:System.String, Default value:'*'
-starting=<value> : starting date
Type:System.String, Default value:'01.01.0001'
-ending=<value> : ending date
Type:System.String, Default value:'31.12.9999'
It uses formula of [starting, ending)
way for looking a time being within range or not.
Also, spaces not allowed in parameters. So `starting` and `ending` field could only contain a date.