• Overview
  • Reviews
  • Comments (2)

SlippageControl Library

The library is designed for collecting data on the slippages of orders. It is great for the developer to use in scalper experts. The data is collected to a certain user-defined file. The library is useful for fast assessment of order execution of a broker, can be easily included in an EA. It collects the data on slippages of both the pending orders (OP_BUYSTOP, OP_SELLSTOP, OP_BUYLIMIT, OP_SELLLIMIT), and also market orders (BUY, SELL).

The saved file is available in the folder (press "File" -> "Open Data Folder" in the terminal menu):

<Data folder>\MQL4\Files\

Importing functions from the library

#import  "SlippageControl.ex4"
  void SlippageCheck(int theMagic, string theSymbol, string fileName = "Slippage.csv");

Function parameters

  • theMagic - magic number of the EA (for monitoring its orders)
  • theSymbol - the symbol the EA will work on, it is possible to use NULL
  • fileName - the name of the file to store the data

Example of usage in experts

void OnTick()
   SlippageCheck(Magic, NULL);



The loss/profit in the deposit currency during slippages is also written to the file.

Restrictions and conditions

Only the slippages of market orders closed by stop loss are considered. The slippages of orders opened or closed manually or using OrderSend() / OrderClose(), in experts, are not considered. Slippage are calculated for five-digit quotes (in points)

No reviews