matthewgilbert / pdblp

pandas wrapper for Bloomberg Open API
MIT License
241 stars 67 forks source link

Intraday bar data pulled with bdib doesn't match BBG QR #95

Open isBos opened 3 years ago

isBos commented 3 years ago

Code Sample, a copy-pastable example if possible

# Your code here, this should be a minimal reproducible example, see https://stackoverflow.com/help/mcve
import pdblp
import datetime as dt
import pandas as pd
import numpy as np

c = pdblp.BCon(debug=True, port=8194, timeout=5000)
c.start()
c.bdib('BCN1M CMPN CURNCY', '2021-06-02T10:55:00', '2021-06-02T11:05:00', 'BID', 1, [('adjustmentFollowDPDF', True)])

import pdblp import datetime as dt import pandas as pd import numpy as np

c = pdblp.BCon(debug=True, port=8194, timeout=5000) c.start() c.bdib('BCN1M CMPN CURNCY', '2021-06-02T10:55:00', '2021-06-02T11:05:00', 'BID', 1, [('adjustmentFollowDPDF', True)])

Problem description

[this should explain why the current behaviour is a problem and why the expected output is a better solution.]

I'm pulling 1min Intraday bar data for BRL 1M forward with bdib and comparing it to BBG QR for the same time window. BBG quotes (open) are around 125 handle, bdib quotes have 139 handle. This is what i get with bdib:

Out[62]: open high low close volume numEvents time
2021-06-02 10:57:00 139.42 139.42 139.42 139.42 0 1 2021-06-02 11:02:00 139.42 139.42 139.42 139.42 0 1

Expected Output

This is what i get with BBG QR: 10:57 bid has low 125 handle, 11:02 has high 124 handle bbgBCN1m

Version Information

[paste the output of pdblp.__version__ here below this line] 0.1.8

matthewgilbert commented 3 years ago

I would contact Bloomberg directly about this since this looks like a question for their market data team.

isBos commented 3 years ago

thank you

isBos commented 3 years ago

could it be that the timestamp shows a different time from BBG, even as i made the time zone match my BBG setting?