Learn R Programming

rCoinbase (version 1.0.0)

cb_lmt_twap_gtd_order: Spot: Place Limit TWAP Order

Description

Spot: Place Limit TWAP Order

Usage

cb_lmt_twap_gtd_order(
  client_order_id = cb_get_order_id(),
  product_id,
  side,
  base_size,
  order_start,
  order_exp,
  limit_price,
  number_buckets,
  bucket_duration
)

Value

returns order details as a data.frame for limit TWAP orders

Arguments

client_order_id

= (string) A unique ID provided for the order (used for identification purposes) Example: 0000-00000-000000

product_id

= (string) The trading pair (e.g. 'BTC-USD'). Example: BTC-USD

side

= (string) The side of the market that the order is on (e.g. 'BUY', 'SELL'). Possible values: BUY, SELL

base_size

= (string) The amount of the first Asset in the Trading Pair. Example: 0.001

order_start

= (TimeStamp) Enter the time you wish to cancel if not filled: Ex. Sys.time()+minutes(5)

order_exp

= (TimeStamp) Enter the time you wish to cancel if not filled: Ex. Sys.time()+minutes(10)

limit_price

= (string) The specified price, or better, that the Order should be executed at. A Buy Order will execute at or lower than the limit price. A Sell Order will execute at or higher than the limit price. Example: 10000.00

number_buckets

= (string) The number of smaller buckets/suborders over which the entire order will be broken into. Each suborder will be executed over a duration calculated based on the end_time. Example: 5

bucket_duration

= (string) The duration over which each sub order was executed. Example: 300s

Examples

Run this code
if (FALSE) {
  cb_lmt_twap_gtd_order(product_id = "BTC-USD",
                        side = "BUY",
                        base_size = '0.00004',
                        order_start = Sys.time() + minutes(1),
                        order_exp = Sys.time()+minutes(6),
                        limit_price = '100000',
                        number_buckets = 2,
                        bucket_duration = "300")
}

Run the code above in your browser using DataLab