Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ c.quadriga.secret = 'YOUR-SECRET'
c.quadriga.client_id = 'YOUR-CLIENT-ID'

// to enable WEX.NZ trading, enter your API credentials:
// Note: WexNZ only supports backfilling the last ~1/4 day ATM.
c.wexnz = {}
c.wexnz.key = 'YOUR-API-KEY'
c.wexnz.secret = 'YOUR-SECRET'
Expand Down
11 changes: 6 additions & 5 deletions extensions/exchanges/wexnz/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = function container (get, set, clear) {
}

function joinProduct (product_id) {
return product_id.split('-')[0] + '_' + product_id.split('-')[1]
return (product_id.split('-')[0] + '_' + product_id.split('-')[1]).toLowerCase()
}

function statusErr (err, body) {
Expand Down Expand Up @@ -66,9 +66,10 @@ module.exports = function container (get, set, clear) {

var exchange = {
name: 'wexnz',
historyScan: 'false',
historyScan: 'backward',
makerFee: 0.2,
takerFee: 0.2,
backfillRateLimit: 5000,

getProducts: function () {
return require('./products.json')
Expand All @@ -77,7 +78,7 @@ module.exports = function container (get, set, clear) {
getTrades: function (opts, cb) {
var func_args = [].slice.call(arguments)
var client = publicClient()
var pair = joinProduct(opts.product_id).toLowerCase()
var pair = joinProduct(opts.product_id)
var args = {}
if (opts.from) {
// move cursor into the future
Expand All @@ -87,7 +88,7 @@ module.exports = function container (get, set, clear) {
// move cursor into the past
args.after = opts.to
}
client.trades({ pair: pair, count: 1000 }, function (err, body) {
client.trades({ pair: pair, count: 100000000 }, function (err, body) {
if (err) return retry('getTrades', func_args, err)
var trades = body.map(function (trade) {
return {
Expand Down Expand Up @@ -153,7 +154,7 @@ module.exports = function container (get, set, clear) {

trade: function (type, opts, cb) {
var func_args = [].slice.call(arguments)
var client = authed_client()
var client = authedClient()
var pair = joinProduct(opts.product_id)
/* WEXNZ has no order type?
if (typeof opts.post_only === 'undefined') {
Expand Down
5 changes: 3 additions & 2 deletions extensions/strategies/neural/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ module.exports = function container (get, set, clear) {
},
onReport: function (s) {
cols = []
cols.push(z(8, n(global.mean).format('0000.00'), ' ')[global.meanp > global.mean ? 'green' : 'red'])
cols.push(z(8, n(global.meanp).format('0000.00'), ' ')[global.meanp > global.mean ? 'green' : 'red'])
cols.push(z(8, n(global.mean).format('00000.000'), ' ')[global.meanp > global.mean ? 'green' : 'red'])
cols.push(' ')
cols.push(z(8, n(global.meanp).format('00000.000'), ' ')[global.meanp > global.mean ? 'green' : 'red'])
return cols
},
}
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"talib": "^1.0.3",
"trend": "0.3.0",
"timebucket": "^0.4.0",
"wexnz": "^0.1.2",
"wexnz": "^0.1.3",
"ws": "^3.2.0",
"zero-fill": "^2.2.3"
},
Expand Down