bpsmith / tia

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

Extract fx spot rate along with px_last using get_historical() #44

Open viphilar opened 6 years ago

viphilar commented 6 years ago

In the following example to extract weekly data, is it possible to get FX rates? Just like the BDH excel command where one can provide "FX=EUR" as an argument?

# Weekly data
resp = LocalTerminal.get_historical(['IBM US EQUITY', 'MSFT US EQUITY'], ['PX_OPEN', 'PX_LAST'], 
                                         start='1/1/2014', end='3/1/2014', period='WEEKLY')
viphilar commented 6 years ago

duh.. nevermind! I figured it out. This works:

# Weekly data
resp = LocalTerminal.get_historical(['IBM US EQUITY', 'MSFT US EQUITY'], ['PX_OPEN', 'PX_LAST'], 
                                         start='1/1/2014', end='3/1/2014', period='WEEKLY', currency='USD')