Open dcparga opened 7 years ago
Did you got this to work? I want to start using it as well but I am not sure the library still works?
Hi @bobvdvalk,
Yes, it still works, and I achieved that as well. Basically you need to download the library and modify the file bux.js, and use this one instead of using npm package, and modify the function open from this:
BUX.prototype.open = function(trade, callback) {
var data = {
boostEffect: trade.multiplier.toString() || 1,
homeCurrency: 'BUX',
direction: trade.direction,
productId: this.findProductBySymbol(trade.product) || trade.product,
source: 'PRODUCTS_CURATED',
tradeSize: trade.size.toString()
};
this.debug('Opening position: product=' + data.productId + ' dir=' + data.direction +
' size=' + data.tradeSize + ' multiplier=' + data.boostEffect);
return this.post('users/me/trades', data, callback);
};
to this:
BUX.prototype.open = function(trade, callback) {
var data = {
boostEffect: trade.multiplier.toString() || 1,
homeCurrency: 'EUR',
direction: trade.direction,
productId: this.findProductBySymbol(trade.product) || trade.product,
source: 'PRODUCTS_CURATED',
tradeSize: trade.size.toString()
};
this.debug('Opening position: product=' + data.productId + ' dir=' + data.direction +
' size=' + data.tradeSize + ' multiplier=' + data.boostEffect);
return this.post('users/me/trades', data, callback);
};
Thanks for your awesome reply! 👍
BTW, do you use this library? I can't even get my open positions..?
Yes, I'm using it :) To get your open positions just use the portfolio function, using the given token after being authenticated.
Hi,
This is not an issue with the actual lib, but I'm not able to open a new position once I'm operating with real money. I receive this message:
Any suggestion?
Thanks