Greetings, I bring to your attention the terms of reference for a bot for advanced arbitrage and pair trading.
The goal of the approach is to implement a qualitatively market-neutral strategy to increase the efficiency of the results, compared to the standard approach.
The bot is created for the futures section of the OKX exchange (futures and open-ended USDT contracts). The futures section is selected to be able to open long and short with a leverage. OKX is a popular exchange, with high trading volumes (the second highest turnover) and the ability to trade both pair trading and arbitrage.
Terms of Reference for the “Advanced Arbitration” bot
The bot can implement two market-neutral approaches – arbitrage or pair trading. I.e., in the settings of the bot, we select two pairs, which will be traded one against the other. Bot is multipair – you can trade many chains of pairs simultaneously.
The logic of the bot. When the bot starts, it starts to count the divergence. According to rate changes of pairs from a paired (or arbitrage) chain, the divergence appears, and when it becomes equal or greater than specified in settings, the bot opens a paired deal – buys what is cheaper on the market and sells what is more expensive (here is standard). The trader specifies the volume of the position in % in the settings.
Then the module of averaging by the range scalping method comes into play. In this case, we do not average an entire arbitrage/pair position, but separately for each deal of a market-neutral position. When we average a position separately – in this case, we improve the average position price of a paired trade. And because of this, we increase the profit between positions in a common trade.
If anyone does not know how the averaging by the range scalping method works, below is an example:
In order to balance the volumes, the bot will average each position not only when the price is negative, but also when it is positive. When the position is in the plus, and the price is averaging out, then the value of the average transaction price is slightly worse – but still, there are partial profits. Also, it is important to do this in order to avoid strong distortions in positions.
All this time the bot controls the profit of the paired/arbitrage position, and when the profit becomes equal or greater than the profit value specified by the trader in the settings – the bot removes all orders, and closes the market-neutral position in profit.
After closing the position, the bot starts trading again – it waits for the divergence, and opens a new position, etc.
The bot will have a wide range of settings that can be adjusted individually for each arbitrage or pair chain:
- Choice of the first pair from the list – the first part of the market-neutral position (arbitrage or pair).
- Choice of the second pair from the list – the second part of the market-neutral position.
- Exit only” mode – to give the possibility to close the current trade and not to open a new one.
- Divergence for entry into position – how many % should be the divergence between pairs, so that the bot will enter into the position.
- Take profit for the position – at what profit in % the trade should be closed.
- Position volume in % – how many percent of the deposit to allocate for the opening of the first pair deal.
- Volume of the order on additional additional purchase in % – how many percent from deposit will be allocated on each additional purchase.
- Unloading distance in % – how many in % from the last additional purchase will be unloaded.
- Unloading volume – how much as a % of the additional purchase will be unloaded.
- Number of additional purchases – the maximum number of additional purchases.
- Trading leverage setting for each pair.
The bot displays information about the profit/loss in each chain, open orders. Also, logging of all actions, with the output of information on current actions.
The bot must pick up open positions that it has previously opened (except for trading intervention).
The bot is created for work under the Windows operating system, and should work on a local computer, and on a remote server.
If you are interested in the bot and want to follow its development, subscribe to our channel.