streamSubscribe: Subscribe/Unsubscribe to stream

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

View source: R/streamSubscribe.R

Description

this function subscribes and unsubscribe for streaming

Usage

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

Details

As described by the official Tinkoff Investments documentation.

Value

returns result of stream handler

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

streamStatus streamClose streamClient


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