Oandajs
Javascript wrapper for the OANDA REST API
Install / Use
npx skills add oanda/oandajsInstalls into whichever agent you are using.
README
oandajs
oanda.js is a javascript wrapper for the OANDA REST API.
Usage
NOTE: We require an AUTH token now.
Include the latest oanda.js in as a script tag:
<script type="text/javascript" src="http://developer.oanda.com/oandajs/oanda.js"></script>
To get current live rates:
OANDA.rate.quote(['EUR_USD'], function(response) {
if(response && !response.error) {
var bid = response.prices[0].bid;
var ask = response.prices[0].ask;
// Do something with prices
// ...
}
});
To open a trade with optional parameters:
OANDA.order.open(accountId, 'EUR_USD', 100, 'buy', 0, 0, 'market', { 'stopLoss' : 0.90, 'takeProfit' : 1.102 }, function(openTradeResponse) {
if(openTradeResponse && !openTradeResponse.error) {
var units = openTradeResponse.units;
var side = openTradeResponse.side;
var instrument = openTradeResponse.instrument;
var time = openTradeResponse.time;
// Do something with open trade result
// ...
}
});
To handle errors:
OANDA.order.open(accountId, 'EUR_USD', 100, 'buy', 0, 0, 'market', { 'stopLoss' : 0.90, 'takeProfit' : 1.102 }, function(openTradeResponse) {
if(openTradeResponse.error) {
var error = openTradeResponse.error;
console.log(error.statusCode); //HTTP status code
console.log(error.code); //OANDA error code
console.log(error.message);
}
});
Examples
Check out these example apps that use oanda.js
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.6kCommit, push, and open a PR
