File we plan to use: gamma2.py
Arbitrage
Algorithm looks for disparity in the stock market between a company and its new country version. If one stock is being sold for less than the other version is being bought for; we buy the cheaper stock and sell the more expensive one. However, we made changes to ensure our code runs more efficiently; we ensured that we moved stock in the largest volume possible by taking the minimum volume between the buy and sell orders we were working with. Due to the 25 request/sec rate limit we also added a queue system which stores the times that our last requests were made and only allows new requests to be made when the oldest request was more than a second ago. This then eliminated the need to wait for any time interval in our while loop.
Asymmetric two-sided quoting - market making
Algorithm compares the NEW_COUNTRY stock spread I_2 = [b_2, s_2] to the original stock spread I_1 = [b_1, s_1]. If I_1 is a subset of I_2 and the percentage spread of NEW_COUNTRY is high, consider the last market-making bid and ask. If both or neither are outstanding, then buy and sell 1 volume of NEW_COUNTRY at the endpoints of a weighted average of I_1 and I_2, accounting for any outstanding orders to reset neutral position. If exactly one is outstanding, adjust the other endpoint to fit this posterior. Repeat at a slower rate than arbitrage, which runs concurrently in other pair of dual listing.
Market adjustment (fresh market w/ benchmark)
Algorithm keeps track of last trade price on all stocks. This only runs when a stock market opens while its twin market is already open. As its twin might have fluctuated during the time of closure, we can take this opportunity to either long or short the stock based on whether the price of its twin is higher or lower than the last traded price of our stock. If the price has gone up, we long the stock and short its twin, to balance the markets whilst making money on the long and the short (assuming that the true price of the stock lies somewhere in the middle). Vice versa, if the stock has gone down, we long the twin and short the stock itself.
Built With
- optibook
- python
Log in or sign up for Devpost to join the conversation.