xbbg icon indicating copy to clipboard operation
xbbg copied to clipboard

Overwriting of file .parq files stored in \xbbg\markets

Open MPrazzoli opened this issue 1 year ago • 0 comments

I noticed when I recall function blp.bdib() at the first time retrieve data for a particular ticker-date-quote_type (ASK/BID/TRADE) combination, you store those data into local path \Lib\site-packages\xbbg\markets (that one save as system variable under the name BBG_ROOT ) in .parq format with the timeframe I set as parameter at the first time. When I recall that function for the same ticker-date-quote_type, but with different timeframe, blp.bdib function goes into the files stored at the BBG_ROOT path and check if i have already a file for that ticker-date-quote_type without and return it to me not considering anymore the timeframe I request last time.

Here an example of what I am talking about: 1- first call: blp.bdib('EUR Curncy', dt='2023-1-23', typ='TRADE', interval=5, session='allday') first return: dataframe with 5 minutes timeframe (attached picture: "first return") first_return 2- second call: blp.bdib('EUR Curncy', dt='2023-1-23', typ='TRADE', interval=60, session='allday') second return: dataframe with 5 minutes timeframe (attached picture: "second return") second_return

There is any reason why you do that? Otherwise it is easily solved by adding an underscore with the value of the timeframe in minutes at the end of every parquet file and recall the right parquet based on the timeframe called at every time. Now you store like this: \xbbg\markets\Curncy\EURAUD Curncy\ASK\2023-01-19.parq, instead it would be better to store like \xbbg\markets\Curncy\EURAUD Curncy\ASK\2023-01-19_1.parq --> for one minute timeframe, \xbbg\markets\Curncy\EURAUD Curncy\ASK\2023-01-19_5.parq --> for five minutes timeframe, \xbbg\markets\Curncy\EURAUD Curncy\ASK\2023-01-19_60.parq --> for one hourntimeframe so on so forth.

MPrazzoli avatar Jan 25 '23 09:01 MPrazzoli