0

I have seen posts about issues with BatchGetSymblols having issues on 4/27 and that some patches have been implemented. I installed the newest version of quantmod per recommendation but i still do not get any price data for 4/28 or 4/29. Anyone else having this issue or found work arounds?

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community May 03 '22 at 05:01

1 Answers1

0

No issues. Both via quantmod, BatchGetSymbols and yfR everything returns the same data.

library(quantmod)
tickers <- c("AAPL", "MSFT")
start <- Sys.Date() - 7

# returns AAPL and MSFT in the environment
getSymbols(tickers, from = start)

AAPL
           AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2022-04-25    161.12    163.17   158.46     162.88    96046400        162.88
2022-04-26    162.25    162.34   156.72     156.80    95623200        156.80
2022-04-27    155.91    159.79   155.38     156.57    88063200        156.57
2022-04-28    159.25    164.52   158.93     163.64   130216800        163.64
2022-04-29    161.84    166.20   157.25     157.65   131587100        157.65

MSFT
           MSFT.Open MSFT.High MSFT.Low MSFT.Close MSFT.Volume MSFT.Adjusted
2022-04-25    273.29    281.11   270.77     280.72    35678900        280.72
2022-04-26    277.50    278.36   270.00     270.22    46518400        270.22
2022-04-27    282.10    290.97   279.16     283.22    63477700        283.22
2022-04-28    285.19    290.98   281.46     289.63    33646600        289.63
2022-04-29    288.61    289.88   276.50     277.52    37025000        277.52

library(BatchGetSymbols)
out <- BatchGetSymbols(tickers = tickers, first.date = start)
out
$df.control
# A tibble: 2 × 6
  ticker src   download.status total.obs perc.benchmark.dates threshold.decision
  <chr>  <chr> <chr>               <int>                <dbl> <chr>             
1 AAPL   yahoo OK                      5                    1 KEEP              
2 MSFT   yahoo OK                      5                    1 KEEP              

$df.tickers
   price.open price.high price.low price.close    volume price.adjusted   ref.date ticker ret.adjusted.prices
1      161.12     163.17    158.46      162.88  96046400         162.88 2022-04-25   AAPL                  NA
2      162.25     162.34    156.72      156.80  95623200         156.80 2022-04-26   AAPL        -0.037328105
3      155.91     159.79    155.38      156.57  88063200         156.57 2022-04-27   AAPL        -0.001466811
4      159.25     164.52    158.93      163.64 130216800         163.64 2022-04-28   AAPL         0.045155468
5      161.84     166.20    157.25      157.65 131587100         157.65 2022-04-29   AAPL        -0.036604773
6      273.29     281.11    270.77      280.72  35678900         280.72 2022-04-25   MSFT                  NA
7      277.50     278.36    270.00      270.22  46518400         270.22 2022-04-26   MSFT        -0.037403819
8      282.10     290.97    279.16      283.22  63477700         283.22 2022-04-27   MSFT         0.048108948
9      285.19     290.98    281.46      289.63  33646600         289.63 2022-04-28   MSFT         0.022632596
10     288.61     289.88    276.50      277.52  37025000         277.52 2022-04-29   MSFT        -0.041812022

library(yfR)
yfr_out <- yf_get(tickers = tickers,
                  first_date = start)

 yfr_out
# A tibble: 10 × 10
   ticker ref_date   price_open price_high price_low price_close    volume price_adjusted ret_adjusted_prices
 * <chr>  <date>          <dbl>      <dbl>     <dbl>       <dbl>     <dbl>          <dbl>               <dbl>
 1 AAPL   2022-04-25       161.       163.      158.        163.  96046400           163.            NA      
 2 AAPL   2022-04-26       162.       162.      157.        157.  95623200           157.            -0.0373 
 3 AAPL   2022-04-27       156.       160.      155.        157.  88063200           157.            -0.00147
 4 AAPL   2022-04-28       159.       165.      159.        164. 130216800           164.             0.0452 
 5 AAPL   2022-04-29       162.       166.      157.        158. 131587100           158.            -0.0366 
 6 MSFT   2022-04-25       273.       281.      271.        281.  35678900           281.            NA      
 7 MSFT   2022-04-26       278.       278.      270         270.  46518400           270.            -0.0374 
 8 MSFT   2022-04-27       282.       291.      279.        283.  63477700           283.             0.0481 
 9 MSFT   2022-04-28       285.       291.      281.        290.  33646600           290.             0.0226 
10 MSFT   2022-04-29       289.       290.      276.        278.  37025000           278.            -0.0418 
# … with 1 more variable: ret_closing_prices <dbl>
phiver
  • 23,048
  • 14
  • 44
  • 56