add_order {rgdax} | R Documentation |
Create a New Order For A Currency
Description
This is an auth based function. User must have valid api keys generated by GDAX which must be passed as mandatory arguments. The users can place different types of orders like "limit"
, "stop"
or "market"
. Orders will be placed succesfully only if there is sufficient funds. Each order will result in a hold and the details of the hold can be tracked using holds
. Margin Orders are currently not supported.
Usage
add_order(
api.key,
secret,
passphrase,
product_id = "BTC-USD",
type = "limit",
stop = NULL,
stop_price = NULL,
side = "b",
price = NULL,
size
)
Arguments
api.key |
Mandatory character value. This is the API key as generated by GDAX. Typically a 32 character value. |
secret |
Mandatory character value. This is the API secret as generated by GDAX. Typically a 88 character value. |
passphrase |
Mandatory character value. This is the passphrase as generated by GDAX. Typically a 11 character value. |
product_id |
Optional character value for the currency pair. The default is |
type |
Optional character value for the order type. The default is |
stop |
Optional parameter. This parameter is required if a stop order needs to be placed. Possible values apart from default |
stop_price |
Optional parameter.The value is needed only if |
side |
Optional character value for the order side The default is |
price |
Conditional mandatory numeric value. It can either be an integer or float. Float values of greater than 2 decimals will be rounded to 2 decimals using the generic |
size |
Mandatory numeric value. It can either be an integer or float. Float values will NOT be rounded. The user must ensure that the fractional unit of a currency pair is valid for acceptance by GDAX. This information can also be determined by |
Value
Dataframe with status of the order, posted details and created time stamp etc.
Examples
## Not run:
add_order("BTC-USD", api.key = your_key, secret = your_api_secret, passphrase = your_api_pass,
type="limit", side = "s", price = 1000.25, size = 1)
## End(Not run)