getQuote {cryptoQuotes}R Documentation

Get the Open, High, Low, Close and Volume data on a cryptocurrency pair

Description

[Deprecated]

Get a quote on a cryptocurrency pair from the available_exchanges() in various available_intervals() for any actively traded available_tickers().

Usage

## get OHLC-V
getQuote(
 ticker,
 source   = 'binance',
 futures  = TRUE,
 interval = '1d',
 from     = NULL,
 to       = NULL
)

Arguments

ticker

An character-vector of length 1. See available_tickers() for available tickers.

source

A character-vector of length 1. binance by default. See available_exchanges() for available exchanges.

futures

A logical-vector of length 1. TRUE by default. Returns futures market if TRUE, spot market otherwise.

interval

A character-vector of length 1. ⁠1d⁠ by default. See available_intervals() for available intervals.

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,

Author(s)

Serkan Korkmaz

See Also

Other deprecated: availableExchanges(), availableIntervals(), availableTickers(), getFGIndex(), getLSRatio()

Examples

## Not run: 
# script: scr_getQuote
# date: 2024-02-29
# author: Serkan Korkmaz, serkor1@duck.com
# objective: Demonstrate the basic
# usage of the get_quote-function
# script start;


  # 1) Load BTC spot
  # from Kucoin with 30 minute
  # intervals
  BTC <- cryptoQuotes::get_quote(
    ticker   = 'BTCUSDT',
    source   = 'binance',
    interval = '30m',
    futures  = FALSE,
    from     = Sys.Date() - 1
  )

  # 2) chart the spot price
  # using the chart
  # function
  cryptoQuotes::chart(
    ticker = BTC,
    main   = cryptoQuotes::kline(),
    indicator = list(
      cryptoQuotes::volume(),
      cryptoQuotes::bollinger_bands()
    )
  )

# script end;

## End(Not run)

[Package cryptoQuotes version 1.3.0 Index]