get_fgindex | R Documentation |
Get the daily fear and greed index.
get_fgindex(
from = NULL,
to = NULL
)
from |
An optional character-, date- or POSIXct-vector of length 1. NULL by default. |
to |
An optional character-, date- or POSIXct-vector of length 1. NULL by default. |
The Fear and Greed Index goes from 0-100, and can be classified as follows,
0-24, Extreme Fear
25-44, Fear
45-55, Neutral
56-75, Greed
76-100, Extreme Greed
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).
This index is fetched from alternative.me, and can be different from the one provided by coinmarketcap.
An <[xts]>-object containing,
index |
<POSIXct> the time-index |
fgi |
<numeric> the daily fear and greed index value |
Sample output
#> fgi #> 2024-05-12 02:00:00 56 #> 2024-05-13 02:00:00 57 #> 2024-05-14 02:00:00 66 #> 2024-05-15 02:00:00 64 #> 2024-05-16 02:00:00 70 #> 2024-05-17 02:00:00 74
Serkan Korkmaz
Other get-functions:
get_fundingrate()
,
get_lsratio()
,
get_openinterest()
,
get_quote()
## Not run:
# script start;
# 1) get the fear and greed index
# for the last 7 days
tail(
fgi <- cryptoQuotes::get_fgindex(
from = Sys.Date() - 7
)
)
# script end;
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.