Hi,

I currently trying to build the Top of the book 
<https://en.wikipedia.org/wiki/Order_book_(trading)> out of full market 
depth and struggling a bit.

I am currently have one measurement called book, with two tags sym and side 
(bid or ask):

> show series
key
book,side=A,sym=DE0007236101
book,side=B,sym=DE0007236101

which contains data like:

> select * from book where sym='DE0007236101' and lvl=1 limit 10

name: book
----------
time                    lvl     noOrders        price   seqNo   side   
 size    sym
1412578805000000000     1       1               91.38   499     B       359 
    DE0007236101
1412578818000000000     1       1               91.64   985     A       119 
    DE0007236101
1412578821000000000     1       1               91.09   1034    B       119 
    DE0007236101
1412578831000000000     1       1               91.12   1222    B       187 
    DE0007236101
1412578843000000000     1       1               91.33   1404    A       64 
     DE0007236101
1412578857000000000     1       2               91.31   1584    B       144 
    DE0007236101
1412578871000000000     1       1               91.39   1811    A       18 
     DE0007236101
1412578892000000000     1       1               91.39   1920    A       119 
    DE0007236101
1412578900000000000     1       3               91.39   1938    A       516 
    DE0007236101
1412578901000000000     1       4               91.39   1939    A       601 
    DE0007236101

Which shows that bid and asks are not arriving at the time time. This means 
for any given time T the latest valid bid and ask (for level 1) have to be 
joined. 
The result I would expect is:

time bidOrders bidPrice bidSize askPrice askSize askOrders sym 
1412578805000000000 1 91.38 359 DE0007236101 
1412578818000000000 1 91.38 359 91.64 119 1 DE0007236102 
1412578821000000000 1 91.09 119 91.64 119 1 DE0007236103 
1412578831000000000 1 91.12 187 91.64 119 1 DE0007236104 
1412578843000000000 1 91.12 187 91.33 64 1 DE0007236105 
1412578857000000000 2 91.31 144 91.33 64 1 DE0007236106 
1412578871000000000 2 91.31 144 91.39 18 1 DE0007236107 
1412578892000000000 2 91.31 144 91.39 119 1 DE0007236108 
1412578900000000000 2 91.31 144 91.39 516 3 DE0007236109 
1412578901000000000 2 91.31 144 91.39 601 4 DE0007236110 
Unfortunately, I have not been able to formulate this "temporal join" on 
the same measurement in any way. 

I would appreciate any help input on this...

Thanks,
Marc

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/395d6d3d-3b46-425d-b322-5babd6cc8c3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to