A demo app in Python for streaming rates using OANDA open api
Python
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 8 commits ahead of RayCui:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENCE.md Added MIT licence Mar 26, 2014
README.md Updated README Jul 4, 2014
streaming.py Compatible with both Python 3.x and Python 2.x May 19, 2017

README.md

py-api-streaming

A sample Python application that connects to OANDA's HTTP based rates stream.

Setup

Clone this repo to the location of your choice

Update the following values in the connect_to_stream method in streaming.py

  • domain
  • account_id
  • access_token (Authorization)
  • instruments

Usage

python streaming.py [options]

Options

-b, --displayHeartBeat : Optional Toggles the displaying of the stream's heartbeats. No heartbeats are displayed by default.

Sample Output

{"tick":{"instrument":"EUR_USD","time":"2014-03-07T20:58:07.461445Z","bid":1.38701,"ask":1.38712}}
{"tick":{"instrument":"EUR_USD","time":"2014-03-07T20:58:09.345955Z","bid":1.38698,"ask":1.38709}}
{"tick":{"instrument":"USD_CAD","time":"2014-03-07T20:58:12.320218Z","bid":1.10906,"ask":1.10922}}
{"tick":{"instrument":"USD_CAD","time":"2014-03-07T20:58:12.360615Z","bid":1.10904,"ask":1.10925}}

More Information

http://developer.oanda.com/