Learn R Programming

tcsinvest (version 0.1.1)

streamSubscribe: Subscribe/Unsubscribe to stream

Description

this function subscribes and unsubscribe for streaming

Usage

streamSubscribe(
  client = NULL,
  subscribe = TRUE,
  type = "candle",
  figi = "BBG004730N88",
  FUN = "print",
  interval = "1min",
  depth = 10
)

Arguments

client

object from streamClient result, class of object ws

subscribe

subscribe - TRUE (default) or unsubscribe - FALSE

type

type of events for subscription: "candle","orderbook" or "instrument_info"

figi

internal tinkoff code for instrument

FUN

function for handler (default print)

interval

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

depth

depth of orderbook, number of bids and asks (1 <= depth <= 20)

Value

returns result of stream handler

Details

As described by the official Tinkoff Investments documentation.

See Also

streamStatus streamClose streamClient