ftx_ohlcv: FTX OHLCV snapshots

View source: R/major/ftx_ohlcv.R View source: R/ftx_ohlcv.R

ftx_ohlcvR Documentation

FTX OHLCV snapshots

Description

FTX OHLCV snapshots

Usage

ftx_ohlcv(
  pairs = c("BTC/USD", "USD:USD", "SOL/USD", "LUNA/USD")[1],
  origin = as.POSIXlt(Sys.time(), tz = "UTC") - 30,
  timeframe = c("15s", "1m", "5m", "15m", "1h", "4h", "1d", "3d", "1w", "2w", "1M")[1],
  limit = 2L,
  ftx = ftx
)

Arguments

pairs

character vector of pairs of coins

origin

POSIXlt (not as.POSIXct) - start datetime

timeframe

single character vector of time steps

limit

number of timesteps

ftx

pointer to a ccxt exchange

Value

a tibble of ohlcv snapshots by coin, by datetime.

Author(s)

john@1x2.ltd

See Also

medium.com/alphaimpact/how-to-link-your-ftx-com-api-keys-so-you-can-copy-trades-or-be-copied-9-simple-steps-172372888034

Examples

# Connection to FTX api (requires key/secret)
ftx = reticulate::import('ccxt')$ftx(
  list(
    enableRateLimit = "True",
    apiKey          = Sys.getenv('FTX_key'),
    secret          = Sys.getenv('FTX_secret'))
)
ftx_ohlcv (
    pairs = c('BTC/USD'), # pairs of coins
    origin = as.POSIXlt(Sys.time(), tz = "UTC") - 30*60, # start 30 mins ago
    timeframe = c("15s"), # 15 sec timesteps
    limit = 2L, # two timesteps
    ftx = ftx)  # FTX pointer via reticulate::import('ccxt')$ftx

JohnGavin/ccxt documentation built on Sept. 3, 2022, 5:53 a.m.