createOandaPositionClose: Close out a Oanda Position

Description Usage Arguments Value Examples

View source: R/OandaOrders.R

Description

Close out a Oanda Position

Usage

1
2
createOandaPositionClose(ACCOUNT_TYPE, ACCESS_TOKEN, ACCOUNT_ID,
  INSTRUMENTS = "AUD_USD", LONGUNITS = NULL, SHORTUNITS = NULL)

Arguments

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"

LONGUNITS

Number of units of the instrument to be executed, 'ALL' or numbers

SHORTUNITS

Number of units of the instrument to be executed

Value

A HTTP Response

Examples

1
2
3
4
5
6
7
createOandaPositionClose(.oandaEnv$ACCOUNT_TYPE, .oandaEnv$ACCESS_TOKEN, .oandaEnv$ACCOUNT_ID, INSTRUMENTS = 'AUD_USD', LONGUNITS = 'ALL')
# 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

ivanliu1989/RQuantAPI documentation built on Sept. 13, 2019, 11:54 a.m.