get_fgindex {cryptoQuotes} | R Documentation |
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)
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. |
Values passed to from
or to
must be coercible by as.Date()
, or as.POSIXct()
, with a format of either "%Y-%m-%d"
or "%Y-%m-%d %H:%M:%S"
. By default
all dates are passed and returned with Sys.timezone()
.
If only from
is provided 200 pips are returned up to Sys.time()
. If only to
is provided 200 pips up to the specified date
is returned.
An xts-object containing,
fgi (numeric): The daily fear and greed index value
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
Serkan Korkmaz
Other get-function:
get_fundingrate()
,
get_lsratio()
,
get_openinterest()
,
get_quote()
## Not run:
# script: Fear and Greed Index
# date: 2023-12-26
# author: Serkan Korkmaz, serkor1@duck.com
# objective: Retrieve and Plot the
# index
# 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)