Closed rpenm closed 1 week ago
Hello @rpenm,
There have been a lot of changes to the Yahoo Finance API since May. Only a subset of the original data is available now.
Ok. Good to know. Is there are alternative API to Yahoo finance that you recommend?
Thank You!
I am trying to retrieve some fields in yahoofinancier that should be available according to the documentation: https://www.r-bloggers.com/2022/11/introducing-yahoofinancer/
When I run the script below it returns values for high, low, volume, forward PE, 50 day average, and 200 day average But it returns NULL values for beta, averageVolume, averageVolume10days
Can someone advise why these values return as NULL?
Thank you!
-----------------sample script
load the library
library(yahoofinancer)
----------------------------------------
select ticker and date range
tickerSymbol <- 'aapl' startDate <- '2023-11-01' endDate <- '2023-12-21' interval <- '1d'
---------------------------------------
create ticker class
ticker <- Ticker$new(tickerSymbol)
build dataframe of stock history
df <- ticker$get_history(start = startDate, end = endDate, interval = interval) df <- data.frame(df)
get desired stats
fwdPE <- ticker$quote$forwardPE avgVol <- ticker$quote$averageVolume avg10dVol <- ticker$quote$averageVolume10days avg50d <- ticker$quote$fiftyDayAverage avg200d <- ticker$quote$twoHundredDayAverage beta <- ticker$quote$beta