Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Custom indicators, trading strategies, data export and recording and more...
phil83
Posts: 5
Joined: Wed Jul 22, 2020 5:29 pm

Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by phil83 » Tue Sep 15, 2020 12:50 pm

Hi everyone,

I am using the Data Recorder API to record trades, quotes, BBO etc. in a text file. 
When I am looking at the "Quote"-lines that are recorded I see a difference to what is displayed in Bookmap (in the heat map). 

API Code (kept in standard from Git) of the data recorder:

Code: Select all

@Override public void onDepth(boolean isBid, int price, int size) {
String side = isBid ? "Buy" : "Sell";
writeObjects("Quote", side, price, size);
}

Output for todays ESZ0 price level 3403 since the beginning of my recording (UTC/GMT +1:00 hour):
(date, type, price, direction, volume)
2020-09-15 06:39:23.280432,Quote,3403.0,Sell,19
2020-09-15 07:12:20.874939,Quote,3403.0,Sell,21
2020-09-15 07:12:20.874939,Quote,3403.0,Sell,21
2020-09-15 07:52:32.571009,Quote,3403.0,Sell,20
2020-09-15 07:52:32.571009,Quote,3403.0,Sell,20
2020-09-15 08:08:58.325661,Quote,3403.0,Sell,21
2020-09-15 08:08:58.325661,Quote,3403.0,Sell,21
2020-09-15 08:14:35.747663,Quote,3403.0,Sell,20
2020-09-15 08:14:35.747663,Quote,3403.0,Sell,20
2020-09-15 08:21:55.284038,Quote,3403.0,Sell,21
2020-09-15 08:21:55.284038,Quote,3403.0,Sell,21
2020-09-15 08:44:56.401192,Quote,3403.0,Sell,20
2020-09-15 08:44:56.401192,Quote,3403.0,Sell,20

And what is displayed in Bookmap:

Image


In Bookmap the volume of this pricelevel is above what is recorded in the API (at around 120 vs 30). This problem occurs for alle price levels so I assume there is some calculation logic to be known. I would like to have the correct volumes of the order book recorded. 

Where is the difference coming from? 
How are the Quotes/ the volume in the DOM calculated in Bookmap?
How can I fix it?


Thank you
Best
Philipp

 

phil83
Posts: 5
Joined: Wed Jul 22, 2020 5:29 pm

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by phil83 » Wed Sep 16, 2020 7:46 am

Update:
I installed the latest build V 7.1.1 build: Mac-119 (released today)

The problem seems to be fixed with this build. Now the heat map values seem to be the same as in the data recorder.
Can you confirm this?

Thanks
Philipp

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by Andry API support » Wed Sep 16, 2020 11:44 am

Hi phil83,
price in modules is measured in min increment size (pips) which is 0.25 for ESZ0.
To calculate the real price you should multiply the price-in-pips by pips value. So 3403 is in fact 850.75.
You can get pips value from the initialize method.

Code: Select all

    double pips;

    @Override
    public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
        //...
        this.pips = info.pips;
    }

phil83
Posts: 5
Joined: Wed Jul 22, 2020 5:29 pm

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by phil83 » Wed Sep 16, 2020 2:52 pm

Hi Andrey,

thanks for your reply.
My Script is calculating with the price of your Simple Demo and divides it by 4 (pip per point) to get the real price. So 3403 is 13616 as data output in the data recorder. This is all fine. I calculate with this further and divide it locally.

The issue was regarding the volume levels in the heat map. It works fine now with the new build. Is there something you changed  regarding this issue in the build?

THanks
Best
Philipp

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by Andry API support » Thu Sep 17, 2020 10:56 am

Philipp,
I am not aware of anything that would directly result in changes you described. Anyway, I am happy it works now.

arya4700
Posts: 6
Joined: Sun Mar 07, 2021 2:57 pm
Has thanked: 3 times
Been thanked: 2 times

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by arya4700 » Wed Jun 16, 2021 1:47 pm

i am having the same kind of discrepencies for ES and NQ. 

i tried to install the latest version of bookmap but its still thr. 

any solutions for this?

Svyatoslav
Site Admin
Posts: 278
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 31 times

Re: Data recorder - discrepancy in "Quotes" recorded and displayed in BM

Post by Svyatoslav » Wed Jun 16, 2021 2:59 pm

arya4700, if you are talking about API - please share short example of the code. I'm pretty sure you are forgetting to multiply the value by pips.

However I see you have a support ticket where you seem to be using two instruments with different expirations, so data does not match. If that's what you are talking about - please select expiration explicitly in both platforms.

Post Reply