austinyearlykim/wolf

Buy Limit bug

Closed this issue · 15 comments

I got this message when the time-reset was triggered: my time-reset is set to 0.30 (30 seconds)
Also tried setting it to: 1 (1 min). This bug message was also triggered after a certain amount of time that a buy-limit went through, but the sell took too long.

Buy limit reset time reached. Cancelling current order(s)

Queue: 0 Watchlist: 1(node:6492) UnhandledPromiseRejectionWarning: ReferenceError: queue is not defined
at Wolf.consume (C:\wolf\modules\Wolf.js:95:37)
at tickerConfig.callbacks (C:\wolf\modules\Wolf.js:49:28)
at callbacks.forEach (C:\wolf\modules\Ticker.js:45:52)
at Array.forEach ()
at binance.ws.partialDepth (C:\wolf\modules\Ticker.js:45:36)
at WebSocket. (C:\wolf\node_modules\binance-api-node\dist\websocket.js:76:7)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at Receiver._receiver.onmessage (C:\wolf\node_modules\ws\lib\WebSocket.js:141:47)
at Receiver.dataMessage (C:\wolf\node_modules\ws\lib\Receiver.js:389:14)
(node:6492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
\ Queue: 0 Watchlist: 1

dude, when it was working; I made $2 in pry 10 mins.

Hi @BatmanPDX,

#65

git checkout buy-limit-feature
git pull
npm start

fixed the reference error, lemme know how it goes thank you

ok, I'll give it a go on sunday or monday

@BatmanPDX did you find time to try this out? thanks

sorry, I'm testing it out right now

I'm getting the same error that the other guy gets:

√ Buy limit reset time reached. Cancelling current order(s)
√ Resetting timer...
√ Timer reset.
√ Putting in new limit buy order at better price...
√ Calculating quantity...
√ Quantity Calculated: 40310
\ Queue: 0 Watchlist: 1PURCHASE ERROR: Error: Account has insufficient balance for requested action.
at C:\wolf\node_modules\binance-api-node\dist\http.js:47:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
| Queue: 0 Watchlist: 1

seems like the the bot isn't cancelling the order fast enough , or there's a delay in the api, so it thinks the order has been cancelled.

someone has kindly addressed it here #67, not too bad of a fix for this. I'll consolidate this bugfix with the branch you're on. ETA...soon. Work is picking up and weekend activities have kept me busier than normal haha.

np thnx!

Hi @BatmanPDX

Please:

git checkout buy-limit-feature
git pull

I believe I fixed it. Let me know if the problem arises again and/or this fixes it.

Best,
Austin

ran into an error. The order went through but the time reset also executed. wonder if it went through right when the time was about to end. But this is what I got:

√ Calculating quantity...
√ Quantity Calculated: 4221
√ Purchasing... XVGBTC
√ Buy limit reset time reached. Cancelling current order(s)
√ Cancelling current buy limit order...
√ Cancelled current buy limit order.
√ Resetting timer...
√ Timer reset.
√ Putting in new limit buy order at better price...
√ Calculating quantity...
√ Quantity Calculated: 4221
√ Purchasing... XVGBTC
√ Buy limit reset time reached. Cancelling current order(s)
√ Cancelling current buy limit order...
| Queue: 2 Watchlist: 0(node:9632) UnhandledPromiseRejectionWarning: Error: UNKNOWN_ORDER
at C:\wolf\node_modules\binance-api-node\dist\http.js:47:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9632) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9632) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Queue: 2 Watchlist: 0

Figured it out. I'm not removing the first cancelled order from the queue. So wolf is then trying to still cancel the first order which no longer exists haha. Which explains why there are two items in the queue when this error happens and why we have the UNKNOWN_ORDER bug.

But I will fix this small bug tomorrow when my left eye ISN'T twitching from lack of sleep :)

Have a great day and expect this fixed late night tomorrow

@BatmanPDX
@tapir1
@awalch23

Thank you all for being patient.. Got the order removed from the queue now when it's cancelled so the reference error aka UNKNOWN_ORDER bug should be fixed. Changes are below:

ea11e91

`git checkout buy-limit-feature'
'git pull'

Let me know what y'all think. Happy almost-Friday!

In lieu of recent discovery of a potential race condition I think it's best that I hold this feature off until the 4.0.0 release. I will be closing this branch for now. Please use master branch for all near-future bot activity!

Thanks all for being proactive.