Hi everyone,
I couldnt find anything in the documentation or online. So hopefully you can help
Id like to create a snapshot of the market depth in the method initialize of the data recorder. So going through all available price levels and get price level and corresponding limit order volume in the order book and save it as an array, once at initialization.
My approach was to use the onDepth method and the OrderBookSum class but of course this just works only onDepth event (the Treemap is only filled incrementally at onDepth and empty on initialize). Id like the snapshot of the order book once on initialize.
How could I do that?
Thank you
Best
Philipp
Snapshot of Market Depth
-
- Posts: 548
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: Snapshot of Market Depth
Hi Philipp,
By snapshot of depth I mean a filled OrderBook here.
You can implement SnapshotEndListener interface. Create an OrderBook object and call onUpdate method for every onDepth event. You will know where snapthot ends as soon as onSnapshotEnd() method is called.
If you need to get snapshots regularly you can implement BarDataListener interface. Return the interval you need in getInterval() method and you will receive snapthots every [interval] in onBar method.
There is javadoc in Bookmap folder. For SimplifiedAPI:
C:\Program Files\Bookmap\lib\bm-simplified-api-wrapper-javadoc.jar
Just rename .jar to .zip so you can unzip it and open the index.html with your browser.
By snapshot of depth I mean a filled OrderBook here.
You can implement SnapshotEndListener interface. Create an OrderBook object and call onUpdate method for every onDepth event. You will know where snapthot ends as soon as onSnapshotEnd() method is called.
If you need to get snapshots regularly you can implement BarDataListener interface. Return the interval you need in getInterval() method and you will receive snapthots every [interval] in onBar method.
There is javadoc in Bookmap folder. For SimplifiedAPI:
C:\Program Files\Bookmap\lib\bm-simplified-api-wrapper-javadoc.jar
Just rename .jar to .zip so you can unzip it and open the index.html with your browser.