fxstation
v2.0.11
Published
I am currently working on the `fxstation-oanda` module which will be used in this module.
Downloads
9
Readme
fxstation
I am currently working on the fxstation-oanda
module which will be used in this module.
Getting Started
$ npm install -g fxstation fxstation-oanda
$ fxs -c /Users/fxlocker/fxs.conf
Example Configuration YAML
Put this in a file named fxs.conf
and pass it with the -c
switch. See
above command example for usage.
---
tradingService:
binder: 'unix:///tmp/trading.fxs.sock'
quotingService:
binder: 'unix:///tmp/quoting.fxs.sock'
oanda:
quoter:
api:
url: 'https://api-fxpractice.oanda.com'
host: 'stream-fxpractice.oanda.com'
instruments: EUR_USD,USD_CAD
token: '<OANDA PRACTICE TOKEN HERE>'
Example Client
const WebSocket = require('ws');
const client = new WebSocket('ws+unix:///tmp/quoting.fxs.sock');
client.on('open', function() {
this.on('message', jsonMessage => {
var message = JSON.parse(jsonMessage);
console.log(message.type); // ex: "response"
console.log(message.meta); // ex: {"originalId":"test123","status":"ok"}
console.log(message.data);
console.log(message.error || 'no errors');
});
let request = {
id: 'test123',
path: 'exchange:trade:oanda:order',
query: {},
data: {
// Order object
}
};
this.send(JSON.stringify(request));
});
client.on('error', error => {
console.log('Error: ', error);
});
Sample GUI Application
https://github.com/fxlocker/test-gui-for-fxstation-quoting
MIT License
Copyright (c) 2018 fxlocker
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.