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

Zenbot not able to cancel orders #1542

Open
ZeroCool940711 opened this issue Apr 9, 2018 · 7 comments
Open

Zenbot not able to cancel orders #1542

ZeroCool940711 opened this issue Apr 9, 2018 · 7 comments
Labels

Comments

@ZeroCool940711
Copy link

ZeroCool940711 commented Apr 9, 2018

System information

  • Have I written custom code (as opposed to using zenbot vanilla): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04, also tested on Bash on Windows
  • Zenbot version (commit ref, or version): Tested around 10 different commits for every single branch
  • Zenbot branch: tried all branches
  • NodeJS version: v8.11.1
  • Python version (when using a python script): Python 2.7
  • Exact command to reproduce (include everything): zenbot.sh trade gdax.ETH-USD --strategy neural --buy_pct 50 --sell_pct 50 --markup_sell_pct 0.33 --markdown_buy_pct 0.33 --period 7s --max_sell_loss_pct 0.0001 --sell_stop_pct 0 --buy_stop_pct 0 --profit_stop_enable_pct 1 --profit_stop_pct 1 --max_slippage_pct 0.045 --poll_trades 6000 --order_poll_time 3000 --order_adjust_time 3000 --rsi_periods 3 --threads 10 --trend_ema 36 --use_prev_trades --min_prev_trades 100 --neurons_1 200 --depth 5 --min_periods 100 --min_predict 10 --learns 100
  • Did I make any changes to conf-sample.js?: No, only the api key and secret key and database information was changed.

Describe the problem

I've been using zenbot for some time now and recently I noticed that zenbot was not able to cancel some orders, zenbot runs perfectly for the first few minutes but then after 10 or more minutes or some times before that it starts to fail when trying to cancel an order, Im on gdax, it keeps showing an error saying that the order was not found, maybe it has something to do with the recently changes to the gdax api, also that error continues to show after each line on the console making it pretty annoying, would be nice to have an option to log that to a file instead of showing it on the console.

Source code / Error logs

This is the part of the error that I could copy from the console, it was longer but I couldn't scroll more as my console has a limit on the amount of lines I can see. If there is a log file where I can get more from that error so I can copy it on pastebin or something it would be nice but I cant find any log file for zenbot.

_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
headers: [Object],
method: 'DELETE',
uri: [Object],
qsStringifyOptions: [Object],
timeout: 10000,
callback: [Function],
readable: true,
writable: true,
explicitMethod: true,
_qs: [Object],
_auth: [Object],
_oauth: [Object],
_multipart: [Object],
_redirect: [Object],
_tunnel: [Object],
setHeader: [Function],
hasHeader: [Function],
getHeader: [Function],
removeHeader: [Function],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: undefined,
_disableCookies: true,
_jar: undefined,
port: 443,
host: 'api.gdax.com',
path: '/orders/bb0034c3-e927-4966-8b8c-c69c066bd6',
httpModule: [Object],
agentClass: [Object],
agent: [Object],
_started: true,
href: 'https://api.gdax.com/orders/bb0034c3-e927-4966-8b8c-c69c066bd6',
req: [Object],
ntick: true,
timeoutTimer: null,
response: [Circular],
originalHost: 'api.gdax.com',
originalHostHeaderName: 'host',
responseContent: [Circular],
_destdata: true,
_ended: true,
_callbackCalled: true },
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
read: [Function],
body: '{"message":"order not found"}' },
data: { message: 'order not found' } }
[ { order_id: 'bb0034c3-e927-4966-8b8c-c69c066bd6',
product_id: 'ETH-USD' } ]

Have a good day/night and thanks for the time, hope this problem can be fixed.

@DeviaVir DeviaVir added the bug label Apr 9, 2018
@blevok
Copy link

blevok commented Apr 10, 2018

I also noticed this happening a lot, both in sim and live trading. It'll just keep triggering actions every period, but it doesn't make any more trades.

sim
cancel_failed_sim

trade
cancel_failed_trade

edit: just noticed this is the same as #1514

@fdk0
Copy link

fdk0 commented Apr 11, 2018

Try specify the --conf="./conf.js", it worked for me for the same error on GDAX. Also specify it at the beginning of the command after trade or sim. This happen on sell cancel not on buy cancel at least in my case.. This is just a workaround but hope this helps.

@ZeroCool940711
Copy link
Author

Hi @fdk0 , I tried what you said on your comment and for some reason it worked .-. , I used the same conf.js that I had before just added the command as you suggested, I now have another problem but I think I should create a new issue here and get help with that specific problem but just in case gonna write it here, maybe someone can help, the problem is that now zenbot started to show an error saying that I dont have enough funds when I do have enough money to buy the amount its trying to buy, after some time that error started to be a bit annoying as zenbot is not making any trade and the console output is only showing that error and I cant see anything else, would be nice to be able to suppress that error or receive less information about it as the whole error output takes too much space on the console, here is the error output on pastebin, zenbot is trying to buy 13.03888186 ETH at a price of 431.56 USD, it would a total of $5,627.06 my current balance is 5683.89 USD , so, I do have the money to buy that amount but zenbot says I dont have enough funds for some reason. Thanks for the time and hope all this helps someone else having the same problems.

@blevok
Copy link

blevok commented Apr 12, 2018

@fdk0
I just tried this, but it didn't work unfortunately. I'm still getting:
2018-03-29 16:56:59 - placing buy order...
2018-03-29 16:57:00 - buy order placed at 7063.02 USD
2018-03-29 16:57:00 - signal switched during sell, aborting
2018-03-29 16:57:01 - cancel failed, order done, executing
2018-03-29 16:57:05 - signal switched during buy, aborting
2018-03-29 16:57:05 - cancel failed, order done, executing

And yeah, it's only when selling that i've seen it get stuck, meaning the signal that i see is "selling". However, the debug output is kinda confusing.
It looks like it's buying, then trying to sell and failing, then trying to buy again, even though it already bought, and failing, and that all happens in a few seconds. Then it starts a never ending attempt to sell, until the signal switches, and then it starts a never ending attempt to buy.
So it just won't make any trades after this happens, regardless of conditions being met and signals being sent.

@ZeroCool940711
Copy link
Author

Guys, I'm having this problem again, it was temporarily fixed by using the workaround @fdk0 mentioned before but now its back again, zenbot is not able to cancel some orders on gdax, also is throwing a lot of errors about insufficient funds even if you have enough fund for the order its trying to place.

@fdk0
Copy link

fdk0 commented May 10, 2018

@blevok I still run the bot with --conf="./conf.js" and it works fine I am live 24/7 with latest unstable and no error since a month or more. The only other thing I had to do was disable IP whitelist on GDAX.. I don't know if that's the case.. I am sorry I cannot help you to solve this but I have no coding skills so I wouldn't know what to change, just trial and error..

Good luck.

@fdk0
Copy link

fdk0 commented May 10, 2018

btw I am not sure if this is a zenbot problem or a gdax module's one, since I first got the problem after gdax 0.7 update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants