Coder Social home page Coder Social logo

Wrong aggregation about yfr HOT 3 CLOSED

snvv avatar snvv commented on August 28, 2024
Wrong aggregation

from yfr.

Comments (3)

msperlin avatar msperlin commented on August 28, 2024

Hi snvv,

Can you provide a reproducible code, please?
Why you think prices are wrong?

from yfr.

snvv avatar snvv commented on August 28, 2024

Hello,

Using the following code:

library(yfR)

# Set options for algorithm
my_ticker <- 'GEKTERNA.AT'
first_date <- Sys.Date() - 360
last_date <- Sys.Date()

# Fetch data
df_yf <- yf_get(
  tickers = my_ticker, 
  freq_data = "weekly",
  first_date = first_date,
  last_date = last_date
)

# Output is a tibble with data
tail(df_yf)

I get:

> tail(df_yf)
# A tibble: 6 × 11
  ticker      ref_date   volume price_open price_high price_low price_close price_adjusted
  <chr>       <date>      <dbl>      <dbl>      <dbl>     <dbl>       <dbl>          <dbl>
1 GEKTERNA.AT 2024-04-29 426305       16.8       16.9      16.4        16.6           16.6
2 GEKTERNA.AT 2024-05-08 261453       16.7       16.9      16.5        16.9           16.9
3 GEKTERNA.AT 2024-05-13 566573       16.8       16.9      16.1        16.4           16.4
4 GEKTERNA.AT 2024-05-20 345089       16.6       16.9      16.2        16.7           16.7
5 GEKTERNA.AT 2024-05-27 472400       16.6       16.9      16.4        16.8           16.8
6 GEKTERNA.AT 2024-06-03 287244       16.7       16.9      16.4        16.8           16.8
# ℹ 3 more variables: ret_adjusted_prices <dbl>, ret_closing_prices <dbl>,
#   cumret_adjusted_prices <dbl>

However the closing prices from the Yahoo site for specific dates are:

  • Jun 3, 2024: 16.74
  • May 27, 2024: 16.60
  • May 20, 2024: 16.50
  • etc.

Best regards

from yfr.

msperlin avatar msperlin commented on August 28, 2024

Unfortinately, I can't help. This is certantly an issue with Yahoo site. The yfR is imported using quantmod::get_symbols(), which in turn grabs it from the json api endpoint https://query2.finance.yahoo.com/v8/finance/chart/:

image

As yfR developer, I have no control or knowledge of how the data from the yahoo site is organized.

from yfr.

Related Issues (17)

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.