Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Fix #266 bitstamp trader fails to buy #272

Closed
wants to merge 6 commits into from
Closed

Conversation

Siim
Copy link

@Siim Siim commented Mar 6, 2015

Fix #266

ticker.ask had type of string and as a result the amount calculation failed. The price should be parsed as float.

amount = this.getBalance(this.currency) / (parseFloat(this.ticker.ask) + (parseFloat(this.ticker.ask)*this.fee));

Fix #240

Fixed floating point to 4 decimal places, because more than 4 places caused inaccurate calculations.

Btw shouldn't we make all the calculations using cents and satoshis and store all the monetary and asset values in an integer type?

@jonny64
Copy link

jonny64 commented Mar 19, 2015

/var/projects/gekko/core/portfolioManager.js:138
eFloat(this.ticker.ask) + (parseFloat(this.ticker.ask)*this.fee))).toFixed(4);
SyntaxError: Unexpected token ;

you have unbalanced parenthesis

could you please also undo whitespace change, so this can be cleanly merged?

@Siim
Copy link
Author

Siim commented Mar 19, 2015

Fixed the issues.

@jonny64
Copy link

jonny64 commented Mar 19, 2015

looks okay, thanks!

it looks like you have commited someone's key and secret in mocha_test/portfolioManager.js
is this okay? will this test pass every time in future?

this pull request contains merge conflicts that must be resolved

hm)
you can create separate branch
git fetch && git branch fix_bitstamp 21de73c
and recommit needed changes (you can use git checkout --patch to undo whitespace change)
and issue separate pull requests for whitespace and the rest

@Siim
Copy link
Author

Siim commented Mar 19, 2015

Yes it is ok with the key and the test should pass. The key and secret is just for the sake to fill in the config fields to make the test work, otherwise the test will fail.

I'll look into the merge conflict.

@askmike
Copy link
Owner

askmike commented Jun 15, 2016

I am assuming this error was specific to Bitstamp's v1 API. As we switched to the v2 API (for buy/sell orders) I think this should not be an issue anymore!

@askmike askmike closed this Jun 15, 2016
@askmike
Copy link
Owner

askmike commented Jun 15, 2016

actually, I didn't see the tests before. Keeping this open for a little bit..

@askmike askmike reopened this Jun 15, 2016
@askmike askmike closed this Jun 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants