fgi {cryptoQuotes}R Documentation

Chart the Fear and Greed Index

Description

[Experimental]

A high-level plotly::plot_ly()-wrapper function. The function adds a subchart with the ⁠fear and greed⁠-index.

Usage

fgi(index, ...)

Arguments

index

A xts::xts()-object. See get_fgindex() for more details.

...

For internal use. Please ignore.

Details

Classification

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

About the Fear and Greed Index

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

Source

This index is fetched from alternative.me, and can be different from the one provided by coinmarketcap.

Value

An invisible plotly::plot_ly()-object.

Author(s)

Serkan Korkmaz

See Also

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

Other sentiment indicators: lsr()

Other subchart indicators: add_event(), lsr(), macd(), rsi(), smi(), volume()

Examples

## Not run: 
  # script start;

  # 1) get the fear and greed index
  # for the last 14 days
  FGIndex <- cryptoQuotes::get_fgindex(
    from = Sys.Date() - 14
  )

  # 2) get the BTC price
  # for the last 14 days
  BTC <- cryptoQuotes::get_quote(
    ticker  = "BTCUSDT",
    source  = "bybit",
    futures = FALSE,
    from    = Sys.Date() - 14
  )

  # 3) chart the daily BTC
  # along side the Fear and
  # Greed Index
  cryptoQuotes::chart(
    ticker = BTC,
    main   = kline(),
    sub    = list(
      fgi(
        FGIndex
      )
    )
  )

  # script end;

## End(Not run)


[Package cryptoQuotes version 1.3.1 Index]