diff --git a/README.md b/README.md index 02eb47e00..dcd978ae3 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Telegram is not mandatory. However, this is a great way to control your bot. Mor - `/stopbuy`: Stop entering new trades. - `/status |[table]`: Lists all or specific open trades. - `/profit []`: Lists cumulative profit from all finished trades, over the last n days. -- `/forceexit |all`: Instantly exits the given trade (Ignoring `minimum_roi`). +- `/force_exit |all`: Instantly exits the given trade (Ignoring `minimum_roi`). - `/performance`: Show performance of each finished trade grouped by pair - `/balance`: Show account balance per currency. - `/daily `: Shows profit or loss per day, over the last n days. diff --git a/config_examples/config_full.example.json b/config_examples/config_full.example.json index 33a267612..bcbf34b9b 100644 --- a/config_examples/config_full.example.json +++ b/config_examples/config_full.example.json @@ -54,9 +54,9 @@ "order_types": { "entry": "limit", "exit": "limit", - "emergencyexit": "market", - "forceexit": "market", - "forceentry": "market", + "emergency_exit": "market", + "force_exit": "market", + "force_entry": "market", "stoploss": "market", "stoploss_on_exchange": false, "stoploss_on_exchange_interval": 60, diff --git a/docs/backtesting.md b/docs/backtesting.md index 96f52d160..c41277271 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -366,7 +366,7 @@ This table can tell you which area needs some additional work (e.g. all or many ### Left open trades table -The 3rd table contains all trades the bot had to `forceexit` at the end of the backtesting period to present you the full picture. +The 3rd table contains all trades the bot had to `force_exit` at the end of the backtesting period to present you the full picture. This is necessary to simulate realistic behavior, since the backtest period has to end at some point, while realistically, you could leave the bot running forever. These trades are also included in the first table, but are also shown separately in this table for clarity. diff --git a/docs/configuration.md b/docs/configuration.md index 3733b5b25..a41f52b9c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -376,7 +376,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 (`entry`, `exit`, `stoploss`, `emergencyexit`, `forceexit`, `forceentry`) 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 (`entry`, `exit`, `stoploss`, `emergency_exit`, `force_exit`, `force_entry`) 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 @@ -387,7 +387,7 @@ the buy order is fulfilled. If this is configured, the following 4 values (`entry`, `exit`, `stoploss` and `stoploss_on_exchange`) need to be present, otherwise, the bot will fail to start. -For information on (`emergencyexit`,`forceexit`, `forceentry`, `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 (`emergency_exit`,`force_exit`, `force_entry`, `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: @@ -395,9 +395,9 @@ Syntax for Strategy: order_types = { "entry": "limit", "exit": "limit", - "emergencyexit": "market", - "forceentry": "market", - "forceexit": "market", + "emergency_exit": "market", + "force_entry": "market", + "force_exit": "market", "stoploss": "market", "stoploss_on_exchange": False, "stoploss_on_exchange_interval": 60, @@ -411,9 +411,9 @@ Configuration: "order_types": { "entry": "limit", "exit": "limit", - "emergencyexit": "market", - "forceentry": "market", - "forceexit": "market", + "emergency_exit": "market", + "force_entry": "market", + "force_exit": "market", "stoploss": "market", "stoploss_on_exchange": false, "stoploss_on_exchange_interval": 60 @@ -436,7 +436,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 exit" 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. + If stoploss on exchange creation fails for some reason, then an "emergency exit" 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 `emergency_exit` value in the `order_types` dictionary - however, this is not advised. ### Understand order_time_in_force diff --git a/docs/faq.md b/docs/faq.md index f1542d08e..47944181f 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -79,7 +79,7 @@ You can use "current" market data by using the [dataprovider](strategy-customiza ### Is there a setting to only SELL the coins being held and not perform anymore BUYS? -You can use the `/stopbuy` command in Telegram to prevent future buys, followed by `/forceexit all` (sell all open trades). +You can use the `/stopbuy` command in Telegram to prevent future buys, followed by `/force_exit all` (sell all open trades). ### I want to run multiple bots on the same machine diff --git a/docs/rest-api.md b/docs/rest-api.md index 25e7ee205..fccd8a8c7 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -145,8 +145,8 @@ python3 scripts/rest_client.py --config rest_config.json [optional par | `locks` | Displays currently locked pairs. | `delete_lock ` | Deletes (disables) the lock by id. | `profit` | Display a summary of your profit/loss from close trades and some stats about your performance. -| `forceexit ` | Instantly exits the given trade (Ignoring `minimum_roi`). -| `forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`). +| `force_exit ` | Instantly exits the given trade (Ignoring `minimum_roi`). +| `force_exit all` | Instantly exits all open trades (Ignoring `minimum_roi`). | `forceenter [rate]` | Instantly enters the given pair. Rate is optional. (`forcebuy_enable` must be set to True) | `forceenter [rate]` | Instantly longs or shorts the given pair. Rate is optional. (`forcebuy_enable` must be set to True) | `performance` | Show performance of each finished trade grouped by pair. diff --git a/docs/sql_cheatsheet.md b/docs/sql_cheatsheet.md index 7b9b99881..0405bcff0 100644 --- a/docs/sql_cheatsheet.md +++ b/docs/sql_cheatsheet.md @@ -52,11 +52,11 @@ SELECT * FROM trades; ## Fix trade still open after a manual exit on the exchange !!! Warning - Manually selling a pair on the exchange will not be detected by the bot and it will try to sell anyway. Whenever possible, forceexit should be used to accomplish the same thing. + Manually selling a pair on the exchange will not be detected by the bot and it will try to sell anyway. Whenever possible, force_exit should be used to accomplish the same thing. It is strongly advised to backup your database file before making any manual changes. !!! Note - This should not be necessary after /forceexit, as forceexit orders are closed automatically by the bot on the next iteration. + This should not be necessary after /force_exit, as force_exit orders are closed automatically by the bot on the next iteration. ```sql UPDATE trades diff --git a/docs/stoploss.md b/docs/stoploss.md index 2d95813ac..c950aedcb 100644 --- a/docs/stoploss.md +++ b/docs/stoploss.md @@ -17,7 +17,7 @@ Those stoploss modes can be *on exchange* or *off exchange*. These modes can be configured with these values: ``` python - 'emergencyexit': 'market', + 'emergency_exit': 'market', 'stoploss_on_exchange': False 'stoploss_on_exchange_interval': 60, 'stoploss_on_exchange_limit_ratio': 0.99 @@ -52,17 +52,17 @@ The bot cannot do these every 5 seconds (at each iteration), otherwise it would So this parameter will tell the bot how often it should update the stoploss order. The default value is 60 (1 minute). This same logic will reapply a stoploss order on the exchange should you cancel it accidentally. -### forceexit +### force_exit -`forceexit` is an optional value, which defaults to the same value as `exit` and is used when sending a `/forceexit` command from Telegram or from the Rest API. +`force_exit` is an optional value, which defaults to the same value as `exit` and is used when sending a `/force_exit` command from Telegram or from the Rest API. -### forceentry +### force_entry -`forceentry` is an optional value, which defaults to the same value as `entry` and is used when sending a `/forceentry` command from Telegram or from the Rest API. +`force_entry` is an optional value, which defaults to the same value as `entry` and is used when sending a `/force_entry` command from Telegram or from the Rest API. -### emergencyexit +### emergency_exit -`emergencyexit` is an optional value, which defaults to `market` and is used when creating stop loss on exchange orders fails. +`emergency_exit` 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: @@ -71,7 +71,7 @@ Example from strategy file: order_types = { "entry": "limit", "exit": "limit", - "emergencyexit": "market", + "emergency_exit": "market", "stoploss": "market", "stoploss_on_exchange": True, "stoploss_on_exchange_interval": 60, diff --git a/docs/strategy_migration.md b/docs/strategy_migration.md index 31cbb71e0..4db65bcec 100644 --- a/docs/strategy_migration.md +++ b/docs/strategy_migration.md @@ -351,9 +351,9 @@ After: order_types = { "entry": "limit", "exit": "limit", - "emergencyexit": "market", - "forceexit": "market", - "forceentry": "market", + "emergency_exit": "market", + "force_exit": "market", + "force_entry": "market", "stoploss": "market", "stoploss_on_exchange": false, "stoploss_on_exchange_interval": 60 diff --git a/docs/telegram-usage.md b/docs/telegram-usage.md index 29187cf95..ec917de17 100644 --- a/docs/telegram-usage.md +++ b/docs/telegram-usage.md @@ -171,8 +171,8 @@ official commands. You can ask at any moment for help with `/help`. | `/locks` | Show currently locked pairs. | `/unlock ` | Remove the lock for this pair (or for this lock id). | `/profit []` | Display a summary of your profit/loss from close trades and some stats about your performance, over the last n days (all trades by default) -| `/forceexit ` | Instantly exits the given trade (Ignoring `minimum_roi`). -| `/forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`). +| `/force_exit ` | Instantly exits the given trade (Ignoring `minimum_roi`). +| `/force_exit all` | Instantly exits all open trades (Ignoring `minimum_roi`). | `/forcelong [rate]` | Instantly buys the given pair. Rate is optional and only applies to limit orders. (`forcebuy_enable` must be set to True) | `/forceshort [rate]` | Instantly shorts the given pair. Rate is optional and only applies to limit orders. This will only work on non-spot markets. (`forcebuy_enable` must be set to True) | `/performance` | Show performance of each finished trade grouped by pair @@ -285,7 +285,7 @@ Starting capital is either taken from the `available_capital` setting, or calcul > **BINANCE:** Long ETH/BTC with limit `0.03400000` (`1.000000 ETH`, `225.290 USD`) Omitting the pair will open a query asking for the pair to trade (based on the current whitelist). -Trades crated through `/forceentry` will have the buy-tag of `forceentry`. +Trades crated through `/force_entry` will have the buy-tag of `force_entry`. ![Telegram force-buy screenshot](assets/telegram_forcebuy.png) diff --git a/freqtrade/configuration/config_validation.py b/freqtrade/configuration/config_validation.py index 09e7b3335..073103f1c 100644 --- a/freqtrade/configuration/config_validation.py +++ b/freqtrade/configuration/config_validation.py @@ -94,8 +94,8 @@ def _validate_unlimited_amount(conf: Dict[str, Any]) -> None: :raise: OperationalException if config validation failed """ if (not conf.get('edge', {}).get('enabled') - and conf.get('max_open_trades') == float('inf') - and conf.get('stake_amount') == constants.UNLIMITED_STAKE_AMOUNT): + and conf.get('max_open_trades') == float('inf') + and conf.get('stake_amount') == constants.UNLIMITED_STAKE_AMOUNT): raise OperationalException("`max_open_trades` and `stake_amount` cannot both be unlimited.") @@ -255,9 +255,9 @@ def _validate_order_types(conf: Dict[str, Any]) -> None: for o, n in [ ('buy', 'entry'), ('sell', 'exit'), - ('emergencysell', 'emergencyexit'), - ('forcesell', 'forceexit'), - ('forcebuy', 'forceentry'), + ('emergencysell', 'emergency_exit'), + ('forcesell', 'force_exit'), + ('forcebuy', 'force_entry'), ]: process_deprecated_setting(conf, 'order_types', o, 'order_types', n) diff --git a/freqtrade/constants.py b/freqtrade/constants.py index bcdc815bf..8692f355b 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -216,9 +216,9 @@ CONF_SCHEMA = { 'properties': { 'entry': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, 'exit': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, - 'forceexit': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, - 'forceentry': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, - 'emergencyexit': { + 'force_exit': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, + 'force_entry': {'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES}, + 'emergency_exit': { 'type': 'string', 'enum': ORDERTYPE_POSSIBILITIES, 'default': 'market'}, diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ccdfbefb4..6f30c15eb 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -191,7 +191,7 @@ class FreqtradeBot(LoggingMixin): # Check and handle any timed out open orders self.check_handle_timedout() - # Protect from collisions with forceexit. + # Protect from collisions with force_exit. # Without this, freqtrade my try to recreate stoploss_on_exchange orders # while exiting is in process, since telegram messages arrive in an different thread. with self._exit_lock: @@ -1379,7 +1379,7 @@ class FreqtradeBot(LoggingMixin): order_type = ordertype or self.strategy.order_types[exit_type] if exit_check.exit_type == ExitType.EMERGENCY_EXIT: # Emergency sells (default to market!) - order_type = self.strategy.order_types.get("emergencyexit", "market") + order_type = self.strategy.order_types.get("emergency_exit", "market") amount = self._safe_exit_amount(trade.pair, trade.amount) time_in_force = self.strategy.order_time_in_force['exit'] diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index 629617ddc..4002e955a 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -140,9 +140,9 @@ class UnfilledTimeout(BaseModel): class OrderTypes(BaseModel): entry: OrderTypeValues exit: OrderTypeValues - emergencyexit: Optional[OrderTypeValues] - forceexit: Optional[OrderTypeValues] - forceentry: Optional[OrderTypeValues] + emergency_exit: Optional[OrderTypeValues] + force_exit: Optional[OrderTypeValues] + force_entry: Optional[OrderTypeValues] stoploss: OrderTypeValues stoploss_on_exchange: bool stoploss_on_exchange_interval: Optional[int] @@ -316,7 +316,7 @@ class ForceEnterPayload(BaseModel): entry_tag: Optional[str] -class ForceExitPayload(BaseModel): +class Force_exitPayload(BaseModel): tradeid: str ordertype: Optional[OrderTypeValues] diff --git a/freqtrade/rpc/api_server/api_v1.py b/freqtrade/rpc/api_server/api_v1.py index 61c5243aa..aaefe3a5e 100644 --- a/freqtrade/rpc/api_server/api_v1.py +++ b/freqtrade/rpc/api_server/api_v1.py @@ -15,7 +15,7 @@ from freqtrade.rpc import RPC from freqtrade.rpc.api_server.api_schemas import (AvailablePairs, Balances, BlacklistPayload, BlacklistResponse, Count, Daily, DeleteLockRequest, DeleteTrade, ForceEnterPayload, - ForceEnterResponse, ForceExitPayload, Health, + ForceEnterResponse, Force_exitPayload, Health, Locks, Logs, OpenTradeSchema, PairHistory, PerformanceEntry, Ping, PlotConfig, Profit, ResultMsg, ShowConfig, Stats, StatusMsg, @@ -135,13 +135,13 @@ def show_config(rpc: Optional[RPC] = Depends(get_rpc_optional), config=Depends(g return resp -# /forcebuy is deprecated with short addition. use ForceEntry instead +# /forcebuy is deprecated with short addition. use Force_entry instead @router.post('/forceenter', response_model=ForceEnterResponse, tags=['trading']) @router.post('/forcebuy', response_model=ForceEnterResponse, tags=['trading']) -def forceentry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)): +def force_entry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)): ordertype = payload.ordertype.value if payload.ordertype else None stake_amount = payload.stakeamount if payload.stakeamount else None - entry_tag = payload.entry_tag if payload.entry_tag else 'forceentry' + entry_tag = payload.entry_tag if payload.entry_tag else 'force_entry' trade = rpc._rpc_force_entry(payload.pair, payload.price, order_side=payload.side, order_type=ordertype, stake_amount=stake_amount, @@ -154,11 +154,11 @@ def forceentry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)): {"status": f"Error entering {payload.side} trade for pair {payload.pair}."}) -@router.post('/forceexit', response_model=ResultMsg, tags=['trading']) +@router.post('/force_exit', response_model=ResultMsg, tags=['trading']) @router.post('/forcesell', response_model=ResultMsg, tags=['trading']) -def forcesell(payload: ForceExitPayload, rpc: RPC = Depends(get_rpc)): +def forcesell(payload: Force_exitPayload, rpc: RPC = Depends(get_rpc)): ordertype = payload.ordertype.value if payload.ordertype else None - return rpc._rpc_forceexit(payload.tradeid, ordertype) + return rpc._rpc_force_exit(payload.tradeid, ordertype) @router.get('/blacklist', response_model=BlacklistResponse, tags=['info', 'pairlist']) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 4aef6c8ff..8d53245f3 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -684,7 +684,7 @@ class RPC: return {'status': 'No more buy will occur from now. Run /reload_config to reset.'} - def _rpc_forceexit(self, trade_id: str, ordertype: Optional[str] = None) -> Dict[str, str]: + def _rpc_force_exit(self, trade_id: str, ordertype: Optional[str] = None) -> Dict[str, str]: """ Handler for forcesell . Sells the given trade at current price @@ -709,7 +709,7 @@ class RPC: trade.pair, side='exit', is_short=trade.is_short, refresh=True) exit_check = ExitCheckTuple(exit_type=ExitType.FORCE_EXIT) order_type = ordertype or self._freqtrade.strategy.order_types.get( - "forceexit", self._freqtrade.strategy.order_types["exit"]) + "force_exit", self._freqtrade.strategy.order_types["exit"]) self._freqtrade.execute_trade_exit( trade, current_rate, exit_check, ordertype=order_type) @@ -732,7 +732,7 @@ class RPC: trade_filter=[Trade.id == trade_id, Trade.is_open.is_(True), ] ).first() if not trade: - logger.warning('forceexit: Invalid argument received') + logger.warning('force_exit: Invalid argument received') raise RPCException('invalid argument') _exec_forcesell(trade) @@ -744,14 +744,14 @@ class RPC: order_type: Optional[str] = None, order_side: SignalDirection = SignalDirection.LONG, stake_amount: Optional[float] = None, - enter_tag: Optional[str] = 'forceentry') -> Optional[Trade]: + enter_tag: Optional[str] = 'force_entry') -> Optional[Trade]: """ Handler for forcebuy Buys a pair trade at the given or current price """ if not self._freqtrade.config.get('forcebuy_enable', False): - raise RPCException('Forceentry not enabled.') + raise RPCException('Force_entry not enabled.') if self._freqtrade.state != State.RUNNING: raise RPCException('trader is not running') @@ -781,7 +781,7 @@ class RPC: # execute buy if not order_type: order_type = self._freqtrade.strategy.order_types.get( - 'forceentry', self._freqtrade.strategy.order_types['entry']) + 'force_entry', self._freqtrade.strategy.order_types['entry']) if self._freqtrade.execute_entry(pair, stake_amount, price, ordertype=order_type, trade=trade, is_short=is_short, diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index a72307634..a365b1b7e 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -153,7 +153,7 @@ class Telegram(RPCHandler): CommandHandler('balance', self._balance), CommandHandler('start', self._start), CommandHandler('stop', self._stop), - CommandHandler(['forcesell', 'forceexit'], self._forceexit), + CommandHandler(['forcesell', 'force_exit'], self._force_exit), CommandHandler(['forcebuy', 'forcelong'], partial( self._forceenter, order_side=SignalDirection.LONG)), CommandHandler('forceshort', partial( @@ -926,7 +926,7 @@ class Telegram(RPCHandler): self._send_msg('Status: `{status}`'.format(**msg)) @authorized_only - def _forceexit(self, update: Update, context: CallbackContext) -> None: + def _force_exit(self, update: Update, context: CallbackContext) -> None: """ Handler for /forcesell . Sells the given trade at current price @@ -940,8 +940,8 @@ class Telegram(RPCHandler): self._send_msg("You must specify a trade-id or 'all'.") return try: - msg = self._rpc._rpc_forceexit(trade_id) - self._send_msg('Forceexit Result: `{result}`'.format(**msg)) + msg = self._rpc._rpc_force_exit(trade_id) + self._send_msg('Force_exit Result: `{result}`'.format(**msg)) except RPCException as e: self._send_msg(str(e)) @@ -1373,7 +1373,7 @@ class Telegram(RPCHandler): "*/start:* `Starts the trader`\n" "*/stop:* Stops the trader\n" "*/stopbuy:* `Stops buying, but handles open trades gracefully` \n" - "*/forceexit |all:* `Instantly exits the given trade or all trades, " + "*/force_exit |all:* `Instantly exits the given trade or all trades, " "regardless of profit`\n" f"{forceenter_text if self._config.get('forcebuy_enable', False) else ''}" "*/delete :* `Instantly delete the given trade in the database`\n" diff --git a/freqtrade/templates/subtemplates/exchange_bittrex.j2 b/freqtrade/templates/subtemplates/exchange_bittrex.j2 index 2d9afd578..023862314 100644 --- a/freqtrade/templates/subtemplates/exchange_bittrex.j2 +++ b/freqtrade/templates/subtemplates/exchange_bittrex.j2 @@ -1,7 +1,7 @@ "order_types": { "entry": "limit", "exit": "limit", - "emergencyexit": "limit", + "emergency_exit": "limit", "stoploss": "limit", "stoploss_on_exchange": false }, diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index fdd3a610e..992e4edf7 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1077,13 +1077,13 @@ def test_api_whitelist(botclient): 'forcebuy', 'forceenter', ]) -def test_api_forceentry(botclient, mocker, fee, endpoint): +def test_api_force_entry(botclient, mocker, fee, endpoint): ftbot, client = botclient rc = client_post(client, f"{BASE_URI}/{endpoint}", data='{"pair": "ETH/BTC"}') assert_response(rc, 502) - assert rc.json() == {"error": f"Error querying /api/v1/{endpoint}: Forceentry not enabled."} + assert rc.json() == {"error": f"Error querying /api/v1/{endpoint}: Force_entry not enabled."} # enable forcebuy ftbot.config['forcebuy_enable'] = True diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 7ee8d8a84..4124e7279 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -95,7 +95,7 @@ def test_telegram_init(default_conf, mocker, caplog) -> None: message_str = ("rpc.telegram is listening for following commands: [['status'], ['profit'], " "['balance'], ['start'], ['stop'], " - "['forcesell', 'forceexit'], ['forcebuy', 'forcelong'], ['forceshort'], " + "['forcesell', 'force_exit'], ['forcebuy', 'forcelong'], ['forceshort'], " "['trades'], ['delete'], ['performance'], " "['buys', 'entries'], ['sells', 'exits'], ['mix_tags'], " "['stats'], ['daily'], ['weekly'], ['monthly'], " @@ -1035,7 +1035,7 @@ def test_telegram_forcesell_handle(default_conf, update, ticker, fee, # /forcesell 1 context = MagicMock() context.args = ["1"] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) assert msg_mock.call_count == 4 last_msg = msg_mock.call_args_list[-2][0][0] @@ -1103,7 +1103,7 @@ def test_telegram_forcesell_down_handle(default_conf, update, ticker, fee, # /forcesell 1 context = MagicMock() context.args = ["1"] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) assert msg_mock.call_count == 4 @@ -1162,7 +1162,7 @@ def test_forcesell_all_handle(default_conf, update, ticker, fee, mocker) -> None # /forcesell all context = MagicMock() context.args = ["all"] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) # Called for each trade 2 times assert msg_mock.call_count == 8 @@ -1207,7 +1207,7 @@ def test_forcesell_handle_invalid(default_conf, update, mocker) -> None: # /forcesell 1 context = MagicMock() context.args = ["1"] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) assert msg_mock.call_count == 1 assert 'not running' in msg_mock.call_args_list[0][0][0] @@ -1216,7 +1216,7 @@ def test_forcesell_handle_invalid(default_conf, update, mocker) -> None: freqtradebot.state = State.RUNNING context = MagicMock() context.args = [] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) assert msg_mock.call_count == 1 assert "You must specify a trade-id or 'all'." in msg_mock.call_args_list[0][0][0] @@ -1226,7 +1226,7 @@ def test_forcesell_handle_invalid(default_conf, update, mocker) -> None: # /forcesell 123456 context = MagicMock() context.args = ["123456"] - telegram._forceexit(update=update, context=context) + telegram._force_exit(update=update, context=context) assert msg_mock.call_count == 1 assert 'invalid argument' in msg_mock.call_args_list[0][0][0] @@ -1274,7 +1274,7 @@ def test_forceenter_handle_exception(default_conf, update, mocker) -> None: telegram._forceenter(update=update, context=MagicMock(), order_side=SignalDirection.LONG) assert msg_mock.call_count == 1 - assert msg_mock.call_args_list[0][0][0] == 'Forceentry not enabled.' + assert msg_mock.call_args_list[0][0][0] == 'Force_entry not enabled.' def test_forceenter_no_pair(default_conf, update, mocker) -> None: diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 3783e30a1..88252052a 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -977,7 +977,7 @@ def test__validate_order_types(default_conf, caplog) -> None: assert log_has_re(r"DEPRECATED: Using 'buy' and 'sell' for order_types is.*", caplog) assert conf['order_types']['entry'] == 'limit' assert conf['order_types']['exit'] == 'market' - assert conf['order_types']['forceentry'] == 'limit' + assert conf['order_types']['force_entry'] == 'limit' assert 'buy' not in conf['order_types'] assert 'sell' not in conf['order_types'] assert 'forcebuy' not in conf['order_types']