Use better lock message

This commit is contained in:
Matthias 2020-10-20 19:39:38 +02:00
parent 64e680d7ee
commit 5f63fdd8ad
4 changed files with 4 additions and 9 deletions

View File

@ -938,7 +938,7 @@ class FreqtradeBot:
stoploss_order=True) stoploss_order=True)
# Lock pair for one candle to prevent immediate rebuys # Lock pair for one candle to prevent immediate rebuys
self.strategy.lock_pair(trade.pair, timeframe_to_next_date(self.config['timeframe']), self.strategy.lock_pair(trade.pair, timeframe_to_next_date(self.config['timeframe']),
reason='auto_lock_1_candle') reason='Auto lock')
self._notify_sell(trade, "stoploss") self._notify_sell(trade, "stoploss")
return True return True
@ -1265,7 +1265,7 @@ class FreqtradeBot:
# Lock pair for one candle to prevent immediate rebuys # Lock pair for one candle to prevent immediate rebuys
self.strategy.lock_pair(trade.pair, timeframe_to_next_date(self.config['timeframe']), self.strategy.lock_pair(trade.pair, timeframe_to_next_date(self.config['timeframe']),
reason='auto_lock_1_candle') reason='Auto lock')
self._notify_sell(trade, order_type) self._notify_sell(trade, order_type)

View File

@ -356,7 +356,7 @@ class ApiServer(RPC):
def _locks(self): def _locks(self):
""" """
Handler for /locks. Handler for /locks.
Returns the number of trades running Returns the currently active locks.
""" """
return jsonify(self._rpc_locks()) return jsonify(self._rpc_locks())

View File

@ -15,7 +15,6 @@ from telegram.ext import CallbackContext, CommandHandler, Updater
from telegram.utils.helpers import escape_markdown from telegram.utils.helpers import escape_markdown
from freqtrade.__init__ import __version__ from freqtrade.__init__ import __version__
from freqtrade.constants import DATETIME_PRINT_FORMAT
from freqtrade.rpc import RPC, RPCException, RPCMessageType from freqtrade.rpc import RPC, RPCException, RPCMessageType
from freqtrade.rpc.fiat_convert import CryptoToFiatConverter from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
@ -614,10 +613,7 @@ class Telegram(RPC):
def _locks(self, update: Update, context: CallbackContext) -> None: def _locks(self, update: Update, context: CallbackContext) -> None:
""" """
Handler for /locks. Handler for /locks.
Returns the number of trades running Returns the currently active locks
:param bot: telegram bot
:param update: message update
:return: None
""" """
try: try:
locks = self._rpc_locks() locks = self._rpc_locks()

View File

@ -4,7 +4,6 @@ Unit test file for rpc/api_server.py
from datetime import datetime, timedelta from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
from time import sleep
from unittest.mock import ANY, MagicMock, PropertyMock from unittest.mock import ANY, MagicMock, PropertyMock
import pytest import pytest