R Shiny interface for the OANDA fxTrade API

R

ichimoku::oanda_studio()

shikokuchuo
2021-07-26

About ichimoku

The ichimoku R package1 provides tools for creating and visualising Ichimoku Kinko Hyo (cloud chart) strategies.

It features in the Empirical Finance CRAN Task View, and was selected as one of RStudio’s Top 40 New CRAN Packages for May 2021.

The latest version incorporates an interface to the OANDA fxTrade API2.

About the OANDA fxTrade API

OANDA is an authoritative source of foreign exchange data utilised by both governments and global corporations alike. OANDA offers a few APIs, including its rates for business, but the fxTrade API is perhaps the most comprehensive, built upon its retail and professional trading offering of the same name. Access to the fxTrade API is free but requires registration for a practice/demo account.

The API can be used for retrieving historical and live streaming price data for major currencies, metals, commodities, government bonds and stock indices. It is a rich source of financial data with excellent availability, for instance daily OHLC pricing data for major forex pairs from the start of 2005, and data granularity ranging from 5 seconds to monthly.

For the total list of over 120 covered instruments please see here.

Screenshots

Click on an image to view in full resolution.

Showcased here is the function oanda_studio(), the implementation in R Shiny. As a Shiny app, the function may be called without specifying any parameters; the full range of options can be selected interactively from within the web interface.

Data is live and updates at the specified refresh rate (default of every 5 secs).

The cursor infotip provides an innovative overview of the data directly from the chart (can be turned on or off as desired).

oanda_studio with infotip

Of course arguments for customisation can also be specified within the call to oanda_studio() itself. Demonstrating some further options below with Soybean futures:

oanda_studio("SOYBN_USD", granularity = "M5", refresh = 10, price = "B", theme = "dark")

oanda_studio in dark mode

Other functions

Other functions to access the OANDA fxTrade API are included in the ichimoku package. These are standard R functions for retrieving data in tabular form and charting (not reliant on Shiny), and include:

ichimoku R package site: https://shikokuchuo.net/ichimoku/

ichimoku OANDA fxTrade API vignette: https://shikokuchuo.net/ichimoku/articles/xoanda.html


  1. Gao, C. (2021), ichimoku: Visualization and Tools for Ichimoku Kinko Hyo Strategies. R package version 1.0.0, https://CRAN.R-project.org/package=ichimoku.↩︎

  2. ‘OANDA’ and ‘fxTrade’ are trademarks owned by OANDA Corporation, an entity unaffiliated with the ichimoku package.↩︎

Citation

For attribution, please cite this work as

shikokuchuo (2021, July 26). shikokuchuo{net}: R Shiny interface for the OANDA fxTrade API. Retrieved from https://shikokuchuo.net/posts/12-oanda-studio/

BibTeX citation

@misc{shikokuchuo2021r,
  author = {shikokuchuo, },
  title = {shikokuchuo{net}: R Shiny interface for the OANDA fxTrade API},
  url = {https://shikokuchuo.net/posts/12-oanda-studio/},
  year = {2021}
}