Issues
Issues are anomalies that doesn't, necessarily, break the R
-package.
Fear and Greed Index Description Issue
The get_fgindex()
-function is not deprecated. This will be fixed in version 1.3.1
,
|
#' @description |
|
#' |
|
#' `r lifecycle::badge("deprecated")` |
|
#' |
|
#' The fear and greed index is a market sentiment indicator that measures investor emotions to |
|
#' gauge whether they are generally fearful (indicating potential selling pressure) or greedy (indicating potential buying enthusiasm) |
|
#' |
Section "Limitations" Issue
The example in the "Limitations"-section uses 30m
granularity, and it seems that kraken
has a lower limit on the date which is a function of the granularity. See, for example, the wiki
for a similar example for 1h
granularity. There is nothing about this on the exchange docs, so it is indeed an unexpected error. The following section of the article has to be changed from 30m
to 1h
,
|
```{r} |
|
## 1) create date |
|
## sequence |
|
dates <- seq( |
|
from = as.POSIXct(Sys.Date()), |
|
by = "-30 mins", |
|
length.out = 1440 |
|
) |
|
|
|
## 2) split the sequence |
|
## in multiples of 100 |
|
## by assigning numbers |
|
## to each indices of 100 |
|
idx <- rep( |
|
x = 1:2, |
|
each = 720 |
|
) |
|
|
|
## 3) use the idx to split |
|
## the dates into equal parts |
|
split_dates <- split( |
|
x = dates, |
|
f = idx |
|
) |
|
|
|
## 4) collect all all |
|
## calls in a list |
|
## using lapply |
|
ohlc <- lapply( |
|
X = split_dates, |
|
FUN = function(dates){ |
|
|
|
|
|
Sys.sleep(1) |
|
|
|
cryptoQuotes::get_quote( |
|
ticker = "BTCUSD", |
|
source = "kraken", |
|
futures = FALSE, |
|
interval = "30m", |
|
from = min(dates), |
|
to = max(dates) |
|
) |
|
|
|
}) |
|
|
|
## 4.1) rbind all |
|
## elements |
|
nrow( |
|
ohlc <- do.call( |
|
what = rbind, |
|
args = ohlc |
|
) |
|
) |
|
``` |
Error in Vignette
Dogecoin rallied 20% at the minute of the tweet. But in the vignette it shows -0.15%.
The source of the error is currently unkown.
Warning in get_lsr
## long-short ratio
## Binance
cryptoQuotes::get_lsratio(
"BTCUSDT",
interval = "15m",
source = "binance"
)
#> In (function (...) : 'tzone' attributes are inconsistent
This warning is displayed for all intervals
, and only for binance
. The source of the problem is currently unknown but was not present before 1.3.0
.
Broken Code
Charting Long-Short Ratios
The new structure of the returned quotes
with the get_lsr()
-function broke lsr()
-chart, due to how variables are retrieved.
|
plotly::layout( |
|
yaxis = list( |
|
title = 'Long-Short Ratio' |
|
), |
|
p = plotly::plot_ly( |
|
showlegend = FALSE, |
|
data = ratio, |
|
y = ~ls_ratio, |
|
x = ~Index, |
|
type = 'scatter', |
|
mode = 'lines+markers', |
|
line = list( |
|
color = 'gray', |
|
dash = 'dash', |
|
shape = 'spline', |
|
smoothing = 1.5 |
|
), |
|
marker = list( |
|
size = 10, |
|
color = ~color_scale, |
|
line = list( |
|
color = 'black', |
|
width = 2 |
|
) |
|
) |
|
) |
|
) |