lsr {cryptoQuotes}R Documentation

Chart the long-short ratio

Description

[Experimental]

A high-level plotly::plot_ly()-wrapper function. The function adds a subchart to the chart with ⁠long-short ratio⁠.

Usage

lsr(ratio, ...)

Arguments

ratio

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

...

For internal use. Please ignore.

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(), fgi(), hma(), macd(), rsi(), sma(), smi(), volume(), vwap(), wma(), zlema()

Other sentiment indicators: fgi()

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

Examples

## Not run: 
  # script start;

  # 1) long-short ratio
  # on BTCUSDT pair
  LS_BTC <- cryptoQuotes::get_lsratio(
    ticker   = 'BTCUSDT',
    interval = '15m',
    from     = Sys.Date() - 1,
    to       = Sys.Date()
  )

  # 2) BTCSDT in same period
  # as the long-short ratio;
  BTC <- cryptoQuotes::get_quote(
    ticker   = 'BTCUSDT',
    futures  = TRUE,
    interval = '15m',
    from     = Sys.Date() - 1,
    to       = Sys.Date()
  )

  # 3) plot BTCUSDT-pair
  # with long-short ratio
  cryptoQuotes::chart(
    ticker = BTC,
    main   = cryptoQuotes::kline(),
    sub    = list(
      cryptoQuotes::lsr(
        ratio = LS_BTC
      )
    )
  )

  # end of scrtipt;

## End(Not run)


[Package cryptoQuotes version 1.3.1 Index]