askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.05k stars 3.95k forks source link

Unable to buy on bitstamp #240

Closed OterLabb closed 8 years ago

OterLabb commented 10 years ago

(ERROR): unable to buy: null { error: { all: [ 'You need $72.92 to open that order. You have only $72.91 available. Check your account balance for details.' ] } }

Something to with rounding i would guess.

Gekko v0.1.2

I have changed fees and slippage up and down, but no luck. Also looked into portfolioManager.js but i could not figure out where the problem is. Any help appriciated :)

My config is as follows

// Monitor the live market config.watch = { enabled: true, exchange: 'Bitstamp', // 'MtGox', 'BTCe', 'Bitstamp', 'cexio' or 'kraken' currency: 'USD', asset: 'BTC' }

// ~~~~~~~~~~~~~~~~ // CONFIGURING TRADING ADVICE // ~~~~~~~~~~~~~~~~

config.tradingAdvisor = { enabled: true, method: 'DEMA', candleSize: 30, historySize: 30 }

// Exponential Moving Averages settings: config.DEMA = { // EMA weight (α) // the higher the weight, the more smooth (and delayed) the line short: 10, long: 21, // amount of candles to remember and base initial EMAs on // the difference between the EMAs (to act as triggers) thresholds: { down: -0.025, up: 0.025 } };

// ~~~~~~~~~~~~~~~~ // CONFIGURING PLUGINS // ~~~~~~~~~~~~~~~~

// Want Gekko to perform real trades on buy or sell advice? // Enabling this will activate trades for the market being // watched by config.watch config.trader = { enabled: true, key: 'my_key', secret: 'my_secret', username: 'my_username' // your username, only fill in when using bitstamp or cexio }

config.adviceLogger = { enabled: true }

// do you want Gekko to calculate the profit of its own advice? config.profitSimulator = { enabled: true, // report the profit in the currency or the asset? reportInCurrency: true, // start balance, on what the current balance is compared with simulationBalance: { // these are in the unit types configured in the watcher. asset: 1, currency: 100, }, // only want report after a sell? set to false. verbose: true, // how much fee in % does each trade cost? fee: 0.5, // how much slippage should Gekko assume per trade? slippage: 0.05 }

JamieCressey commented 10 years ago

I'm seeing this too;

2014-06-18 06:57:11 (ERROR): unable to buy: null { error: { all: [ 'You need $98.52 to open that order. You have only $98.51 available. Check your account balance for details.' ] } }

Any help would be appreciated.

bugron commented 8 years ago

@askmike is this still an issue?

askmike commented 8 years ago

I haven't seen it recently (did over 10 orders in the last few days). But needs a bigger sample size to rule it out

askmike commented 8 years ago

We now switched to Bitstamp's v2 API which handles rounding different, I am assuming this is fixed!