diff --git a/config.json.example b/config.json.example index 5198b9d81..d6806c0e9 100644 --- a/config.json.example +++ b/config.json.example @@ -59,6 +59,7 @@ "chat_id": "your_telegram_chat_id" }, "initial_state": "running", + "forcebuy_enable": false, "internals": { "process_throttle_secs": 5 } diff --git a/config_full.json.example b/config_full.json.example index bdc6361d2..af6c7c045 100644 --- a/config_full.json.example +++ b/config_full.json.example @@ -71,6 +71,7 @@ }, "db_url": "sqlite:///tradesv3.sqlite", "initial_state": "running", + "forcebuy_enable": false, "internals": { "process_throttle_secs": 5 }, diff --git a/docs/configuration.md b/docs/configuration.md index 3512f891b..90a39ccc2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -53,13 +53,14 @@ The table below will list all configuration parameters. | `telegram.enabled` | true | Yes | Enable or not the usage of Telegram. | `telegram.token` | token | No | Your Telegram bot token. Only required if `telegram.enabled` is `true`. | `telegram.chat_id` | chat_id | No | Your personal Telegram account id. Only required if `telegram.enabled` is `true`. -| `webhook.enabled` | false | No | Enable useage of Webhook notifications +| `webhook.enabled` | false | No | Enable usage of Webhook notifications | `webhook.url` | false | No | URL for the webhook. Only required if `webhook.enabled` is `true`. See the [webhook documentation](webhook-config.md) for more details. | `webhook.webhookbuy` | false | No | Payload to send on buy. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. | `webhook.webhooksell` | false | No | Payload to send on sell. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. | `webhook.webhookstatus` | false | No | Payload to send on status calls. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. | `db_url` | `sqlite:///tradesv3.sqlite` | No | Declares database URL to use. NOTE: This defaults to `sqlite://` if `dry_run` is `True`. | `initial_state` | running | No | Defines the initial application state. More information below. +| `forcebuy_enable` | false | No | Enables the RPC Commands to force a buy. More information below. | `strategy` | DefaultStrategy | No | Defines Strategy class to use. | `strategy_path` | null | No | Adds an additional strategy lookup path (must be a folder). | `internals.process_throttle_secs` | 5 | Yes | Set the process throttle. Value in second. @@ -113,6 +114,15 @@ Go to the [trailing stoploss Documentation](stoploss.md) for details on trailing Possible values are `running` or `stopped`. (default=`running`) If the value is `stopped` the bot has to be started with `/start` first. +### Understand forcebuy_enable + +`forcebuy_enable` enables the usage of forcebuy commands via Telegram. +This is disabled for security reasons by default. +You send `/forcebuy ETH/BTC` to the bot, who buys the pair and holds it until a regular sell-signal appears (ROI, stoploss, /forcesell). + +Can be dangerous with some strategies, so use with care +See [the telegram documentation](telegram-usage.md) for details on usage. + ### Understand process_throttle_secs `process_throttle_secs` is an optional field that defines in seconds how long the bot should wait diff --git a/docs/telegram-usage.md b/docs/telegram-usage.md index 945e31f9c..28213fb5d 100644 --- a/docs/telegram-usage.md +++ b/docs/telegram-usage.md @@ -23,6 +23,7 @@ official commands. You can ask at any moment for help with `/help`. | `/profit` | | Display a summary of your profit/loss from close trades and some stats about your performance | `/forcesell ` | | Instantly sells the given trade (Ignoring `minimum_roi`). | `/forcesell all` | | Instantly sells all open trades (Ignoring `minimum_roi`). +| `/forcebuy [rate]` | | Instantly buys the given pair. Rate is optional. (`forcebuy_enable` must be set to True) | `/performance` | | Show performance of each finished trade grouped by pair | `/balance` | | Show account balance per currency | `/daily ` | 7 | Shows profit or loss per day, over the last n days @@ -30,16 +31,20 @@ official commands. You can ask at any moment for help with `/help`. | `/version` | | Show version ## Telegram commands in action + Below, example of Telegram message you will receive for each command. ### /start + > **Status:** `running` ### /stop + > `Stopping trader ...` > **Status:** `stopped` ## /status + For each open trade, the bot will send you the following message. > **Trade ID:** `123` @@ -54,6 +59,7 @@ For each open trade, the bot will send you the following message. > **Open Order:** `None` ## /status table + Return the status of all open trades in a table format. ``` ID Pair Since Profit @@ -63,6 +69,7 @@ Return the status of all open trades in a table format. ``` ## /count + Return the number of trades used and available. ``` current max @@ -71,6 +78,7 @@ current max ``` ## /profit + Return a summary of your profit/loss and performance. > **ROI:** Close trades @@ -90,7 +98,14 @@ Return a summary of your profit/loss and performance. > **BITTREX:** Selling BTC/LTC with limit `0.01650000 (profit: ~-4.07%, -0.00008168)` +## /forcebuy + +> **BITTREX**: Buying ETH/BTC with limit `0.03400000` (`1.000000 ETH`, `225.290 USD`) + +Note that for this to work, `forcebuy_enable` needs to be set to true. + ## /performance + Return the performance of each crypto-currency the bot has sold. > Performance: > 1. `RCN/BTC 57.77%` @@ -101,6 +116,7 @@ Return the performance of each crypto-currency the bot has sold. > ... ## /balance + Return the balance of all crypto-currency your have on the exchange. > **Currency:** BTC @@ -114,6 +130,7 @@ Return the balance of all crypto-currency your have on the exchange. > **Pending:** 0.0 ## /daily + Per default `/daily` will return the 7 last days. The example below if for `/daily 3`: @@ -127,5 +144,6 @@ Day Profit BTC Profit USD ``` ## /version + > **Version:** `0.14.3` diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 12f10d3b9..2b09aa6c9 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -130,6 +130,7 @@ CONF_SCHEMA = { }, 'db_url': {'type': 'string'}, 'initial_state': {'type': 'string', 'enum': ['running', 'stopped']}, + 'forcebuy_enable': {'type': 'boolean'}, 'internals': { 'type': 'object', 'properties': {