Description Usage Arguments Examples
Closes all orders for a given Oanda account.
1 | closeAllOrders(instrument, acct, auth_id, acct_type = "fxpractice")
|
instrument |
A single character string representing the currency to perform function on e.g. "EUR_USD" |
acct |
The Oanda account number |
auth_id |
Oanda requires a unique authorization ID for every account |
acct_type |
Account type e.g. fxpractice, fxtrade, or sandbox) |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (instrument, acct, auth_id, acct_type = "fxpractice")
{
auth <- c(Authorization = paste("Bearer", auth_id))
url <- paste0("https://api-", acct_type, ".oanda.com/v1/accounts/",
acct, "/positions/", instrument)
closed <- fromJSON(getURL(url, httpheader = auth, customrequest = "DELETE"))
return(closed)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.