![DESCRIPTION OF THE PARAMETERS OF THE ARBITRATION ADVISOR LATENCY ARBITRAGE MT4 / MT5 DESCRIPTION OF THE PARAMETERS OF THE ARBITRATION ADVISOR LATENCY ARBITRAGE MT4 / MT5](https://c.mql5.com/6/826/splash-724958.jpg)
DESCRIPTION OF THE PARAMETERS OF THE ARBITRATION ADVISOR LATENCY ARBITRAGE MT4 / MT5
26 February 2019, 23:09
![Volodymyr Hrybachov Volodymyr Hrybachov](https://c.mql5.com/avatar/2024/7/66a25230-55a2.png)
2
1 034
Let's get straight to the point.
Installation Advisor:
The Expert Advisor is installed as usual: drag from the navigator to the selected chart of the currency pair. After you have installed the adviser, a gray button will appear in the upper right corner.
![](https://c.mql5.com/6/826/yrz13u88fpd_2npz3p9nc94_2019-2-26_22-6-37.751.jpg)
The button in the upper right corner is for display / hide information. By default, the adviser works in data transfer mode. Writes the Ask price, Bid price, the size of the spread and the arrival time of the last tick to the file.
![](https://c.mql5.com/6/826/7dqbgoqm6nc_79n4p6q3wz8_2019-2-26_22-10-13.167.jpg)
Install the adviser on at least 2 different brokers.
On the lagging broker (presumably), enter the number (s) of the trading account to be connected (presumably the fast broker) in the field ACCOUNT_NUMBER _1,2,3,4,5.
![](https://c.mql5.com/6/826/8xxe9vy1mmh_w8lxwmwzz6m_2019-2-26_22-20-43.787.jpg)
If you did everything correctly, then the chart will display information that comes from connected brokers.
DEVIATION is the current price deviation.
DELAY is the delay in milliseconds.
MAXIMUM, MINIMUM - the maximum and minimum deviation.
The maximum and minimum deviation should be at least 2 times larger than the size of the current spread, and the delay should be greater than the ping to your broker.
The red and yellow buttons (by default) are used to reset statistics and align quotes, respectively.
After you have made a visual analysis, determined which quotes you will work with, you will have to set deviations, set up closing orders and allow the quotation provider to start trading, the parameter USE_DATA_FEED_1,2,3,4,5
![](https://c.mql5.com/6/826/xr3sktjwet0_ty5ni3xm40a_2019-2-26_22-38-11.934.jpg)
After you allow the advisor to trade, additional information will appear about the speed of order execution and slippage.
![](https://c.mql5.com/6/826/inj555lzegd_mj9zd7zdd8f_2019-2-26_22-38-34.499.jpg)
This is important information that you need to constantly monitor. To automate this process, the advisor provides protection:
The Expert Advisor will stop losing trading if the number of unprofitable orders in a row exceeds the specified value.
If the broker uses the plugin and deliberately slows down the execution of transactions, the adviser will automatically stop trading.
The EA will automatically stop trading if the slippage is greater than the maximum value you specify.
The EA stops trading if the profit or loss is equal to the specified maximum values.
Options:
TERMINAL_SLEEP_MS - The function allows you to reduce the speed of reading the code in the advisor, but the faster the speed of reading the code, the more powerful the server you need. Set in milliseconds, recommended value = 20.
PING_TO_SERVER_MS - Ping to your broker in milliseconds, you can see it in the lower right corner by clicking on the icon "Connection status";
![](https://c.mql5.com/6/826/wbpsj11aldm_lzkywtpv2tm_2019-2-26_21-44-15.689.jpg)
ACCOUNT_NUMBER _1,2,3,4,5 - The number of the trading account of the connected broker, you can connect up to five brokers simultaneously;
AUTO_SHIFT_BID - Automatic alignment of quotes. If the function is enabled, the Expert Advisor will automatically equalize the quotes when the time of the last tick exceeds the value LAST_BID_UPDATE;
LAST_BID_UPDATE - The elapsed time since the arrival of the last tick is specified in milliseconds;
SHIFT_BID _1,2,3,4,5 - If a AUTO_SHIFT_BID = false; manual quotation alignment settings are used;
USE_DATA_FEED _1,2,3,4,5 - What data to use for trading;
CHECKING_DELAY - Check the delay before opening a transaction. If the function is enabled, and the delay with a “-” sign, the transaction will not be executed;
TRADE_DIRECTION - The direction of trade. BOTH - both Buy and Sell orders, BUY - only Buy orders, SELL - Only Sell orders;
DYNAMIC_DEVIATION - Automatic calculation of the value at which the adviser will go into the transaction;
DEV_COEFFICIENT - Spread ratio to calculate the dynamic indicator DYNAMIC_DEVIATION;
MIN_DEVIATION _BUY, SELL - The minimum gap in quotes in points, at which the adviser enters the transaction. (if a DYNAMIC_DEVIATION = false);
MAX_DELAY_TICKS - The maximum delay in the arrival of a new tick to complete a transaction is specified in milliseconds;
MIN_OPENING_INTERVAL - The minimum interval between the opening of new orders in milliseconds;
MAX_OPEN_ORDERS - The maximum number of simultaneously open orders for one trading instrument;
MAX_SLIPPAGE - Maximum slippage when opening a transaction;
COMMISSION_CONTROL - If your broker has a transaction fee, set the COMMISSION_CONTROL flag = true. To check the commission, the adviser will immediately open a trade with the minimum lot per symbol. Do not be scared. This will happen only once;
COMMISSION_IN_PIPS - You can set the commission amount for the transaction manually, then the adviser will take into account this value when opening and closing orders, specified in points;
MAX_SPREAD - Maximum spread when opening a transaction;
MAGIC_NUMBER - Magic number of the transaction;
ORDER_COMMENTS - Comments of the adviser in the order;
WHEN_PRICE_EQUAL - The function does not allow to close an order as long as the price gap between the fast and slow supplier of quotes persists. It makes it possible to increase the profit from each transaction by 2 times compared with the standard settings. When this mode is enabled, the advisor will close the deal only when the gap of quotations returns to the normal value (the gap will disappear);
CLOSE_MODE - Order closing mode if WHEN_PRICE_EQUAL = true
In BID_ASK mode:
The Sell deal closes when the Bid of the supplier is greater than or equal to the Ask broker;
The Buy transaction will close when the supplier’s Bid is less than or equal to the broker’s Bid;
In BID_BID mode:
A Sell deal closes when the supplier’s Bid is greater than or equal to the broker’s Bid;
The Buy transaction will close when the supplier’s Bid is less than or equal to the broker’s Bid;
CLOSE_ORDER_DELAY - Minimum transaction duration in seconds. If your broker prohibits transactions of less than 1 minute, set this value to 60 seconds. Then the transaction will not close within 60 seconds;
USE_MAX_TAKEPROFIT - Use the maximum take profit, the value is taken from the maximum / minimum price deviation;
FIX_TAKEPROFIT _BUY, SELL - Broker invisible take profit in points if USE_MAX_TAKEPROFIT = false;
USE_SHIRT_STOPLOSS - Ability to use a very short stop loss in open orders;
SL_COEFFICIENT - The coefficient that is used to calculate a short stop loss when the mode is enabled USE_SHIRT_STOPLOSS = true. Formula for calculating short stop loss = current spread * SL_COEFFICIENT;
FIX_STOPLOSS _BUY, SELL - Invisible broker stop loss in points if USE_SHIRT_STOPLOSS = false;
USE_BREAKEVEN - Use virtual breakeven of open positions;
BREAKEVEN_START - Profit in points, after which the stop loss is established at the level of breakeven + BREAKEVEN_PROFIT points;
BREAKEVEN_PROFIT - The number of points of profit at the close of orders at the level of breakeven;
USE_TRAILING - Use virtual trailing stop. If a USE_BREAKEVEN = true, then the trailing stop will start working only when the stop loss is set to breakeven + BREAKEVEN_PROFIT points;
TRAILING_STEP - The step of virtual trailing stop in points which remains for the price move after modifying the stop loss is set in points;
TRAILING_STOP - The size of the virtual trailing stop in points, to which the fixed profit will change, is set in points;
RISK_PERCENT - Calculation of the trading lot, depending on the risk per transaction. If = 0, then not used;
FROM_BALANCE - Calculation of the trading lot from the balance. Formula: Balance / FROM_BALANCE * LOTS. If = 0, then not used;
LOTS - Fixed lot if RISK_PERCENT = 0 and FROM_BALANCE = 0;
MAX_LOTS - Maximum lot;
LOTS_SIGNAL_POWER - Lot calculation depending on the signal strength. When this mode is enabled, the adviser evaluates the quality and strength of the signal and increases the lot when a good signal arrives with a large gap of quotations. Limit the maximum lot can be variable MAX_LOTS;
MAX_LOSS_PERCENT - With this parameter you can control the maximum loss on the account in% of the deposit since the launch of the adviser;
MAX_PROFIT_PERCENT - The maximum profit on the account in% of the deposit since the launch of the adviser;
CONSECUTIVE_LOSSES - The maximum number of unprofitable transactions in a row on a trading instrument, after which the adviser will stop trading;
MAX_OPEN_SLIPPAGE ( CLOSE_SLIPPAGE ) - Advisor will stop trading if the maximum slippage when opening or closing an order exceeds the value specified by you;
MAX_OPEN_EXECUTION ( CLOSE_EXECUTION ) - If the broker uses the plugin and deliberately slows down the execution of transactions, the adviser will automatically stop trading, protecting your funds.You can set the maximum time allowed to open a trade;
START_HOUR, START_MINUTE, STOP_HOUR, STOP_MINUTES - You can manage the trading hours, use the adviser on a schedule that is convenient for you, or tell the adviser the start time of the news;