getHistoricalData: Download Historical Bar Data

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/getHistoricalData.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

Details

As described by the official Tinkoff Investments documentation

Value

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

Note

Not for the faint of heart. All profits and losses related are yours and yours alone. If you don't like it, write it yourself.

Author(s)

Vyacheslav Arbuzov

See Also

getOrderBook

Examples

1
2
3
live = FALSE
token = 'your_sandbox_token_from_tcs_account'
getHistoricalData(token,live,figi = 'BBG005HLTYH9')

tcsinvest documentation built on Aug. 17, 2021, 9:08 a.m.