-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Conversation
Hey @cmroche, it now throws the following; TypeError: Cannot read property 'free' of undefined Thanks for your quick response on the last issue! |
@ms121 Fixed bindings, try now please. |
Seems to be working ill let it run and see how it goes! |
@ms121 Thanks for your help :) Same problem with getPortfolio, I used the wrong function... the update I just pushed should fix it. Thanks again. |
@cmroche 2017-12-03` 03:24:38 (INFO): Attempting to BUY 1.1992578439197714 NEO at binance price: 0.077 /root/gekko/exchanges/binance.js:35 TypeError: Cannot read property 'match' of undefined I am currently doing tests on the server time + my client time to see if that is the issue. |
Normally the binance api module adds this automatically for requests that require it, but it is not on newOrder. Probably an oversight, but an easy workaround on our side.
@ms121 The binance node module normally automatically adds the timestamp to any authenticated queries, but look at the source it doesn't in the case of addOrder. Probably a bug on their side, but the fix is as simple as adding it to the query parameters so I've pushed a fix for it. Also the comments said "getTicker" but actually that was a copy and paste error on my side, it was actually "addOrder" that was triggering it :) Thank again, and let me know how it goes. I think we're pretty close now thanks to your help. |
Thanks again @cmroche next error is the following; Going to double check it isn't because my trade is too small, although it might be to do with how many decimal places we are sending to binance. 2017-12-04 01:00:08 (DEBUG): [binance.js] entering "setOrder" callback after api call, err: { code: -1013, msg: 'Filter failure: LOT_SIZE' } data: { code: -1013, msg: 'Filter failure: LOT_SIZE' } I will try setting it to a precision of 6 and see if it makes the trade. |
@ms121 It's because the min order was wrong, the info wasn't readily available at the time I put this together but found it now. THe markets have been cleaned up, and the min orders fixed. |
Tested still throwing the same error; |
LOT_SIZE errors in binance have to do with the rounding of either the
After that the amount and the rate are checked for rounding: the amount and the rate both need to be rounded according to some rounding, else you get this error. I am pretty sure this is not handled by the lib we are using. |
@askmike All of the currency pairs specific use 8 decimals places for input, are you saying that Gekko will attempt to use more decimal places than that? If so I can push a fix tonight. |
Thanks again @cmroche, problem now is the Price is being calculated the same as the amount by the looks of it; |
@ms121 Ooof :S That was a nasty copy and paste error, I'm glad it didn't work. Fixed now. |
HAHA I thought so as well! I am testing it now. |
@askmike The build pipeline errors are related to using an older npm version, I don't think I can fix this on my side. |
No problem, I'll work on upgrading dependencies. I'll merge this for now and if more problems arise we can address them in new PRs. Thanks a lot @cmroche! |
@cmroche after 10 hours of running (bought a sold 5 times no problems) it decided to throw this out; 2017-12-06 02:02:12 (DEBUG): [binance.js] entering "setOrder" callback after api call, err: { code: -1013, msg: 'Filter failure: MIN_NOTIONAL' } data: { code: -1013, msg: 'Filter failure: MIN_NOTIONAL' } Looking at line 492 It looks to be correctly set to 1 not sure why it decided to try and buy. I would also note that it did throw the;
|
@ms121 Did it terminate the process, or continue? Either way, if it continued to buy, then there is probably a bug in the Binance API... unless the buy you saw was not related, and perhaps there are rounding errors bringing it just slightly under the minimal amount? I could throw a Math.max in there and see if it fixes it, would be a bit of a guess though unless you could catch the error and print out the amount it is trying to request. |
Ended up terminating the process. It might have actually been a rounding issue. I believe it might have round up thinking it was over 1 but was in fact just under. Oh and I've found when it does round up at times it misses the buy because it is like 0.003 higher than the order price (not a big issue though). |
Refer to PR #1427 now please. |
Bugfix
getPortfolio always returns 0 due to an incorrect use of _.first(...)
Function now returns the 'free' balance, replaced _.first with _.find.
Should fix issue #1356