Code Monkey home page Code Monkey logo

Comments (3)

JerBouma avatar JerBouma commented on June 4, 2024 1

Thanks for the remarks @northern-64bit but it's good to note that by default the risk free rate is set to the 10 year US Government Bond rate. Whether that makes sense for companies listed in e.g. Euro is up to you.

from financetoolkit.

kurucan avatar kurucan commented on June 4, 2024 1

Thanks for clarifying.

from financetoolkit.

northern-64bit avatar northern-64bit commented on June 4, 2024

Hello @kurucan !

I'm not the maintainer, but I have checked the code. Excess returns are defined as returns minus risk free rate. By default the package doesn't define a risk free rate, thus not defining the excess returns.

You should set the risk free rate to the one of the currency that you are denominating the returns/your portfolio in. So if you have your portfolio denominated in EUR and have the returns of a stock in EUR, then you should use the risk free rate "set" by the ECB, in order to calculate the excess returns. If you have a stock in EUR, but you measure your performance in USD (since this is the base currency for you), then you should convert the returns into USD returns and then use the risk free rate of the FED.

As for how currency differences are handled, all currencies must be the same to ensure accurate results, as noted in the models controller:

- All the inputs must be in the same currency and unit for accurate calculations.

Automatic conversion is only done in the financial statements:
- When `convert_currency=True` (automatically enabled with a Premium FMP plan) the currency of the historical data is compared to the currency of the financial statements. If they do not match, the financial statement data is converted to the currency of the historical data. This is done to ensure that calculations such as the Price-to-Earnings Ratio (PE) have both the Share Price and Earnings denoted in the same currency.

So for now you have to convert all the returns into one currency and then do the calculations.

I hope that this helps!

from financetoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.