From a869eaba6ba70a3ebbea13db0277f14460cfcca0 Mon Sep 17 00:00:00 2001 From: Nullart2 Date: Wed, 29 Aug 2018 19:11:06 +0800 Subject: [PATCH] bot_id docs and in startup message --- config.json.example | 1 + config_full.json.example | 1 + docs/configuration.md | 5 +++++ freqtrade/freqtradebot.py | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.json.example b/config.json.example index 8bd3942e6..77219e5d1 100644 --- a/config.json.example +++ b/config.json.example @@ -1,4 +1,5 @@ { + "bot_id": 0, "max_open_trades": 3, "stake_currency": "BTC", "stake_amount": 0.05, diff --git a/config_full.json.example b/config_full.json.example index cc3b3d630..a523db7c5 100644 --- a/config_full.json.example +++ b/config_full.json.example @@ -1,4 +1,5 @@ { + "bot_id": 0, "max_open_trades": 3, "stake_currency": "BTC", "stake_amount": 0.05, diff --git a/docs/configuration.md b/docs/configuration.md index ff5ce118c..e85192c2b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -17,6 +17,7 @@ The table below will list all configuration parameters. | Command | Default | Mandatory | Description | |----------|---------|----------|-------------| +| `bot_id` | 0 | No | Allows multiple bot connect to 1 database server. This value should be unique in each bot instance. | `max_open_trades` | 3 | Yes | Number of trades open your bot will have. | `stake_currency` | BTC | Yes | Crypto-currency used for trading. | `stake_amount` | 0.05 | Yes | Amount of crypto-currency your bot will use for each trade. Per default, the bot will use (0.05 BTC x 3) = 0.15 BTC in total will be always engaged. Set it to 'unlimited' to allow the bot to use all avaliable balance. @@ -55,6 +56,10 @@ The table below will list all configuration parameters. The definition of each config parameters is in [misc.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/misc.py#L205). +### Understand bot_id + +`bot_id` is a value assigned to each instance of the bot. Use only UNIQUE `bot_id` value per bot instance when connected to a single database server such as Postgre, Mysql, etc. + ### Understand stake_amount `stake_amount` is an amount of crypto-currency your bot will use for each trade. diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 8f77e9887..da0462c2d 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -118,6 +118,7 @@ class FreqtradeBot(object): 'type': RPCMessageType.WARNING_NOTIFICATION, 'status': 'Dry run is enabled. All trades are simulated.' }) + bot_id = self.config.get('bot_id',0) stake_currency = self.config['stake_currency'] stake_amount = self.config['stake_amount'] minimal_roi = self.config['minimal_roi'] @@ -127,7 +128,8 @@ class FreqtradeBot(object): strategy_name = self.config.get('strategy', '') self.rpc.send_msg({ 'type': RPCMessageType.CUSTOM_NOTIFICATION, - 'status': f'*Exchange:* `{exchange_name}`\n' + 'status': f'*Bot ID:* `{bot_id}`\n' + f'*Exchange:* `{exchange_name}`\n' f'*Stake per trade:* `{stake_amount} {stake_currency}`\n' f'*Minimum ROI:* `{minimal_roi}`\n' f'*Ticker Interval:* `{ticker_interval}`\n'