bpsmith / tia

Toolkit for integration and analysis
BSD 3-Clause "New" or "Revised" License
404 stars 165 forks source link

Using overrides in get_historical #41

Open Simplex122 opened 6 years ago

Simplex122 commented 6 years ago

Hello.

I am trying to use the override "FWD_CURVE_QUOTE_FORMAT=RATES" in the following get_historical request, but I am not sure of the correct syntax G10_test = inp.get_historical('PX_LAST',start_date, end_date). Can someone please help?

nschantz21 commented 6 years ago

The overrides are supplied as keyword arguments to the function. get_historical(security, field, start_date, end_date, FWD_CURVE_QUOTE_FORMAT='RATES') The override needs to be associated with the field being requested as documented in the Bloomberg Terminal. So if FWD_CURVE_QUOTE_FORMAT isn't available for PX_LAST, then it won't change anything. Similarly, if 'RATES' is not a valid value for that override, then it will not work.

frankrao56 commented 5 years ago

Does anyone know how to override start time and end time in a VWAP field for an Equity. (ie: VWAP of IBM from 15:00 to 15:30) It is possible with =BHD/BDP on Excel, but I can't seem to make it work in python. Thanks

mrkchn commented 3 years ago

@frankrao56 the overrides are VWAP_DT, VWAP_START_TIME, VWAP_END_TIME. The date format is "%m/%d/%Y" and the time format is "%H:%M:%S". However, because the VWAP_DT override is specific to a particular data point (not the whole time series), you can't use the get_historical function. You need to use get_attributes, and query one date at a time. If anyone finds a faster way to get VWAPs for multiple dates in a single request, please let me know!