Sep 1, 2017

Load daily exchange rates from a web-service

Loading data from web services such as exchanges rates are a common requirements in the TM1. A easy way to do it, is to use TM1py. TM1py helps you to link your TM1 application from different web-services like Yahoo Finance, Bloomberg or Quandl.

How does TM1py bring this data into your TM1 model?

The load process in TM1py generally consists of three steps:

  1. Load raw data from a web-service (e.g. Yahoo Finance, Bloomberg).
  2. Transform the data.
  3. Push the transformed data into TM1.

TM1py has lots of samples that you can use, one of them is helps you to load FX rates from USD to JPY.

Load USD to JPY exchange rate from the FRED

There are lots of data online which are free to use such as the Federal Reserve Economic Data of St Louis (FRED St Louis).

To load data from the FRED, TM1py uses a the pandas-datareader module. This module helps you to extract data from various internaet sources such as Yahou! Finance, Quandl…

For example with a few lines of code you can load the exchange rate from USD to JPY into your TM1 application.

The code above loads the data into the TM1py FX Rates cubes for every day in 2017:

If you want to load exchange rate from USD To Euro, you just need to:

  • Change the source from DEXJPUS to DEXUSEU
  • Change coordinates to USD and EUR

Run the script again

and you should have now:


Related content

Loading related content