You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you need to add "subset = subset" in each of the five periodReturn calls like below. it works for me:
function (x, subset = NULL, type = "arithmetic", leading = TRUE)
{
x.orig <- x
x <- try.xts(x)
all.ret <- cbind(periodReturn(x, "daily",subset = subset, type = type, leading = FALSE),
periodReturn(x, "weekly",subset = subset,type = type),
periodReturn(x, "monthly",subset = subset, type = type, indexAt = "endof"),
periodReturn(x, "quarterly", subset = subset,type = type, indexAt = "endof"),
periodReturn(x, "yearly",subset = subset, type = type))
colnames(all.ret) <- c("daily", "weekly", "monthly", "quarterly",
"yearly")
reclass(all.ret, x.orig)
}
Minimal, reproducible example
[Insertsampledataandcode]
Session Info
[Insertyour sessionInfo() output]
The text was updated successfully, but these errors were encountered:
### Changes in 0.4.25 (2023-08-21)
1. Fix `getQuote.yahoo()` for API changes. Thanks to Ethan B. Smith for the
report and patch! Also add error message for users in GDPR countries, since
we cannot automatically consent to GDPR and the request fails without
consent.
[#392](joshuaulrich/quantmod#392)
[#393](joshuaulrich/quantmod#393)
[#395](joshuaulrich/quantmod#395)
1. Fix `getQuote.yahoo()` when the user only requested metrics that do not have
have a value for 'regularMarketTime'. Set the value to NA in these cases
so the output remains the same regardless of whether the endpoint returns
a 'regularMarketTime' or not. Thanks to @mehdiMBH for the report!
[#255](joshuaulrich/quantmod#255)
1. Add fields to `getQuote.yahoo()` that are returned when no fields are
explicitly requested. Thanks to @Courvoisier13 for the report!
[#335](joshuaulrich/quantmod#335)
1. Add intraday endpoint to `getSymbols.yahoo()`. Thanks to @kapsner for the
report and patch! Also allow suppressing the warning if more than 7 days
of data are requested (@eddelbuettel).
[#351](joshuaulrich/quantmod#351)
[#381](joshuaulrich/quantmod#381)
[#399](joshuaulrich/quantmod#399)
1. Add warning if `getSymbols()` is called with tickers that are reserved words
because accessing them requires back-quotes (e.g. ``NA``).
[#401](joshuaulrich/quantmod#401)
1. Fix `allReturns()` when 'subset' is specified. Thanks to @Panagis1980 for
the report!
[#402](joshuaulrich/quantmod#402)
### Changes in 0.4.24 (2023-07-17)
1. Fix `getSymbols.oanda()` URL. Thanks to @macray76 for the report.
[#387](joshuaulrich/quantmod#387)
### Changes in 0.4.23 (2023-06-14)
1. Fix `getQuote.yahoo()` error. Thanks to Ethan B. Smith for the report and
patch!
[#382](joshuaulrich/quantmod#382)
[#383](joshuaulrich/quantmod#383)
1. Add `name` argument to `add_TA()`. Thanks to @SamoPP for the suggestion!
[#377](joshuaulrich/quantmod#377)
[#205](joshuaulrich/quantmod#205)
Description
allReturns ignores subset directive
Expected behavior
allReturns should calculate for given xts subset
you need to add "subset = subset" in each of the five periodReturn calls like below. it works for me:
function (x, subset = NULL, type = "arithmetic", leading = TRUE)
{
x.orig <- x
x <- try.xts(x)
all.ret <- cbind(periodReturn(x, "daily",subset = subset, type = type, leading = FALSE),
periodReturn(x, "weekly",subset = subset,type = type),
periodReturn(x, "monthly",subset = subset, type = type, indexAt = "endof"),
periodReturn(x, "quarterly", subset = subset,type = type, indexAt = "endof"),
periodReturn(x, "yearly",subset = subset, type = type))
colnames(all.ret) <- c("daily", "weekly", "monthly", "quarterly",
"yearly")
reclass(all.ret, x.orig)
}
Minimal, reproducible example
Session Info
The text was updated successfully, but these errors were encountered: