oanda_positions: OANDA Position Book

View source: R/oanda.R

oanda_positionsR Documentation

OANDA Position Book

Description

Provides a summary of the aggregate positions held by OANDA fxTrade clients at each price level.

Usage

oanda_positions(instrument, time, server, apikey)

Arguments

instrument

string containing the base currency and quote currency delimited by '_' or '-' (e.g. "USD_JPY" or "usd-jpy"). Use the oanda_instruments function to return a list of all valid instruments.

time

(optional) the time for which to retrieve the position book, in a format convertible to POSIXct by as.POSIXct(). If not specified, the most recent position book will be retrieved.

server

(optional) specify the "practice" or "live" server according to the account type held. If not specified, will default to "practice", unless this has been changed by oanda_switch.

apikey

(optional) string containing the OANDA fxTrade API key (personal access token), or function that returns this string. Does not need to be specified if already stored by oanda_set_key(). Can also be entered interactively if not specified.

Details

This feature has been implemented by OANDA only for certain major currency pairs and should be considered experimental.

For further details please refer to the OANDA fxTrade API vignette by calling: vignette("xoanda", package = "ichimoku").

Value

Invisibly, a data frame of the position book with parameters saved as attributes. A chart showing the percentage long and short positions at each price level is output to the graphical device.

Examples

## Not run: 
# OANDA fxTrade API key required to run this example
oanda_positions("USD_JPY")

## End(Not run)


ichimoku documentation built on Nov. 2, 2023, 5:36 p.m.