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

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


# To create simultaneously many connections

if (FALSE) {
purrr::walk2(
.x = symbols,
.y = tickers,
.f = ~ trading_ws_md(connection = conn, destination = .y, symbol = .x)
)
}