Giter Club home page Giter Club logo

oanda-rest-v20's Introduction

Oanda-REST-v20

Overview

Summary

Repository contains one (1) Python wrapper for the Oanda REST v20 API implemented primarily as a proof of concept and secondarily as an educational medium to further my Python education.

Requirements

Native Dependencies

External Dependencies

Installation

  1. Ensure Python 3 is installed, if not visit the download page.

  2. Clone or download all files from this repository.

     $ git clone https://github.com/jgulickson/Oanda-REST-v20
    
  3. Install requests package via:

     $ pip install requests
    
  4. Install websocket-client package via:

     $ pip install websocket-client
    

Configuration

Default configuration is included in file config-example.txt. Note that only a single parameter is applicable per line.

Parameters Key

  1. account-id
  2. api-token
  3. trading-hostname: must be either api-fxpractice.oanda.com or api-fxtrade.oanda.com
  4. status-hostname: must be api-status.oanda.com
  5. status-type: must be either fxtrade-practice-rest-api or fxtrade-rest-api
  6. request-timeout-in-seconds: suggested default 5
  7. email-sender: formatted as email@domain
  8. email-recipient: formatted as email@domain
  9. smtp-password
  10. smtp-address
  11. smtp-port: typically 443 or 587
  12. datetime-format: must be RFC3339 or UNIX

Example File

101-001-xxxxxx-xxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
api-fxpractice.oanda.com
api-status.oanda.com
fxtrade-practice-rest-api
5
[email protected]
[email protected]
xxxxxxxxxxx
587
smtp.provider.com
RFC3339

Usage

  1. Modify config-example.txt with the required information as described above.

  2. Update the variable _CONFIG_FILENAME in file test-oanda.py as needed.

  3. Navigate to the relevant directory and execute test-oanda.py.

     $ python test-oanda.py
    
  4. Review the console log.

     $ python3 test-oanda.py
     get_config completed
     set_config completed
     validate_config completed
     get_account_summary completed
     set_account_summary completed
     validate_account_summary completed
     get_account_instruments completed
     set_account_instruments completed
     validate_account_instruments completed
     get_open_positions completed
     set_account_summary completed
     validate_open_positions completed
     get_pricing completed
     set_account_summary completed
     validate_pricing completed
     get_pricing completed
     set_account_summary completed
     get_account_instruments completed
     set_account_instruments completed
     set_bounds completed
     set_order_syntax completed
     post_order completed
     compose_email completed
     send_email completed
    

See Oanda's documentation for further potential use cases.

TODO

  1. Improve validation logic across all validation functions.
  2. Consider adding docstrings to relevant functions.
  3. Consider supporting additional Oanda endpoints.

Version History

Oanda-REST-v20

1.0.08242017
  • Initial release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.