Description Usage Arguments Value Examples
Create an Order for an Oanda Account
1 2 3 4 5 |
ACCOUNT_TYPE |
"practice", "real" or "sandbox" |
ACCESS_TOKEN |
The authorization bearer token previously obtained by the client, can be found in oanda environment |
ACCOUNT_ID |
ID of the Account to create the Order for. |
INSTRUMENTS |
Instrument to get candlestick data for e.g. "AUD_USD" |
UNITS |
Number of units of the instrument to be executed for the order |
POSITIONFILL |
"MARKET_IF_TOUCHED", "MARKET", "LIMIT" or "DEFAULT" |
STOPLOSS |
prices of stop loss |
TAKEPROFIT |
prices of take profits |
TRAILINGSTOP |
Trailing stop |
ORDERTYPE |
order types including 'MARKET', 'LIMIT', 'STOP' |
TIMEINFORCE |
GTC: The Order is “Good unTil Cancelled” | GTD: The Order is “Good unTil Date” and will be cancelled at the provided time | FOK: The Order must be immediately “Filled Or Killed” | IOC: The Order must be “Immediatedly paritally filled Or Cancelled” | GFD: The Order is “Good For Day” and will be cancelled at 5pm New York time |
GTDTIME |
The date/time when the Limit Order will be cancelled if its timeInForce (e.g. 2014-07-02T04:00:00.000000Z) |
PRICE |
for limit order which only will be filled when the prices are better |
A HTTP Response
1 2 3 4 5 6 7 | createOandaOrder(.oandaEnv$ACCOUNT_TYPE, .oandaEnv$ACCESS_TOKEN, .oandaEnv$ACCOUNT_ID, INSTRUMENTS = 'AUD_USD', UNITS = -10000)
# HTTP 201 – The Order was created as specified
# Response [https://api-fxpractice.oanda.com/v3/accounts/101-011-4686012-003/orders]
# Date: 2016-11-28 11:38
# Status: 201
# Content-Type: application/json
# Size: 775 B
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.