bitbay_aggregate: Aggregate BitBay transactions

Description Usage Arguments Value Author(s) References See Also Examples

Description

bitbay_aggregate aggregates BitBay transactions by aggr_time-time interval. If in a given time interval there are no transactions (count is 0) then the last available "Close" value is used.

Usage

1
bitbay_aggregate(data, aggr_time = 1 * 60)

Arguments

data

object of class bitbay_transactions generated by bitbay_trades or bitbay_trades_from_date functions.

aggr_time

a numeric vector of length 1 with seconds

Value

A time series object of class zoo and xts with following columns: Open, High, Low, Close, Mean, Median, Volume_total, volume_buy, Volume_sell, Count

(Each column name has a coin_currency. prefix)

Author(s)

Michal Majka

References

BitBay: https://bitbay.net/en/home

BitBay Public API: https://bitbay.net/en/api-publiczne

See Also

bitbay_orderbook, bitbay_trades, bitbay_trades_from_datebitbay_profit

Examples

1
2
3
4
5
6
7
8
## Not run: 
data <- bitbay_trades(pair = "BTC/USD", last_trades = 200)

aggr_data_1min <- bitbay_aggregate(data, aggr_time = 60)
aggr_data_15min <- bitbay_aggregate(data, aggr_time = 15 * 60)
aggr_data_1h <- bitbay_aggregate(data, aggr_time = 60 * 60)

## End(Not run)

majkamichal/BitBayR documentation built on May 29, 2019, 3:43 a.m.