From 91b89c8c42f4d06c7fbca4c1bef9c795301a3fa1 Mon Sep 17 00:00:00 2001 From: Reigo Reinmets Date: Sat, 8 Jan 2022 21:30:42 +0200 Subject: [PATCH] Improve docs, fix telegram message to show current rate. --- docs/strategy-callbacks.md | 2 +- freqtrade/freqtradebot.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 454c62072..bad96d990 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -589,7 +589,7 @@ This callback is called very frequently, so you must keep your implementation as Stoploss is still calculated from the initial opening price, not averaged price. !!! Warning "Backtesting" - During backtesting this callback is called for each timeframe or `timeframe-detail`, so performance will be affected. + During backtesting this callback is called for each candle in `timeframe` or `timeframe_detail`, so performance will be affected. ``` python from freqtrade.persistence import Trade diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 618fde05a..14a38beb5 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -695,6 +695,8 @@ class FreqtradeBot(LoggingMixin): if open_rate is None: open_rate = trade.open_rate + current_rate = self.exchange.get_rate(trade.pair, refresh=False, side="buy") + msg = { 'trade_id': trade.id, 'type': RPCMessageType.BUY_FILL if fill else RPCMessageType.BUY, @@ -709,7 +711,7 @@ class FreqtradeBot(LoggingMixin): 'fiat_currency': self.config.get('fiat_display_currency', None), 'amount': safe_value_fallback(order, 'filled', 'amount') or trade.amount, 'open_date': trade.open_date or datetime.utcnow(), - 'current_rate': trade.open_rate_requested, + 'current_rate': current_rate, } # Send the message