Reconstructing and Viewing Order Book

Greetings all, 

I am currently working on an order book reconstruction. I have a few ideas how to do it, but I am struggling to come up with an idea for how to actually view/chart it. Because it is a multidimensional table. 

For example, right now I am thinking of making a table like this: 

| Price/Time | 10:00 | 10:01 | 10:02 |
| 10 | 1 | 2 | 3 |
| 20 | | 2 | 2 |
| 30 | 1 | 1 | 3 |

But, there are BID and ASK quantities and how exactly to table them and then view throughout time… no idea.

If I make the order book look like this: 

| time | Px | time |
| 5 | 4 | 3 | 2 | 1 | 0 | 1 | 2 | 3 | 4 | 5 |
| | | | | | 88.68299 | 1 | 1 | 1 | 1 | 1 |
| | | | | | 77.45233 | | 5 | 5 | 5 | 5 |
| | | | | | 67.93601 | | | | 1 | 1 |
| | | | | | 64.83352 | | | 3 | 3 | 3 |
| | | | | | 52.72378 | | | | | |
| 1 | 1 | 1 | 1 | 1 | 35.29648 | | | | | |
| 1 | 1 | 1 | 1 | | 32.2256 | | | | | |
| 1 | 1 | 1 | | | 23.20569 | | | | | |
| 2 | 2 | | | | 1.197277 | | | | | |

then I have no idea how to view it. Essentially, I do not have a solid plan on the structure of the resulting Orderbook just yet. 

Any ideas and suggestions would be very much appreciated, I think this is a very interesting problem. 

Please see attached. 

HTH,

Kim

This is indeed an old problem. See attached: 

Am Donnerstag, 1. Dezember 2016 08:01:55 UTC+1 schrieb VA:

Greetings all, 

I am currently working on an order book reconstruction. I have a few ideas how to do it, but I am struggling to come up with an idea for how to actually view/chart it. Because it is a multidimensional table. 

For example, right now I am thinking of making a table like this: 

| Price/Time | 10:00 | 10:01 | 10:02 |
| 10 | 1 | 2 | 3 |
| 20 | | 2 | 2 |
| 30 | 1 | 1 | 3 |

But, there are BID and ASK quantities and how exactly to table them and then view throughout time… no idea.

If I make the order book look like this: 

| time | Px | time |
| 5 | 4 | 3 | 2 | 1 | 0 | 1 | 2 | 3 | 4 | 5 |
| | | | | | 88.68299 | 1 | 1 | 1 | 1 | 1 |
| | | | | | 77.45233 | | 5 | 5 | 5 | 5 |
| | | | | | 67.93601 | | | | 1 | 1 |
| | | | | | 64.83352 | | | 3 | 3 | 3 |
| | | | | | 52.72378 | | | | | |
| 1 | 1 | 1 | 1 | 1 | 35.29648 | | | | | |
| 1 | 1 | 1 | 1 | | 32.2256 | | | | | |
| 1 | 1 | 1 | | | 23.20569 | | | | | |
| 2 | 2 | | | | 1.197277 | | | | | |

then I have no idea how to view it. Essentially, I do not have a solid plan on the structure of the resulting Orderbook just yet. 

Any ideas and suggestions would be very much appreciated, I think this is a very interesting problem. 

Hi Kim, 

Thank you your response. 

This is the structure that I have come to have as well. Colour will bring the 3rd dimension. However, interestingly, according to your table, prices went up half-way through the period (and then at the end as well) despite being sold off. I would imagine if there was such a pressure on selling the priced would definitely go down, not up…? 

There were two news release and both were positive. Now we can discuss how we can categorize a news J. Enjoy the next one. I still have two more but they are more complicated and need a deep understanding of micro structure of an orderbook.<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

<o:p> </o:p>

Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von VA
Gesendet: Freitag, 2. Dezember 2016 17:35
An: Kdb+ Personal Developers
Betreff: [personal kdb+] Re: Reconstructing and Viewing Order Book<o:p></o:p>

<o:p> </o:p>

Hi Kim, <o:p></o:p>

<o:p> </o:p>

Thank you your response. <o:p></o:p>

<o:p> </o:p>

This is the structure that I have come to have as well. Colour will bring the 3rd dimension. However, interestingly, according to your table, prices went up half-way through the period (and then at the end as well) despite being sold off. I would imagine if there was such a pressure on selling the priced would definitely go down, not up…? <o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

On Thursday, December 1, 2016 at 9:35:37 PM UTC, kuentang wrote:<o:p></o:p>

Please see attached. <o:p></o:p>

<o:p> </o:p>

HTH,<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

<o:p></o:p>

This is indeed an old problem. See attached: <o:p></o:p>

Am Donnerstag, 1. Dezember 2016 08:01:55 UTC+1 schrieb VA:<o:p></o:p>

Greetings all, <o:p></o:p>

<o:p> </o:p>

I am currently working on an order book reconstruction. I have a few ideas how to do it, but I am struggling to come up with an idea for how to actually view/chart it. Because it is a multidimensional table. <o:p></o:p>

<o:p> </o:p>

For example, right now I am thinking of making a table like this: <o:p></o:p>

<o:p> </o:p>

|

Price/Time<o:p></o:p>

|

10:00<o:p></o:p>

|

10:01<o:p></o:p>

|

10:02<o:p></o:p>

|
|

10<o:p></o:p>

|

1<o:p></o:p>

|

2<o:p></o:p>

|

3<o:p></o:p>

|
|

20<o:p></o:p>

| |

2<o:p></o:p>

|

2<o:p></o:p>

|
|

30<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

3<o:p></o:p>

|

<o:p> </o:p>

But, there are BID and ASK quantities and how exactly to table them and then view throughout time… no idea.<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

If I make the order book look like this: <o:p></o:p>

<o:p> </o:p>

|

time<o:p></o:p>

|

Px<o:p></o:p>

|

time<o:p></o:p>

|
|

5<o:p></o:p>

|

4<o:p></o:p>

|

3<o:p></o:p>

|

2<o:p></o:p>

|

1<o:p></o:p>

|

0<o:p></o:p>

|

1<o:p></o:p>

|

2<o:p></o:p>

|

3<o:p></o:p>

|

4<o:p></o:p>

|

5<o:p></o:p>

|
| | | | | |

88.68299<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|
| | | | | |

77.45233<o:p></o:p>

| |

5<o:p></o:p>

|

5<o:p></o:p>

|

5<o:p></o:p>

|

5<o:p></o:p>

|
| | | | | |

67.93601<o:p></o:p>

| | | |

1<o:p></o:p>

|

1<o:p></o:p>

|
| | | | | |

64.83352<o:p></o:p>

| | |

3<o:p></o:p>

|

3<o:p></o:p>

|

3<o:p></o:p>

|
| | | | | |

52.72378<o:p></o:p>

| | | | | |
|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

35.29648<o:p></o:p>

| | | | | |
|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

| |

32.2256<o:p></o:p>

| | | | | |
|

1<o:p></o:p>

|

1<o:p></o:p>

|

1<o:p></o:p>

| | |

23.20569<o:p></o:p>

| | | | | |
|

2<o:p></o:p>

|

2<o:p></o:p>

| | | |

1.197277<o:p></o:p>

| | | | | |

<o:p> </o:p>

then I have no idea how to view it. Essentially, I do not have a solid plan on the structure of the resulting Orderbook just yet. <o:p></o:p>

<o:p> </o:p>

Any ideas and suggestions would be very much appreciated, I think this is a very interesting problem. <o:p></o:p>


Submitted via Google Groups

Which software do you use for visualising the order book? And do please post two more screenshots! This is incredibly interesting.

And do your order books have market orders or just limit orders?