Order Book, known also as Market Book, market depth, Level 2, - is a dynamically updated table with current volumes of orders to buy and to sell specific financial instument at price levels near Bid and Ask.
MetaTrader 5 provides the means for receiving market book from your broker, but in real time only, without access to its history. The library OrderBook History Library reads market book state in the past from archive files, created by OrderBook Recorder. The library can be embedded into your indicators and expert advisers (source codes are required), and then they can be tested with the market book data in the tester.
In particular, the library is used in the indicator OrderBook Cumulative Indicator and demo expert adviser OrderBook History Playback.
Here is an example of the header file for including the library into your MQL program:
input string OrderBook_FileFolder = "Books"; input bool OrderBook_UseCommonFiles = false; input int OrderBook_TimeZoneCorrection = 0; typedef void (*pOnBookEvent)(const string &symbol); #import "OrderBook History Library.ex5" void OrderBook_Init(pOnBookEvent ptr, const string folder, const bool common, const int offset); bool OrderBook_MarketBookAdd(string symbol); bool OrderBook_MarketBookRelease(string symbol); bool OrderBook_MarketBookGet(string symbol, MqlBookInfo &bookArray[]); long OrderBook_MarketBookPeek(string symbol, MqlBookInfo &bookArray[]); void OrderBook_OnTick(); void OrderBook_OnTimer(); bool OrderBook_CheckForEvents(datetime current); #import #ifdef ORDERBOOK_SUBSTITUTE #define MarketBookAdd OrderBook_MarketBookAdd #define MarketBookRelease OrderBook_MarketBookRelease #define MarketBookGet OrderBook_MarketBookGet #endif
The input parameters are defined for convenience - they should be passed into the function OrderBook_Init.
Functions
Adding the line #define ORDERBOOK_SUBSTITUTE into the source code before including the header file will implicitly replace all calls of the standard market book function with corresponding library's functions.
Due to a well-known bug of MQL5 Market, all libraries are downloaded into MQL5/Scripts/Market folder, not into MQL5/Libraries, where they should be. Please copy the library's ex5-file manually into MQL5/Libraries folder in order for imports to work properly.
If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: support@fx-market.pro.
Refund requests received more than 30 days after purchase will be rejected.