DeviaVir / zenbot

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

Multiple bots / Limit with how much the bot is allowed to trade (max) #174

Closed lxwang closed 6 years ago

lxwang commented 7 years ago

Is it still possible under 4.x, for example both BTC-USD and ETH-USD?

DeviaVir commented 7 years ago

Yes, just start new traders with a different pair as an argument.

In the docker-compose.yml (in case you use docker) you can even re-use the zenbot_server image.

carlos8f commented 7 years ago

Although it's possible, I would not really recommend multiple pairs on the same exchange and same currency. Your profit calculations will be off, and the bot won't be able to execute signals when it needs to - the 2 processes will conflict at some point. And the sim doesn't accept 2 pairs, so there's no way to model what happens to your profit margin.

esalter commented 7 years ago

I'm curious about this too. I have it running with two pairs, and set the buy % to 70% of available balance so there's usually some amount available when one currency or the other wants to trade. It's far from ideal though. What I'd really like is to be able to block off some amount of the balance as only tradeable on one currency or another. Sort of like a separate account. I'm not sure what that would take though.

carlos8f commented 7 years ago

Sort of like a separate account. I'm not sure what that would take though.

I thought about that too, maybe a setting where it will use Math.min(balance, some_amount) as the balance, instead of the full balance.

lxwang commented 7 years ago

I thought about that too, maybe a setting where it will use Math.min(balance, some_amount) as the balance, instead of the full balance.

I second that. I usually allocate 40-40 split between the 2 coins and hold 20% cash for manual trades.

RomainClaret commented 7 years ago

This is still an interesting feature guys :)

RomainClaret commented 7 years ago

Suggestion for the logic. If I have 100€ on my account, I would like bot1 to start with 50€ max, bot2 to start with 25€. Then they can only play with their own gains or loss. Bot1 made 20€ profit so it's trading up to 70€, bot2 made 20€ loss so it's trading with 5€

timstoop commented 7 years ago

I'd be happy with simply being able to set a max amount. I restart the bots often enough to redistribute the profits for trading.

kevin-chau commented 7 years ago

@timstoop Do you have a program that automatically restarts your bots at some point?

timstoop commented 7 years ago

No, but I manually run the backtester every day or so to tweak for the best settings.

alexchet commented 6 years ago

Will this issue be solved. I too have the same problem. If I have €500 on GDAX balance and I want bot 1 to use only €300 of that balance.

I tried using the options --currency_capital and giving it my limit. But when the trade is executed the full balance is used rather that the one specified.

Would be nice to have this option.