Learn R Programming

cryptoQuotes (version 1.3.0)

fgi: Chart the Fear and Greed Index

Description

[Experimental]

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

fgi(index, internal = list())

Value

Invisbly returns a plotly object.

Arguments

index

The Fear and Greed Index created by getFGIndex()

internal

An empty list. Used for internal purposes. Ignore.

Details

The Fear and Greed Index goes from 0-100, and can be classifed as follows

  • 0-24, Extreme Fear

  • 25-44, Fear

  • 45-55, Neutral

  • 56-75, Greed

  • 76-100, Extreme Greed

See Also

Other chart indicators: add_event(), alma(), bollinger_bands(), chart(), dema(), ema(), evwma(), hma(), lsr(), macd(), rsi(), sma(), volume(), vwap(), wma(), zlema()

Other sentiment indicators: lsr()

Other subcharts: add_event(), lsr(), macd(), rsi(), volume()

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