Skip to content

ShijieXu1993/SOR_backtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Order Router---Replica of Rama Cont & Arseniy Kukanov's results

Acknowledgement: Thanks to the anonymous company for offering this learning opportunity!

Quantitative Finance: Optimal order placement in limit order markets --- Cont Rama & Arseniy Kukanov

Our Problem

Minimise the total cost of buying 5,000 shares of stock.

Our Methods

Category Strategy Brief description
Main Static Cont-Kukanov Solves the Cont & Kukanov static optimisation to size limit vs. market orders across venues at each snapshot
Baseline Naïve Best-Ask Sends the whole slice to the venue currently showing the best ask price
Baseline TWAP Splits the parent order into equal-sized chunks executed at regular time intervals
Baseline VWAP Scales each slice to match historical intraday volume, aiming to track the market’s volume profile

Highlights

  • The order book event stream includes non-disjoint shares---the same order would exist in several snapshots. If one takes each different timestamp as a snapshot and buys the amount as Ask_size of it, due to the duplication of the ask offers, the 5,000 shares would be filled immediately if the Static Cont-Kukanov method is used which means it is only a waste of the whole 9 mins time window to complete this task, but also violates the truth. I tried to handle this problem by restricting the least time interval between two snapshots. Intuitively speaking, one could expect that the previous depth 0 orders will be traded with a great probability after some time.
  • Now the problem comes to what is the least time distance between two snapshots used for the trading simulation. A very rough observation is that the total number of traded shares in the offered time window is about 75091 in 522 seconds. That is, if we assume the number of traded orders follows the Poisson distribution, the arrival rate is more than 144 shares per second. However, the average depth 0 ask_size is quite skewed. However, it is likely to say that more than a tiny slice (maybe more than 1s) of time would guarantee the full renewal of the listed order.
  • Since we observe the dynamic of price so locally, we are not supposed to have too much judgment. Also, notice that we will not be rewarded by using less time. Then the model setting is also an art related to time. It is a trade-off between using more time to average the cost fluctuation and facing the challenge of underfilling and overfilling.

Results

Strategy Total Cost Avg Fill Price Savings vs SOR (bps)
Static Cont-Kukanov Smart Router (tuned) 1 113 923 222.78
Best-Ask 1 114 760 222.95 +7.51
TWAP 1 159 236 223.06 +390.89
VWAP 1 114 252 222.85 +2.96

Possible Improvement

  • Venues: Cont mentioned the relationships between the number of venues and the following: "…the oversizing becomes more prominent as the number of trading venues grows, leading to more opportunities to diversify limit-order fills.” Adding venues lowers non-execution risk because fills across books are imperfectly correlated, so the trader can rely more on limit orders and less on market orders" and "As K increases from 1 to 5, the optimal split shifts sharply away from market orders toward limit orders, and expected cost falls by roughly 2–4/ share for small/medium trades. Gains flatten once K ≥ 3–4; for large trades (5,000 sh), some market orders remain necessary even with many venues". To conclude, we have the table as follows:
Effect K ↑ ⇒ Impact
Risk diversification More independent queues → safer oversizing of limits Lowers non-execution risk
Cost Shift from market to limit orders Cuts fees / earns rebates
Diminishing returns After ~3-4 books, extra venues add little Savings plateau

In this project, we only have 1 venue, but there exist some possible techniques to apply the multi-venue strategy. For example, we could artificially find some disjoint parts in the order book and treat them as different venues. In other words, a high-frequency order book may be sliced into several "independent" parts for some medium or low-frequency users.

  • Fine-tuning the least time interval between two snapshots to see a better interplay between time, cost and risk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages