getFGIndex {cryptoQuotes} | R Documentation |
Get the daily Fear and Greed Index for the cryptocurrency market
Description
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)
Usage
getFGIndex(from = NULL, to = NULL)
Arguments
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. |
Details
On time-zones and dates
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()
.
On returns
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.
Value
An xts-object containing,
fgi (numeric): The daily fear and greed index value
Note
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
Author(s)
Serkan Korkmaz
See Also
Other deprecated:
availableExchanges()
,
availableIntervals()
,
availableTickers()
,
getLSRatio()
,
getQuote()
Examples
## 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)