Learn R Programming

tcsinvest (version 0.1.1)

getHistoricalData: Download Historical Bar Data

Description

Makes a request to the server, and returns an data.table object with information about prices of instrument if successful.

Usage

getHistoricalData(
  token = "",
  live = FALSE,
  figi = "",
  from = Sys.Date() - 1,
  to = Sys.Date(),
  interval = "hour",
  time_transform = TRUE,
  verbose = FALSE
)

Arguments

token

token from Tinkoff account

live

live trading - TRUE or sandbox (paper) trading - FALSE (default)

figi

internal tinkoff code for instrument

from

from what date download history

to

to what date download history

interval

timeframe of bars (availible "1min","2min","3min","5min","10min","15min","30min","hour","2hour","4hour","day","week","month")

time_transform

trasform time from string to POSIXct

verbose

display status of retrieval (default FALSE)

Value

returns an data.table object containing the requested data with historical bar data (OHLCV).

Details

As described by the official Tinkoff Investments documentation

See Also

getOrderBook

Examples

Run this code
# NOT RUN {
live = FALSE
token = 'your_sandbox_token_from_tcs_account'
getHistoricalData(token,live,figi = 'BBG005HLTYH9')
# }

Run the code above in your browser using DataLab