From 1b8943ac54fabbad046503efeac88f0425a6684a Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Jan 2020 10:59:10 +0100 Subject: [PATCH] Add documentation for tradable_balance_ratio --- config_full.json.example | 1 + docs/configuration.md | 7 +++++++ freqtrade/constants.py | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/config_full.json.example b/config_full.json.example index b9631f63d..4e692d371 100644 --- a/config_full.json.example +++ b/config_full.json.example @@ -2,6 +2,7 @@ "max_open_trades": 3, "stake_currency": "BTC", "stake_amount": 0.05, + "tradable_balance_ratio": 0.99, "fiat_display_currency": "USD", "amount_reserve_percent" : 0.05, "dry_run": false, diff --git a/docs/configuration.md b/docs/configuration.md index 90f0aa791..1acd6162c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -43,6 +43,7 @@ Mandatory parameters are marked as **Required**, which means that they are requi | `max_open_trades` | **Required.** Number of trades open your bot will have. If -1 then it is ignored (i.e. potentially unlimited open trades).
***Datatype:*** *Positive integer or -1.* | `stake_currency` | **Required.** Crypto-currency used for trading. [Strategy Override](#parameters-in-the-strategy).
***Datatype:*** *String* | `stake_amount` | **Required.** Amount of crypto-currency your bot will use for each trade. Set it to `"unlimited"` to allow the bot to use all available balance. [More information below](#understand-stake_amount). [Strategy Override](#parameters-in-the-strategy).
***Datatype:*** *Positive float or `"unlimited"`.* +| `tradable_balance_ratio` | Ratio of the total account balance the bot is allowed to trade. Only applies when `stake_amount="unlimited"`. [More information below](#understand-stake_amount).
*Defaults to `0.99` 99%).*
***Datatype:*** *Positive float between `0.0` and `1.0`.* | `amount_reserve_percent` | Reserve some amount in min pair stake amount. The bot will reserve `amount_reserve_percent` + stoploss value when calculating min pair stake amount in order to avoid possible trade refusals.
*Defaults to `0.05` (5%).*
***Datatype:*** *Positive Float as ratio.* | `ticker_interval` | The ticker interval to use (e.g `1m`, `5m`, `15m`, `30m`, `1h` ...). [Strategy Override](#parameters-in-the-strategy).
***Datatype:*** *String* | `fiat_display_currency` | Fiat currency used to show your profits. [More information below](#what-values-can-be-used-for-fiat_display_currency).
***Datatype:*** *String* @@ -144,6 +145,12 @@ To allow the bot to trade all the available `stake_currency` in your account set "stake_amount" : "unlimited", ``` +When using `stake_amount="unlimited"`, we recommend to also set `tradable_balance_ratio=0.99` (99%) - to keep a minimum balance for eventual fees. +This will keep 1% of your account balance "untradable" in your account. + +!!! Note: + This configuration will allow increasing / decreasing stakes depending on the performance of the bot (lower stake if bot is loosing, higher stakes if the bot has a winning record, since higher balances are available). + In this case a trade amount is calculated as: ```python diff --git a/freqtrade/constants.py b/freqtrade/constants.py index d7c6249d5..d5ba00cd5 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -73,6 +73,12 @@ CONF_SCHEMA = { 'minimum': 0.0001, 'pattern': UNLIMITED_STAKE_AMOUNT }, + 'tradable_balance_ratio': { + 'type': ['number'], + 'minimum': 0.1, + 'maximum': 1, + 'default': 0.99 + }, 'fiat_display_currency': {'type': 'string', 'enum': SUPPORTED_FIAT}, 'dry_run': {'type': 'boolean'}, 'dry_run_wallet': {'type': 'number', 'default': DRY_RUN_WALLET},