alpha-xone / xbbg

An intuitive Bloomberg API
https://xbbg.readthedocs.io/
Apache License 2.0
244 stars 51 forks source link

Pulling historical bardata #70

Open marcus-bbq opened 2 years ago

marcus-bbq commented 2 years ago

Hi guys, trying to see if anyone has any tips on how to pull multi day bardata i.e. passing start and end dates. Current implementation only supports single day.

Was wondering if there is a way other than wrapping that and running for n days for x tickers.

Thanks

marcus-bbq commented 2 years ago

Any plans to allow users to pass in their own timestamps to pull intraday bars? I feel the current approach might be enforcing too many rules on the users. Ideally we can pass something like start_time='2022-01-01 09:30:00' end_time='2022-06-01 16:30:00' and it would pull multiday

abn84 commented 1 year ago

This would be a massive help, single day makes its very challenging to use efficiently/effectively, i believe bloomberg holds the data for 180 days in the past which allows you to develop a decent profile of volumes historically, doing multi day may kill your data limits especially if you are looking at many products.

love the wrapper though, keep up the good work

alpha-xone commented 1 year ago

It is easy to add arguments to blp.bdib and call itself recursively. But the problem is below.

The way blpapi works, if you send multiple requests at the same time, the returned data feeds may sometimes intertwine, meaning intraday bars of ticker A sometimes goes to ticker B if they are sent together. Since ppl caches intraday bars to local storage, it is very difficult to clean up 3 minutes of incorrect data bars here and there. So forcing ppl writing for loop of their own delegates the responsibilities of data cleaning to themselves.