We are building an algorithmic trading bot for a dual-listing stock, which is listed on both a liquid market and a new, illiquid market. The primary goal is to optimise trading strategies to capitalise on price discrepancies between the two markets. The provided code consists of several modules, each contributing to different aspects of the trading bot.

The market maker strategy aims to provide liquidity to the illiquid market by placing competitive buy and sell quotes based on the price spreads of both the liquid and illiquid markets. For example:

Market 1: Ask @ 51 Bid @ 50

Market 2: Ask @ 55 Bid @ 45

Here we quote the price on market two, similar to Ask @ 53 and Bid @ 48. We then wait for people to fulfil our limit orders and then immediately execute the opposite trade on Market 1. This would lead to profit as, for example, we would receive stock valued at 48, and then sell it at 50 on market 1. This is dynamically updated to ensure that the quotes do not fall into the region of in profitability.

The dual-listing trading strategy focuses on arbitraging between the liquid and illiquid markets by identifying opportunities where bid and ask prices in one market are misaligned with the other. We focus on the case where arbitrage opportunities immediately arise. For example:

Market 1: Ask @ 51 Bid @ 50

Market 2 Ask @ 55 Bid @ 53

In this example we would buy from market 1 at 51, and then sell it at 53 on market 2. This obviously works vice versa.

However, although in the long run you would expect the buying and selling in both markets to be equal, in the short term we may experience high net holding if the stock moves. For the market strategy we counter this buy dynamically adjusting how far from the true price the quotes are. If we need to buy stock to regain next positive, we move our bid quote closer to the true price, this means we are more likely to be purchased. In the dual listing strategy, we change which transaction we do first.

In the ideal world, all these transactions are immediately hedged. However, this may not be the case as there are other actors who are constantly seeking the same inefficiencies as us. This means a transaction may fail. The more likely transaction to fail is the later one as it is executed last. In both these strategies we are changing the transaction we wish to fail to be more probable to still be a net benefit for us in terms of net position.

Built With

Share this project:

Updates

Submission history