trading_ws_md: Web Sockets: Market Data Real Time

Description Usage Arguments Value See Also Examples

View source: R/functions_websocket.R

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")}

This method brings Market Data in Real Time using web socket protocol.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
trading_ws_md(
  connection,
  destination,
  symbol,
  entries = list("BI", "OF", "LA", "OP", "CL", "SE", "OI", "HI", "LO", "TV", "IV",
    "EV", "NV", "TC"),
  listen_to = NA,
  market_id = "ROFX",
  where_is_env = .GlobalEnv
)

Arguments

connection

S4. Mandatory Formal rRofexConnection class object

destination

String. Name of the tibble where the data is going to be stored.

symbol

String. Mandatory. Use trading_instruments to see which symbols are available.

entries

List of Strings. It contains the information to be queried:

  • BI - Bid.

  • OF - Offer.

  • LA - Last Available Price.

  • OP - Open Price.

  • CL - Close Price.

  • SE - Settlement Price.

  • OI - Open Interest.

  • HI - Trading Session High Price

  • LO - Trading Session Low Price

  • TV - Trading Volume

  • IV - Index Value

  • EV - Trading Effective Volume

  • NV - Nominal Volume

  • TC - Trade Count

listen_to

List. Column names from the tibble that you are going to listen to. This is not the same as entries names.

market_id

String. Market to which you are going to connect.

where_is_env

Environment. Only for advance users.

Value

If correct, it will load a tibble.

See Also

Other websocket functions: trading_ws_close(), trading_ws_orders()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# To create simultaneously many connections

## Not run: 
purrr::walk2(
.x = symbols,
.y = tickers,
.f = ~ trading_ws_md(connection = conn, destination = .y, symbol = .x)
)

## End(Not run)

rRofex documentation built on Aug. 2, 2021, 9:06 a.m.