Learn R Programming

cryptoQuotes (version 1.3.0)

get_fgindex: Get the daily Fear and Greed Index for the cryptocurrency market

Description

[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)

Usage

get_fgindex(from = NULL, to = NULL)

Value

An xts-object containing,

  • fgi (numeric): The daily fear and greed index value

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.

Author

Serkan Korkmaz

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.

See Also

Other get-function: get_fundingrate(), get_lsratio(), get_openinterest(), get_quote()

Examples

Run this code
if (FALSE) {
  # 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;
}

Run the code above in your browser using DataLab