askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.06k stars 3.95k forks source link

Split config for multi bot scenarios #137

Closed chevdor closed 10 years ago

chevdor commented 10 years ago

I would like to make a proposal that can be discussed an probably kepts warm for later.

In case the user wants to run several instances, it would be to split the config into: 1- a main config file containing the common parameters (email for the alert, etc..) 2- a part dedicated to the method and options trading

Splitting the config does not have to be physical into N files, although this would have some benefits.

We could use profiles into the config file. Although, the ability to have trading params in a separat file would be sweet to exchange with other while not sharing confidential data such as the API Keys.

The config based on profiles could look like:

// Common section
// emails, etc...
recipient = bob@megacorp.com

// Default settings
sendEmails = true // for instance

// Profile#1: ema_10_21
profile = {name: 'ema_10_21', default: true}
// no need to define sendEmails as we like the default = true. See above
method = ema

// Profile#2: stop_loss
profile = {name: 'stop_loss'}
sendEmails = false // here we override the default value we defined
method = stop_loss

This would also allow starting the bot with a given profile depending on the current market mood as:

node gekko safety_first

It would also become handy to have 2 bots working conccurently:

node gekko ema_10_21
node gekko stop_loss

See also #110 and #132. Those issue may be probeblatic.

askmike commented 10 years ago

Currently users can use the config parameter to specify another config file. Multiple instances on different markets work fine, though multiple traders on the same market currently poses some problems (unless you use different history folders for each):

A stop loss as well as an EMA trading method will not be wise, because you either listen to watching trends or you don't. If you would run both those two advices they would not only speak against each other, but you are also paying double fees for all the extra positions to take (CEX.io is the exception here). In the future we might do something more advanced in the lines of multiple indicators combining advice but for now (as we only have two trading methods) this is way overkill.


I already have plans for people wanting to papertest or backtest using different methods / parameters: Gekko is going to support multiple markets & multiple traders. Currently actors are hooked up to the emitter they want to receive intel from directly, but I want to move this to a system where each market and each trader have their own feed. Than you can do these things in a single instance:

Also the configuration is going to move to a webbased interface (optionally, but opt out).

askmike commented 10 years ago

But right now I don't want to spend to much resources on this, so for now I am closing this.

askmike commented 10 years ago

Awesome update: It was surprisingly easy to hook up redis pubsub to Gekko. This means that clusters of different configuration become a breeze. The only thing left is to create a new Market object that instead of a fetcher subscribes to redis pubsub. Here more info:

https://github.com/askmike/gekko/blob/localDB/docs/internals/Actors.md#redis-beacon