Skip to content
forked from oanda/oandajs

Javascript wrapper for the OANDA REST API

License

Notifications You must be signed in to change notification settings

mrpoulin/oandajs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

oandajs

oanda.js is a javascript wrapper for the OANDA REST API.

Usage

Include the latest oanda.js in as a script tag:

<script type="text/javascript" src="https://raw.github.com/oanda/oandajs/master/oanda.js"></script>

To get current live rates:

OANDA.rate.quote(['EUR_USD'], function(response) {
    var bid = response.prices[0].bid;
    var ask = response.prices[0].ask;
    // Do something with prices
    // ...
});

To open a trade:

OANDA.trade.open(accountId, 'EUR_USD', 100, function(openTradeResponse) {
    var units = openTradeResponse.units;
    var direction = openTradeResponse.direction;
    var instrument = openTradeResponse.instrument;
    var time = openTradeResponse.time;
    // Do something with open trade result
    // ...
});

Examples

Check out these example apps that use oanda.js

About

Javascript wrapper for the OANDA REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%