From 26e54fb035b47ff87f63f532dfdbfea4cc5bc7c1 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 4 Jan 2022 23:10:14 -0600 Subject: [PATCH] emergencysell -> emergencyexit --- docs/configuration.md | 10 +++++----- docs/stoploss.md | 8 ++++---- freqtrade/constants.py | 2 +- freqtrade/freqtradebot.py | 2 +- freqtrade/rpc/api_server/api_schemas.py | 2 +- freqtrade/templates/subtemplates/exchange_bittrex.j2 | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index c6328aa08..5d6cb39c1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -360,7 +360,7 @@ For example, if your strategy is using a 1h timeframe, and you only want to buy ### Understand order_types -The `order_types` configuration parameter maps actions (`buy`, `sell`, `stoploss`, `emergencysell`, `forcesell`, `forcebuy`) to order-types (`market`, `limit`, ...) as well as configures stoploss to be on the exchange and defines stoploss on exchange update interval in seconds. +The `order_types` configuration parameter maps actions (`buy`, `sell`, `stoploss`, `emergencyexit`, `forcesell`, `forcebuy`) to order-types (`market`, `limit`, ...) as well as configures stoploss to be on the exchange and defines stoploss on exchange update interval in seconds. This allows to buy using limit orders, sell using limit-orders, and create stoplosses using market orders. It also allows to set the @@ -372,7 +372,7 @@ the buy order is fulfilled. If this is configured, the following 4 values (`buy`, `sell`, `stoploss` and `stoploss_on_exchange`) need to be present, otherwise, the bot will fail to start. -For information on (`emergencysell`,`forcesell`, `forcebuy`, `stoploss_on_exchange`,`stoploss_on_exchange_interval`,`stoploss_on_exchange_limit_ratio`) please see stop loss documentation [stop loss on exchange](stoploss.md) +For information on (`emergencyexit`,`forcesell`, `forcebuy`, `stoploss_on_exchange`,`stoploss_on_exchange_interval`,`stoploss_on_exchange_limit_ratio`) please see stop loss documentation [stop loss on exchange](stoploss.md) Syntax for Strategy: @@ -380,7 +380,7 @@ Syntax for Strategy: order_types = { "buy": "limit", "sell": "limit", - "emergencysell": "market", + "emergencyexit": "market", "forcebuy": "market", "forcesell": "market", "stoploss": "market", @@ -396,7 +396,7 @@ Configuration: "order_types": { "buy": "limit", "sell": "limit", - "emergencysell": "market", + "emergencyexit": "market", "forcebuy": "market", "forcesell": "market", "stoploss": "market", @@ -421,7 +421,7 @@ Configuration: If `stoploss_on_exchange` is enabled and the stoploss is cancelled manually on the exchange, then the bot will create a new stoploss order. !!! Warning "Warning: stoploss_on_exchange failures" - If stoploss on exchange creation fails for some reason, then an "emergency sell" is initiated. By default, this will sell the asset using a market order. The order-type for the emergency-sell can be changed by setting the `emergencysell` value in the `order_types` dictionary - however, this is not advised. + If stoploss on exchange creation fails for some reason, then an "emergency sell" is initiated. By default, this will sell the asset using a market order. The order-type for the emergency-sell can be changed by setting the `emergencyexit` value in the `order_types` dictionary - however, this is not advised. ### Understand order_time_in_force diff --git a/docs/stoploss.md b/docs/stoploss.md index 4f8ac9e94..bd50c610b 100644 --- a/docs/stoploss.md +++ b/docs/stoploss.md @@ -16,7 +16,7 @@ Those stoploss modes can be *on exchange* or *off exchange*. These modes can be configured with these values: ``` python - 'emergencysell': 'market', + 'emergencyexit': 'market', 'stoploss_on_exchange': False 'stoploss_on_exchange_interval': 60, 'stoploss_on_exchange_limit_ratio': 0.99 @@ -59,9 +59,9 @@ This same logic will reapply a stoploss order on the exchange should you cancel `forcebuy` is an optional value, which defaults to the same value as `buy` and is used when sending a `/forcebuy` command from Telegram or from the Rest API. -### emergencysell +### emergencyexit -`emergencysell` is an optional value, which defaults to `market` and is used when creating stop loss on exchange orders fails. +`emergencyexit` is an optional value, which defaults to `market` and is used when creating stop loss on exchange orders fails. The below is the default which is used if not changed in strategy or configuration file. Example from strategy file: @@ -70,7 +70,7 @@ Example from strategy file: order_types = { 'buy': 'limit', 'sell': 'limit', - 'emergencysell': 'market', + 'emergencyexit': 'market', 'stoploss': 'market', 'stoploss_on_exchange': True, 'stoploss_on_exchange_interval': 60, diff --git a/freqtrade/constants.py b/freqtrade/constants.py index e386f2ce3..0a709dbb5 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -215,7 +215,7 @@ CONF_SCHEMA = { 'sell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'forcesell': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'forcebuy': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, - 'emergencysell': { + 'emergencyexit': { 'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES, 'default': 'market'}, diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 3a519d8b9..1e9862b0a 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1316,7 +1316,7 @@ class FreqtradeBot(LoggingMixin): order_type = ordertype or self.strategy.order_types[exit_type] if exit_reason.exit_type == ExitType.EMERGENCY_EXIT: # Emergency sells (default to market!) - order_type = self.strategy.order_types.get("emergencysell", "market") + order_type = self.strategy.order_types.get("emergencyexit", "market") amount = self._safe_exit_amount(trade.pair, trade.amount) time_in_force = self.strategy.order_time_in_force['sell'] # TODO-lev update to exit diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index 37102d396..c76a2291a 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -135,7 +135,7 @@ class UnfilledTimeout(BaseModel): class OrderTypes(BaseModel): buy: OrderTypeValues sell: OrderTypeValues - emergencysell: Optional[OrderTypeValues] + emergencyexit: Optional[OrderTypeValues] forcesell: Optional[OrderTypeValues] forcebuy: Optional[OrderTypeValues] stoploss: OrderTypeValues diff --git a/freqtrade/templates/subtemplates/exchange_bittrex.j2 b/freqtrade/templates/subtemplates/exchange_bittrex.j2 index 0394790ce..f5b7fe7a1 100644 --- a/freqtrade/templates/subtemplates/exchange_bittrex.j2 +++ b/freqtrade/templates/subtemplates/exchange_bittrex.j2 @@ -1,7 +1,7 @@ "order_types": { "buy": "limit", "sell": "limit", - "emergencysell": "limit", + "emergencyexit": "limit", "stoploss": "limit", "stoploss_on_exchange": false },