]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(qav3): fix dataframe NaN check
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 21 Mar 2025 04:31:31 +0000 (05:31 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 21 Mar 2025 04:31:31 +0000 (05:31 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index e1d0050453be3ea3edcbc6961c365ebe3c4bd14c..4115239a66d642a003df3e11cc02b5b7b1b8a274 100644 (file)
@@ -406,14 +406,14 @@ class QuickAdapterV3(IStrategy):
 
     def get_trade_entry_natr(self, df: DataFrame, trade: Trade) -> float | None:
         entry_candle = self.get_trade_entry_candle(df, trade)
-        if isna(entry_candle):
+        if entry_candle is None:
             return None
         entry_candle = entry_candle.squeeze()
         return entry_candle["natr_ratio_labeling_window"]
 
     def get_trade_duration_candles(self, df: DataFrame, trade: Trade) -> int | None:
         entry_candle = self.get_trade_entry_candle(df, trade)
-        if isna(entry_candle):
+        if entry_candle is None:
             return None
         entry_candle = entry_candle.squeeze()
         entry_candle_date = entry_candle["date"]