From dc7e834911cbf9e7b5b14d059fe5aad6bb90270d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 1 Apr 2023 20:10:52 +0200 Subject: [PATCH] Fix some type issues --- freqtrade/freqtradebot.py | 4 ++-- freqtrade/rpc/rpc_types.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index e806c3bfc..bd281bc79 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -947,7 +947,7 @@ class FreqtradeBot(LoggingMixin): return enter_limit_requested, stake_amount, leverage - def _notify_enter(self, trade: Trade, order: Order, order_type: Optional[str] = None, + def _notify_enter(self, trade: Trade, order: Order, order_type: str, fill: bool = False, sub_trade: bool = False) -> None: """ Sends rpc notification when a entry order occurred. @@ -1852,7 +1852,7 @@ class FreqtradeBot(LoggingMixin): self.handle_protections(trade.pair, trade.trade_direction) elif send_msg and not trade.open_order_id and not stoploss_order: # Enter fill - self._notify_enter(trade, order, fill=True, sub_trade=sub_trade) + self._notify_enter(trade, order, order.order_type, fill=True, sub_trade=sub_trade) def handle_protections(self, pair: str, side: LongShort) -> None: # Lock pair for one candle to prevent immediate rebuys diff --git a/freqtrade/rpc/rpc_types.py b/freqtrade/rpc/rpc_types.py index 3277a2d6e..23f3ed5a9 100644 --- a/freqtrade/rpc/rpc_types.py +++ b/freqtrade/rpc/rpc_types.py @@ -52,7 +52,7 @@ class __RPCBuyMsgBase(RPCSendMsgBase): direction: str limit: float open_rate: float - order_type: Optional[str] # TODO: why optional?? + order_type: str stake_amount: float stake_currency: str fiat_currency: Optional[str]