From ee808abfea45c594334e8c14540a2842df520073 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 1 Sep 2019 09:07:09 +0200 Subject: [PATCH] Add emergency_sell as sell reason --- config_full.json.example | 1 + docs/configuration.md | 3 +++ freqtrade/constants.py | 1 + freqtrade/strategy/interface.py | 1 + 4 files changed, 6 insertions(+) diff --git a/config_full.json.example b/config_full.json.example index b6451859c..957967042 100644 --- a/config_full.json.example +++ b/config_full.json.example @@ -38,6 +38,7 @@ "order_types": { "buy": "limit", "sell": "limit", + "emergencysell": "market", "stoploss": "market", "stoploss_on_exchange": false, "stoploss_on_exchange_interval": 60 diff --git a/docs/configuration.md b/docs/configuration.md index fcd6c2bf6..dc4c365f6 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -205,6 +205,7 @@ Values set in the configuration file overwrites values set in the strategy. If this is configured, all 4 values (`buy`, `sell`, `stoploss` and `stoploss_on_exchange`) need to be present, otherwise the bot will warn about it and fail to start. +`emergencysell` is an optional value, which defaults to `market` and is used when creating stoploss on exchange orders fails. The below is the default which is used if this is not configured in either strategy or configuration file. Syntax for Strategy: @@ -213,6 +214,7 @@ Syntax for Strategy: order_types = { "buy": "limit", "sell": "limit", + "emergencysell": "market", "stoploss": "market", "stoploss_on_exchange": False, "stoploss_on_exchange_interval": 60 @@ -225,6 +227,7 @@ Configuration: "order_types": { "buy": "limit", "sell": "limit", + "emergencysell": "market", "stoploss": "market", "stoploss_on_exchange": false, "stoploss_on_exchange_interval": 60 diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 05ee99c1b..d7ace131c 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -121,6 +121,7 @@ CONF_SCHEMA = { 'properties': { 'buy': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'sell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, + 'emergencysell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'stoploss': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'stoploss_on_exchange': {'type': 'boolean'}, 'stoploss_on_exchange_interval': {'type': 'number'} diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 3f2478cc0..6c6593a53 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -39,6 +39,7 @@ class SellType(Enum): TRAILING_STOP_LOSS = "trailing_stop_loss" SELL_SIGNAL = "sell_signal" FORCE_SELL = "force_sell" + EMERGENCY_SELL = "emergency_sell" NONE = ""