Let's assume that there are two exchanges. One exchange is slow for various reasons.(for eg it is an open outcry versus electronic exchange) Even when there is no lag the prices will not match exactly but almost. From the data below I can see that exchange2 is around 2 minutes late compaired to exchange1, but how can I calculate the lag in excel or python? In other words by how much should I shift the graph of exchange1 to best fit the graph of exchange2? Is there a mathematical formula for it?
Asked
Active
Viewed 185 times
-1
-
That is a dummy example, isn't it? Unless you have a very illiquid product, that trades on two exchanges & no one knows of it, I postulate such a lag does not exist. There may be some differences (time zones, regulations, fees or the like) that do not allow for arbitrage within a window, but other than that, there will be no such thing. You can look at this for a example to see what people do to get speed. Publicly available software gives users 20,000+ orders per sec. – AKdemy Jan 18 '22 at 20:44
-
3Does this answer your question? Latency and Delays across Exchanges – AKdemy Jan 18 '22 at 21:38
-
@AKdemy of course it is a dummy example. It is just to illustrate my problem. Your previous link is about network latency and message processing. That part is easy. This is more about predicting when will the price of exchange 2 adjust. The feed delay, matching latency, etc is a different problem and relatively easy to measure. – RLaszlo Jan 19 '22 at 10:40
-
@RLaslo then you probably need to reformulate the question. For most people the "latency between two exchanges" is the network latency to get a message for exchange A to exchange B. Predicting when the prices match depends on various other factors, like the exchanges in question, typical spread and such. – LazyCat Jan 24 '22 at 18:49
-
@LazyCat I have just amended it. I hope it is better now. – RLaszlo Jan 24 '22 at 21:24
1 Answers
0
Time Lagged Cross Correlation seems to do the job perfectly.
https://towardsdatascience.com/four-ways-to-quantify-synchrony-between-time-series-data-b99136c4a9c9
RLaszlo
- 1
- 1
