alpha-xone / xbbg

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

xbbg requesting intraday interval #44

Closed fredysarmiento12 closed 3 years ago

fredysarmiento12 commented 3 years ago

Hi,

I have 2 questions:

  1. Does anyone know if it is possible to request time intervals on intraday data in xbbg?

The following code gives me the whole day 1-minute intervals and I want to request, for instance, only from 7 am to 10 am.

df= blp.bdib(ticker='EURUSD Curncy', dt='2021-07-28',ref = 'CurrencyGeneric')

  1. I am in London, but the data I get, has the time from NY, how can I get data with London hours?

thanks

alpha-xone commented 3 years ago
  1. Can try df.between_time('7:00', '10:00').
  2. Timezone of security depends on exchange rather than where you are. Use df.tz_convert('UTC') to convert into your timezone.
fredysarmiento12 commented 3 years ago

Great ! Many thanks.

df.between_time, worked perfectly.

Still, the time zone is showing the data in New York time, wondering if I need to actually do anything to tell the system my local time London?

fredysarmiento12 commented 3 years ago

Actually, it is working with:

df.tz_convert('Europe/London')

Many thanks for your help.