Learn R Programming

PoloniexR (version 0.0.1)

ReturnOrderBook: Returns the order book for a given market, as well as a sequence number for use with the Push API and an indicator specifying whether the market is frozen.

Description

Returns the order book for a given market, as well as a sequence number for use with the Push API and an indicator specifying whether the market is frozen.

Usage

ReturnOrderBook(theObject, pair = "all", depth = 10)

Arguments

theObject

The public client API object on which the function should be called.

pair

length one-character vector - The currencypair for which orderbook information should be fetched. You may set pair to "all" to fetch the order books of all markets.

depth

numeric - depth of the orderbook.

Value

A list containing orderbook information.

if pair == "all": a list containing orderbook information for all available markets. Each list entry contains information for one specific market. if !pair == "all": a list containing orderbook information for the requested markets.

Each market list contains following fields: - ask: Orderbook sell side, Dataframe containing ask prices and corresponding amounts. - bid: Orderbook buy side. Dataframe containing bid prices and corresponding amounts. - frozen: indicator specifying wheather market is frozen or not. - seq: Sequence number for Push API.

Examples

Run this code
# NOT RUN {
poloniex.public <- PoloniexPublicAPI()

pair <- "BTC_NXT"
depth <- 100
order.book <- ReturnOrderBook(poloniex.public,
                              pair  = pair,
                              depth = 10)
order.book$bid
order.book$ask
order.book$frozen
order.book$seq

pair <- "all"
depth <- 10
order.book <- ReturnOrderBook(poloniex.public,
                              pair  = pair,
                              depth = 10)

names(order.book)
order.book$BTC_ETH$ask
# }

Run the code above in your browser using DataLab