0.0.7 • Published 7 years ago

oanda-v3 v0.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

oanda-v3 module

This module is a wrapper for the OANDA v3 REST API. This module is still very much incomplete. The only operation that has been developed thus far is getPricing().

Quickstart - using the module

First install the package: npm i oanda-v3 --save

From there, you can simply start using the module:

var OANDA = require('oanda-v3').OANDAAdapter;

var isProd = false;
var accountId = "<ACCOUNT ID>"; // ex: 123-123-1234567-123
var apiToken = "<API TOKEN>";
var oAdapter = new OANDA(isProd, accountId, apiToken);

var instruments = ["EUR_USD", "USD_CAD"];
oAdapter.getPricing(instruments, (err, prices)) => {
	if (err) {
		console.error(err);
	}
	else {
		prices.foreach((price) => {
			console.log(price);
		}, this);
	}
});

var instrument = "EUR_USD";
var from = 1505304000;
var to = 1505307600;
var granularity = "M1";

oAdapter.getCandles(instrument, from, to, granularity, (err, candles) => {
	if (err) {
		console.error(err);
	}
	else {
		candles.foreach((candle) => {
			console.log(candle);
		}, this);
	}
});
0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago