DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.22k stars 2.04k forks source link

Per Currency Conf with custom DB entry #1467

Open carpionetwork opened 6 years ago

carpionetwork commented 6 years ago

System information

Describe the problem

I have created conf files for each of the three coins (BTC, ETH and LTC) (btc_conf.js, eth_conf.js and ltc_conf.js). Within each I changed the mongodb entry from zenbot4 to (For BTC (btcbot), For ETH (ethbot) and For LTC (ltcbot)).

Is it better to keep one mongodb zenbot4 that houses all three of the coins or is creating a per coin database fine?

The reason I am asking this is because I am seeing a random issue where the buy or sell signal will print but neither continues to bought or sold. Even though at that moment a buy or sell would have been good. I have sufficient funds for each coin as well as USD for either transaction.

Thank you!

kareha commented 6 years ago

Which exchange? If Bitfinex: Have you ever traded the currency before? I had the same behavior. See here: https://github.com/DeviaVir/zenbot/issues/695#issuecomment-355825828 and fixed it on my own (works now).

It doesn't matter if you split up the db collections by asset, you can keep all trades in one.

carpionetwork commented 6 years ago

Gdax ... have not tried any other exchange. The bot has traded successfully before but recently it is stuck at printing the buy / sell signals.

As a test I switched to the bollinger strategy to see if there is a buy/sell signal issue with just the trend_ema strategy. Sidenote: I am using the latest unstable code.

Thanks for the link.

I'll let you know how it goes with the new strategy after it has had time to settle in for a few hours.

defkev commented 6 years ago

buy or sell signal will print but neither continues to bought or sold

This simply means the bot didn't execute the signal, enable debugging (L key) to see why.

The order is buy - buying - bought and sell - selling - sold

Haehnchen commented 6 years ago

i can still confirm the buy / sell signal issue on gdax #1423. buy / sell is placed by the bot and marked as sucessfull by the bot and in console output, but in detail the order timeouted. as mentioned in the issues the error handling of this cases is missing by the gdax exchange implemention.

fdk0 commented 6 years ago

What I noticed is that when it cancel the order issues a bought at invalid date in gdax and on bittrex it issues a completed bought or selled message with the correct amount and date but it actually did not complete the order. this is in live mode..

fdk0 commented 6 years ago

running --debug in live mode with the same configuration that I was using before and triple checked if the IP is correct on gdax api authentication settings I get this error: websocket connection to ETH-EUR opened websocket error: { type: 'error', message: 'Sorry, you could not be authenticated: Unauthorized', reason: 'IP does not match IP whitelist' } restarting websocket connection

As I said the IP whitelisted is correct and the API is correct, and to be sure I create a new one and tested again in 2 different machines and I got the same error.. this may be the reason of the problem with placing / removing order in gdax?

Also I don't get the error before #1335

carpionetwork commented 6 years ago

From what I can tell Gdax does not have a whitelist such as Binance.

I think the error I was experiencing was a misconfiguration on my end. I set the buy / sell to 25% and this was causing the random buy / sell signals not progressing. Once I bumped this to 50% for both zenbot again started trading as requested.

Still testing but I think my error can be chalked up to user error.

Trading has been working for trend ema and bollinger.

Sent from my iPhone

On Mar 6, 2018, at 10:41 AM, fdk0 notifications@github.com wrote:

running --debug in live mode with the same configuration that I was using before and triple checked if the IP is correct on gdax api authentication settings I get this error: websocket connection to ETH-EUR opened websocket error: { type: 'error', message: 'Sorry, you could not be authenticated: Unauthorized', reason: 'IP does not match IP whitelist' } restarting websocket connection

As I said the IP whitelisted is correct and the API is correct, and to be sure I create a new one and tested again in 2 different machines and I got the same error.. this may be the origin of the problem with placing / removing order in gdax?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

fdk0 commented 6 years ago

Yes Gdax has an optional whitelist IP option.

carpionetwork commented 6 years ago

Hi Daniel, I can confirm this is also happening with Gdax. The console output shows buy, buying, bought but the total USD is unchanged afterwards. Sell, on the other hand, is working as expected.

Sent from Mail for Windows 10

From: Daniel Espendiller Sent: Tuesday, March 6, 2018 10:08 AM To: DeviaVir/zenbot Cc: Mark J. Carpio; Author Subject: Re: [DeviaVir/zenbot] Per Currency Conf with custom DB entry (#1467)

i can still confirm the buy / sell signal issue on gdax #1423. buy / sell is placed by the bot and marked as sucessfull by the bot and in console output, but in detail the order timeouted. as mentioned in the issues the error handling of this cases is missing by the gdax exchange implemention. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.