OrderBook Utilities
- Utilities
- Stanislav Korotky
- Version: 1.3
- Updated: 9 May 2020
OrderBook Utilities is a script, which performs several service operations on order book hob-files, created by OrderBook Recorder.
The script processes a file for work symbol of the current chart. The file date is selected by means of the input parameter CustomDate (if it's filled in) or by the point where the script is dropped on the chart. Depending from the operation, useful information is written into the log, and optionally new file is created.
The operation is selected by the input parameter Operation:
- Check - verify all records for validity; incorrect books can be received from the terminal quite often, for many reasons; potential errors, which the script is capable of fixing, are listed below; Check operation does not fix the problems, but outputs common information to the log; to view details, enable PrintDetails mode; except for the errors, the operation outputs statistics on books with zero spread and books with overlapped Bid and/or Ask levels; please find examples on the Comments tab;
- Fix - correct the file by eliminating problematic records (entire book event is removed); critical errors or suspicious data are deleted (see classification below); the fixed version is saved in a file with the same date but double extension.hob.fix;
- Pack - minify the file; can be useful for sending the file to someone else, and minimizing network traffic; minified file is saved with.hop extension;
- Unpack - restore a hob-file from minified hop-file;
- Export - save entire archive as csv-file; can be useful for editing, context search and comparision, merging;
- Import - restore a hob-file from exported csv-file;
Check types
Critical errors are marked in bold.
- Duplicates of a book, i.e. 2 exactly matching records (without changes) in a row;
- Incorrect order of Sell and Buy levels, i.e. they break the structure of 2 halves, each one of which contains only orders of the same type;
- Incorrect order of prices in either half of the book;
- Duplicate elements in the book, i.e. with the same prices and types;
- Empty book;
- Single level book;
If critical errors are not fixed, the file can not be packed.
Parameters
- Operation - one of the operation types: Check (by default), Fix, Pack, Unpack, Export, Import;
- FileFolder - a name of the root folder, where subfolders and files of the market books are stored; by default - "Books"; every subfolder is named according to specific work symbol;
- UseCommonFiles - an option for processing files from the data folder of the current terminal (false, by default) or from the common data folder for all terminals (true);
- CustomDate - a day, uniquely identifing the work hob-file (files are created one per day); by default - 0 (in MT5 user interface this is shown as '1970.01.01 00:00:00'), which means, that the day is selected according to the point, where the script was dropped on the chart; for example, if the script was dragged from Navigator and then dropped on 2018.08.01 on a chart, then the file 20180801.hob will be processed; when parameter CustomDate is filled in, then this date is used, and the point where the script is dropped has no effect;
- MinimalBookSizeFilter - minimal book size to save during Fix operation, by default - 0, i.e. no filter, and books of all sizes will be preserved;
- PrintDetails - an option to enable detailed logging, by default - false;
User didn't leave any comment to the rating