| Title: | 'Coinbase Advance Trade API Interface' |
|---|---|
| Description: | The 'Coinbase Advanced Trade API' <https://docs.cdp.coinbase.com/api-reference/advanced-trade-api/rest-api/introduction> lets you manage orders, portfolios, products, and fees with the new v3 endpoints. |
| Authors: | Jason Guevara [aut, cre] |
| Maintainer: | Jason Guevara <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.0 |
| Built: | 2026-06-05 09:20:56 UTC |
| Source: | https://github.com/jgquantscripts/rcoinbase |
Assign working tokens
assign_tokens()assign_tokens()
creates working environment that reads/writes binary tokens and assigns variable in working environment
## Not run: assign_tokens() ## End(Not run)## Not run: assign_tokens() ## End(Not run)
Gets Bearer Token
build_jwt(key_var, secret_var, method, endpoint)build_jwt(key_var, secret_var, method, endpoint)
key_var |
= your personal API key |
secret_var |
= your personal secret token |
method |
= GET, POST, etc. |
endpoint |
= endpoint to use |
returns JWT token to make API requests
Get OHLCV Bars (short-term)
cb_bars(product_id, start_time, end_time, bar_size)cb_bars(product_id, start_time, end_time, bar_size)
product_id |
= The trading pair (e.g. 'BTC-USD'). |
start_time |
= The UNIX timestamp indicating the start of the time interval. |
end_time |
= The UNIX timestamp indicating the end of the time interval. |
bar_size |
= The timeframe each candle represents. Examples: ONE_MINUTE, FIVE_MINUTE, FIFTEEN_MINUTE, THIRTY_MINUTE, ONE_HOUR, TWO_HOUR, SIX_HOUR, ONE_DAY |
Get a data.frame with rates for a single product by product ID, grouped in buckets.
returns OHLCV for cryptocurrencies
## Not run: cb_bars(product_id = "ETH-USD", start_time = Sys.time()-hours(1), end_time = Sys.time(), bar_size = 'FIVE_MINUTE') ## End(Not run)## Not run: cb_bars(product_id = "ETH-USD", start_time = Sys.time()-hours(1), end_time = Sys.time(), bar_size = 'FIVE_MINUTE') ## End(Not run)
Futures: Cancel Sweep
cb_cancel_futures_sweep()cb_cancel_futures_sweep()
A data.frame detailing the pending sweep of funds from FCM wallet to USD Spot wallet
## Not run: cb_cancel_futures_sweep() ## End(Not run)## Not run: cb_cancel_futures_sweep() ## End(Not run)
Spot: Cancel Order
cb_cancel_order(order_ids)cb_cancel_order(order_ids)
order_ids |
= (string) enter the order id that you wish to cancel |
returns order details as a data.frame for cancelled orders
## Not run: cb_cancel_order(order_ids='ASDGF123-SDVSA123-SAEF123') ## End(Not run)## Not run: cb_cancel_order(order_ids='ASDGF123-SDVSA123-SAEF123') ## End(Not run)
Get OHLCV Bars (long-term)
cb_candles(product_id, start, end, bar_size)cb_candles(product_id, start, end, bar_size)
product_id |
= The trading pair (e.g. 'BTC-USD'). |
start |
= start date to get data. Ex. Sys.Date()-60 |
end |
= End date to get data. Ex. Sys.Date() |
bar_size |
= The timeframe each candle represents. Examples: ONE_MINUTE, FIVE_MINUTE, FIFTEEN_MINUTE, THIRTY_MINUTE, ONE_HOUR, TWO_HOUR, SIX_HOUR, ONE_DAY |
Get a data.frame with rates for a single product by product ID, grouped in buckets for more than 350 bars.
## Not run: cb_candles(product_id="BTC-USD", start=Sys.Date()-30, end=Sys.Date(), bar_size= "FIFTEEN_MINUTE") ## End(Not run)## Not run: cb_candles(product_id="BTC-USD", start=Sys.Date()-30, end=Sys.Date(), bar_size= "FIFTEEN_MINUTE") ## End(Not run)
Futures: Cancel Order
cb_close_order(client_order_id = cb_get_order_id(), product_id, size = NULL)cb_close_order(client_order_id = cb_get_order_id(), product_id, size = NULL)
client_order_id |
= defaults to random id via cb_get_order_id() |
product_id |
= futures contract to close |
size |
= number of contracts to close, defaults to closing all available |
Cancel response data.frame status for a futures order
## Not run: cb_close_order(product_id = "BIT-28JUL23-CDE") ## End(Not run)## Not run: cb_close_order(product_id = "BIT-28JUL23-CDE") ## End(Not run)
Commit Convert Trade
cb_commit_convert_trade(trade_id, from_account, to_account)cb_commit_convert_trade(trade_id, from_account, to_account)
trade_id |
= The ID of the trade to commit. |
from_account |
= The currency of the account to convert from (e.g. USD). |
to_account |
= The currency of the account to convert to (e.g. USDC). |
Commits a convert trade with a specified trade id, source account, and target account and returns a data.frame response
## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)
Create Convert Quote
cb_create_convert_quote(amount, from_account, to_account)cb_create_convert_quote(amount, from_account, to_account)
amount |
= The ID of the trade to commit. |
from_account |
= The currency of the account to convert from (e.g. USD). |
to_account |
= The currency of the account to convert to (e.g. USDC). |
A data.frame with details regarding creating a convert quote with a specified source account,target account, and amount. Convert is applicable for USDC-USD, EURC-EUR, and PYUSD-USD conversion
## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)
Get Convert Trade
cb_get_convert_trade(trade_id, from_account, to_account)cb_get_convert_trade(trade_id, from_account, to_account)
trade_id |
= The ID of the trade to commit. |
from_account |
= The currency of the account to convert from (e.g. USD). |
to_account |
= The currency of the account to convert to (e.g. USDC). |
A data.frame with account information about a convert trade with a specified trade id, source account, and target account
## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)## Not run: qte = cb_create_convert_quote(amount = 100, from_account = "USD", to_account = "USDC") ord = cb_commit_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") stat = cb_get_convert_trade(trade_id = qte$id, from_account = "USD", to_account = "USDC") ## End(Not run)
Futures: Get Margin Window
cb_get_current_margin_window( margin_profile_type = "MARGIN_PROFILE_TYPE_RETAIL_REGULAR" )cb_get_current_margin_window( margin_profile_type = "MARGIN_PROFILE_TYPE_RETAIL_REGULAR" )
margin_profile_type |
= The margin profile type for your account: MARGIN_PROFILE_TYPE_UNSPECIFIED |
Get the futures current margin window as a data.frame
## Not run: cb_get_current_margin_window() ## End(Not run)## Not run: cb_get_current_margin_window() ## End(Not run)
Account Fees
cb_get_fees( product_type = "UNKNOWN_PRODUCT_TYPE", contract_expiry_type = "UNKNOWN_CONTRACT_EXPIRY_TYPE", product_venue = "UNKNOWN_VENUE_TYPE" )cb_get_fees( product_type = "UNKNOWN_PRODUCT_TYPE", contract_expiry_type = "UNKNOWN_CONTRACT_EXPIRY_TYPE", product_venue = "UNKNOWN_VENUE_TYPE" )
product_type |
= Only returns the orders matching this product type. By default, returns all product types. 'UNKNOWN_PRODUCT_TYPE', 'SPOT','FUTURE' |
contract_expiry_type |
= Only returns the orders matching this contract expiry type. Only applicable if product_type is set to FUTURE. 'UNKNOWN_CONTRACT_EXPIRY_TYPE','EXPIRING', 'PERPETUAL' |
product_venue |
= Venue for product 'UNKNOWN_VENUE_TYPE','CBE','FCM','INTX' |
A data.frame with a summary of transactions with fee tiers, total volume, and fees.
## Not run: cb_get_fees() ## End(Not run)## Not run: cb_get_fees() ## End(Not run)
Futures: Get Balance
cb_get_futures_balance()cb_get_futures_balance()
Get Futures Balance Summary as a data.frame
## Not run: cb_get_futures_balance() ## End(Not run)## Not run: cb_get_futures_balance() ## End(Not run)
Futures: Get Position
cb_get_futures_position(product_id)cb_get_futures_position(product_id)
product_id |
= The ticker symbol (e.g. 'BIT-28JUL25-CDE') |
Get Futures Position as a data.frame
Get positions for a specific CFM product
## Not run: cb_get_futures_position(product_id = 'BIT-28JUL25-CDE') ## End(Not run)## Not run: cb_get_futures_position(product_id = 'BIT-28JUL25-CDE') ## End(Not run)
Futures: Get Intraday Margin
cb_get_intraday_margin()cb_get_intraday_margin()
Get intraday margin Setting as a data.frame
## Not run: cb_get_intraday_margin() ## End(Not run)## Not run: cb_get_intraday_margin() ## End(Not run)
Order ID
cb_get_order_id()cb_get_order_id()
An auto generated character string to use for placing orders
## Not run: cb_get_order_id() ## End(Not run)## Not run: cb_get_order_id() ## End(Not run)
Get Accounts
cb_getAccount(acct_uuid)cb_getAccount(acct_uuid)
acct_uuid |
= The account's UUID. |
Get a data.frame of information about an account, given an account UUID.
## Not run: cb_getAccount(acct_uuid = 'f412dr89-01d0-576d-g457-ea0b52a13716') ## End(Not run)## Not run: cb_getAccount(acct_uuid = 'f412dr89-01d0-576d-g457-ea0b52a13716') ## End(Not run)
List Accounts
cb_getAccounts(lmt)cb_getAccounts(lmt)
lmt |
= The number of accounts to display per page. By default, displays 49 (max 250) |
Get a data.frame of authenticated Advanced Trade accounts for the current user.
## Not run: cb_getAccounts(lmt = 100) ## End(Not run)## Not run: cb_getAccounts(lmt = 100) ## End(Not run)
Get Crypto List
cb_getCryptoList()cb_getCryptoList()
Get a data.frame with all crypto currency pairs
## Not run: cb_getCryptoList() ## End(Not run)## Not run: cb_getCryptoList() ## End(Not run)
Get Order
cb_getOrder(id)cb_getOrder(id)
id |
= The ID of the order |
Get a detailed data.frame for the order requested.
## Not run: cb_getOrder(id='1234') ## End(Not run)## Not run: cb_getOrder(id='1234') ## End(Not run)
Futures: List All Positions
cb_list_futures_positions()cb_list_futures_positions()
Get a list of positions in CFM products as a data.frame
## Not run: cb_list_futures_positions() ## End(Not run)## Not run: cb_list_futures_positions() ## End(Not run)
Futures: List Sweeps
cb_list_futures_sweeps()cb_list_futures_sweeps()
Gets data.frame for pending and processing sweeps of funds from FCM wallet to USD Spot wallet
## Not run: cb_list_futures_sweeps() ## End(Not run)## Not run: cb_list_futures_sweeps() ## End(Not run)
Spot: Place Limit FOK Order
cb_lmt_fok_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )cb_lmt_fok_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )
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 |
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 |
returns order details as a data.frame for limit FOK orders
## Not run: cb_lmt_fok_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)## Not run: cb_lmt_fok_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)
Spot: Place Limit GTC Order
cb_lmt_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )cb_lmt_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )
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 |
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 |
returns order details as a data.frame for limit GTC orders
## Not run: cb_lmt_gtc_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)## Not run: cb_lmt_gtc_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)
Spot: Place Limit GTD Order
cb_lmt_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, order_exp )cb_lmt_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, order_exp )
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 |
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 |
order_exp |
= (TimeStamp) Enter the time you wish to cancel if not filled: Ex. Sys.time()+minutes(5) |
returns order details as a data.frame for limit GTD orders
## Not run: cb_lmt_fok_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000', order_exp = Sys.time()+minutes(33)) ## End(Not run)## Not run: cb_lmt_fok_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000', order_exp = Sys.time()+minutes(33)) ## End(Not run)
Spot: Place Limit TWAP Order
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 )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 )
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 |
returns order details as a data.frame for limit TWAP orders
## Not run: 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") ## End(Not run)## Not run: 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") ## End(Not run)
Spot: Place Market Order
cb_mkt_order(client_order_id = cb_get_order_id(), product_id, side, base_size)cb_mkt_order(client_order_id = cb_get_order_id(), product_id, side, base_size)
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 |
returns order details as a data.frame for market orders
## Not run: cb_mkt_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00001') ## End(Not run)## Not run: cb_mkt_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00001') ## End(Not run)
Order Builder
cb_order_builder( order_type, client_order_id, product_id, side, leverage = 1, margin_type = "CROSS", preview_id = NULL, base_size = NULL, quote_size = NULL, start_time = NULL, end_time = NULL, limit_price = NULL, number_buckets = NULL, bucket_duration = NULL, bucket_size = NULL, post_only = FALSE, stop_price = NULL, stop_direction = NULL, stop_trigger_price = NULL )cb_order_builder( order_type, client_order_id, product_id, side, leverage = 1, margin_type = "CROSS", preview_id = NULL, base_size = NULL, quote_size = NULL, start_time = NULL, end_time = NULL, limit_price = NULL, number_buckets = NULL, bucket_duration = NULL, bucket_size = NULL, post_only = FALSE, stop_price = NULL, stop_direction = NULL, stop_trigger_price = NULL )
order_type |
= (string) type of order : "market_market_ioc" |
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 |
leverage |
= (string) The amount of leverage for the order (default is 1.0). Example: 2.0 |
margin_type |
= (string) Margin Type for this order (default is CROSS). Possible values: CROSS, ISOLATED |
preview_id |
= (string) Preview ID for this order, to associate this order with a preview request. Example: b40bbff9-17ce-4726-8b64-9de7ae57ad26 |
base_size |
= (string) The amount of the first Asset in the Trading Pair. Example: 0.001 |
quote_size |
= (string) The amount of the second Asset in the Trading Pair. Example: 10.00 |
start_time |
= (RFC3339 Timestamp) Time at which the order should begin executing. Example: 2021-05-31T07:59:59Z |
end_time |
= (RFC3339 Timestamp) The time at which the order will be canceled if it is not Filled. Example: 2021-05-31T09:59:59Z |
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 |
bucket_size |
= (string) The size of each suborder. bucket_size multiplied by number_buckets should match the size of the entire twap order) |
post_only |
= (boolean) Enable or disable Post-only Mode. When enabled, only Maker Orders will be posted to the Order Book. Orders that will be posted as a Taker Order will be rejected. |
stop_price |
= (string) The specified price that will trigger the placement of the Order. Example: 20000.00 |
stop_direction |
= (string) The direction of the stop limit Order. Possible values: STOP_DIRECTION_STOP_UP, STOP_DIRECTION_STOP_DOWN |
stop_trigger_price |
= (string) The price level (in quote currency) where the position will be exited. When triggered, a stop limit order is automatically placed with a limit price 5% higher for BUYS and 5% lower for SELLS. Example: 20000.00 |
returns a list for the order configuration depending on the order type
## Not run: cb_order_builder(order_type="market_market_ioc", client_order_id='1234', product_id="BTC-USD", side="BUY", leverage = 1.0, margin_type='CROSS',preview_id=NULL, base_size="0.00001", quote_size=NULL, start_time=NULL, end_time=NULL, limit_price=NULL, number_buckets=NULL, bucket_duration=NULL, bucket_size = NULL, post_only=FALSE, stop_price=NULL, stop_direction=NULL, stop_trigger_price=NULL) ## End(Not run)## Not run: cb_order_builder(order_type="market_market_ioc", client_order_id='1234', product_id="BTC-USD", side="BUY", leverage = 1.0, margin_type='CROSS',preview_id=NULL, base_size="0.00001", quote_size=NULL, start_time=NULL, end_time=NULL, limit_price=NULL, number_buckets=NULL, bucket_duration=NULL, bucket_size = NULL, post_only=FALSE, stop_price=NULL, stop_direction=NULL, stop_trigger_price=NULL) ## End(Not run)
Crypto Pair Bid/Ask Quotes
cb_quote(ids)cb_quote(ids)
ids |
= vector of product id(s) Example: "BTC-USD" OR c("BTC-USD","ETH-USD") |
Get a data.frame for the best bid/ask for all products.
## Not run: cb_quote(ids=c("BTC-USD","ETH-USD")) ## End(Not run)## Not run: cb_quote(ids=c("BTC-USD","ETH-USD")) ## End(Not run)
Futures: Schedule Sweeps
cb_schedule_futures_sweeps(usd_amount)cb_schedule_futures_sweeps(usd_amount)
usd_amount |
= The amount of USD to be swept. By default, sweeps all available excess funds. |
Gets data.frame for scheduling a sweep of funds from FCM wallet to USD Spot wallet
## Not run: cb_schedule_futures_sweeps(usd_amount = 100.00) ## End(Not run)## Not run: cb_schedule_futures_sweeps(usd_amount = 100.00) ## End(Not run)
Futures: Set Intraday Margin
cb_set_intraday_margin(setting)cb_set_intraday_margin(setting)
setting |
= The amount of USD to be swept. By default, sweeps all available excess funds. |
Gets data.frame with details for setting intraday margin
## Not run: cb_set_intraday_margin(setting = 100.00) ## End(Not run)## Not run: cb_set_intraday_margin(setting = 100.00) ## End(Not run)
Spot: Place Limit IOC Order
cb_sor_lmt_ioc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )cb_sor_lmt_ioc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price )
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 |
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 |
returns order details as a data.frame for limit IOC orders
## Not run: cb_sor_lmt_ioc_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)## Not run: cb_sor_lmt_ioc_order(product_id = "BTC-USD", side = "BUY", base_size = '0.00004', limit_price = '100000') ## End(Not run)
Spot: Place Stop-Limit GTC Order
cb_stp_lmt_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_price, stop_direction )cb_stp_lmt_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_price, stop_direction )
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 |
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 |
stop_price |
= (string) The specified price that will trigger the placement of the Order. Example: 20000.00 |
stop_direction |
= (string) The direction of the stop limit Order. Possible values: STOP_DIRECTION_STOP_UP, STOP_DIRECTION_STOP_DOWN |
returns order details as a data.frame for stop-limit GTC orders
## Not run: cb_stp_lmt_gtc_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_price="85000", stop_direction='STOP_DIRECTION_STOP_DOWN') ## End(Not run)## Not run: cb_stp_lmt_gtc_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_price="85000", stop_direction='STOP_DIRECTION_STOP_DOWN') ## End(Not run)
Spot: Place Stop-Limit GTD Order
cb_stp_lmt_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_price, order_exp, stop_direction )cb_stp_lmt_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_price, order_exp, stop_direction )
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 |
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 |
stop_price |
= (string) The specified price that will trigger the placement of the Order. Example: 20000.00 |
order_exp |
= (TimeStamp) Enter the time you wish to cancel if not filled: Ex. Sys.time()+minutes(10) |
stop_direction |
= (string) The direction of the stop limit Order. Possible values: STOP_DIRECTION_STOP_UP, STOP_DIRECTION_STOP_DOWN |
returns order details as a data.frame for stop-limit GTD orders
## Not run: cb_stp_lmt_gtd_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_price="85000", order_exp=Sys.time()+minutes(15), stop_direction='STOP_DIRECTION_STOP_DOWN') ## End(Not run)## Not run: cb_stp_lmt_gtd_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_price="85000", order_exp=Sys.time()+minutes(15), stop_direction='STOP_DIRECTION_STOP_DOWN') ## End(Not run)
Spot: Place Trigger Bracket GTC Order
cb_trig_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_trigger_price )cb_trig_gtc_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_trigger_price )
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 |
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 |
stop_trigger_price |
= (string) The price level (in quote currency) where the position will be exited. When triggered, a stop limit order is automatically placed with a limit price 5% higher for BUYS and 5% lower for SELLS. Example: 20000.00 |
returns order details as a data.frame for trigger GTC orders
## Not run: cb_trig_gtc_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_trigger_price="115000") ## End(Not run)## Not run: cb_trig_gtc_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_trigger_price="115000") ## End(Not run)
Spot: Place Trigger Bracket GTD Order
cb_trig_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_trigger_price, order_exp )cb_trig_gtd_order( client_order_id = cb_get_order_id(), product_id, side, base_size, limit_price, stop_trigger_price, order_exp )
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 |
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 |
stop_trigger_price |
= (string) The price level (in quote currency) where the position will be exited. When triggered, a stop limit order is automatically placed with a limit price 5% higher for BUYS and 5% lower for SELLS. Example: 20000.00 |
order_exp |
= (TimeStamp) Enter the time you wish to cancel if not filled: Ex. Sys.time()+minutes(10) |
returns order details as a data.frame for trigger GTD orders
## Not run: cb_trig_gtd_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_trigger_price="115000", order_exp = Sys.time()+minutes(5)) ## End(Not run)## Not run: cb_trig_gtd_order(product_id="BTC-USD", side="BUY", base_size="0.00001", limit_price="100000", stop_trigger_price="115000", order_exp = Sys.time()+minutes(5)) ## End(Not run)