Giter Club home page Giter Club logo

Comments (5)

nenkoru avatar nenkoru commented on July 1, 2024

Could you please elaborate a little bit please on this issue?
As I have taken a look INR-USD data is limited by 18 years by the API of Okama. However, I even struggled to find data for INR-USD on the internet!
Was able to find only this one https://fred.stlouisfed.org/series/DEXINUS

from okama.

chilango74 avatar chilango74 commented on July 1, 2024

In the example above first_date of AssetList is not correct. It can't be 1990 when period_length is 15 years.
Here the problem is more general and not depending on INRUSD only. There are rare situations when the period_length of AssetList or Portfolio is limited by one of the currencies. Usually assets limit it.
ListMaker._make_list should check FX first_date also when adjusting to the base currency.

from okama.

nenkoru avatar nenkoru commented on July 1, 2024

In the example above first_date of AssetList is not correct. It can't be 1990 when period_length is 15 years. Here the problem is more general and not depending on INRUSD only. There are rare situations when the period_length of AssetList or Portfolio is limited by one of the currencies. Usually assets limit it. ListMaker._make_list should check FX first_date also when adjusting to the base currency.

I still do not understand fully the idea behind this. What's the expected behavior?

from okama.

chilango74 avatar chilango74 commented on July 1, 2024

period_length is the difference between the first_date and last_date. If you check the example above period_length is 15 years and 11 months. However, the first_date is 1990-08 and the last_date is 2021-11. The parameter first_date is not correct here.

What is happening...
When Portfolio or AssetList is initiated, we download several historical data series:

  • assets
  • inflation
  • base currency
  • FX currency pairs to adjust the rate of return to the base currency

first_date of the AssetList is the latest first_date of the mentioned time series. last_date is the newest last_date. It should work this way, but for some reason I forgot to include FX currency rates used in _adjust_ror_to_currency in this comparison:

first_dates_sorted: list = sorted(first_dates.items(), key=lambda y: y[1])
last_dates_sorted: list = sorted(last_dates.items(), key=lambda y: y[1])

In the example above the first_date should consider the INRUSD.FX historical data depth.

from okama.

chilango74 avatar chilango74 commented on July 1, 2024

Resolved by d3c0174

from okama.

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.