From 916c82b4ac5985a78fbc982756f787a21dd6a40b Mon Sep 17 00:00:00 2001 From: ashledombos Date: Sat, 30 Dec 2023 00:53:00 +0100 Subject: [PATCH] Update perp_bitget.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrigé le bug TypeError dans get_open_position en ajoutant une vérification de None pour position['contracts'], évitant ainsi les erreurs de conversion en float sur des valeurs non définies. --- utilities/perp_bitget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/perp_bitget.py b/utilities/perp_bitget.py index e077b7a..b80efcc 100644 --- a/utilities/perp_bitget.py +++ b/utilities/perp_bitget.py @@ -205,7 +205,7 @@ def get_open_position(self,symbol=None): }) truePositions = [] for position in positions: - if float(position['contracts']) > 0 and (symbol is None or position['symbol'] == symbol): + if position['contracts'] is not None and float(position['contracts']) > 0 and (symbol is None or position['symbol'] == symbol): truePositions.append(position) return truePositions except BaseException as err: