dataoanda

Oanda is a UK-regulated CFD broker offering CFDs and spread betting on forex, equity indices, commodities and bonds. This module uses the Oanda V20 REST API to provide the Data service to an AWTS environment.

Name dataoanda
Version 1.0.0 (releases)
Vendor Oanda

This module provides market data; instruments and prices with both real-time and historic data.

For information on how to use this module see the Quickstart guides Get started with Oanda data and Streaming market data

Configuration

  • account - the ID of an Oanda account, of the form '000-000-0000000-000'
  • apikey - Your account API key
  • paper - a boolean that should be set to true when account is a paper account, or false for live accounts.
  • symbols - an optional comma-separated list of instrument symbols. Specify this if you want to only include these symbols. E.g. SPX500_USD,NAS100_USD,GBP_USD

You must have an Oanda account and an API key to be able to run this module. Please consult Oanda's documentation for details on how to open an account and obtain an API key: https://developer.oanda.com/rest-live-v20/introduction/

This module also supports all the standard configuration options for data modules.

Notes

Oanda's APIs have no particular usage limits (besides a rate limit, see below) and provide candle data down to S5 resolution (5-second candles).

Bid/ask spread is included in the data, so is reflected in this module's data outputs.

The Oanda API rate limit is 120 requests/second. This module automatically handles the rate limit and throttles/retries requests if your request rate approaches or exceeds the rate limit. Your apps do not need to handle rate limit errors. Price data is immutable and aggressively cached.

Live price data is streamed approximately every 250ms. This data module subscribes to all instruments available to your account over a single connection to Oanda. Your apps can stream any/all instrument live prices without contributing to Oanda's rate limits.

Notes/limitations

Available instruments

The set of instruments available varies depending on which region your trading account is domiciled in. E.g. UK accounts do not get crypto instruments. US accounts do not get equity index CFDs. The set of instruments provided via this data module will be automatically limited to those available through the credentials you configure.

CFDs and tick data

As CFDs are a decentralised market, tick data is not available. The lowest resolution candle data is S5 (5-second).

Live price data is updated every 250ms, but as an Oanda-provided aggregation that is not deterministic and for which no history is available. As such, live price data may reflect prices that are not precisely reflected in OHLC candle data (although live prices should always be between the high and low of the relevant candle). See Oanda's docs here: https://developer.oanda.com/rest-live-v20/pricing-ep/

VWAP

As a CFD/FX broker, tick data is not available. VWAP is approximated with an OHLC average, see the VWAP documentation for details.

Spread

Spreads are included in data, and are automatically used for simulating fills and hence by AWTS' execution engine. However Oanda only provide spread data back to 2012. Historic data from 2011 and earlier will show a spread of 0.0 for all instruments.

Candle closing

This module streams "complete" candles - i.e. each streamed candle is finished and immutable.

Oanda does not close a candle until some time after its time period has ended - this appears to be when the next 'tick' occurs internally after the candle period.

E.g. an M1 candle runs from 12:01:00 to 12:02:00. It may not be marked as closed (and hence may not be available in data) until 12:02:03 - a 3 second delay.

The actual latency varies depending on instrument and time of day - i.e. highly liquid instruments at peak times will typically see <0.5sec. Less liquid instruments off-peak may see 5-10 seconds.

The data module automatically handles this and optimises retry logic to minimise latency - as a result your apps can reliably stream candles