From a33be8a349b64067d9509dd783008450fd864027 Mon Sep 17 00:00:00 2001 From: hippocritical Date: Sun, 23 Jul 2023 13:48:54 +0200 Subject: [PATCH] added dummy-varholders in case a not-last-trade is force-exit and else the indexes would shift ruining the analysis and making debugging easier (since the same ID will always be the same ID again) --- freqtrade/optimize/lookahead_analysis.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/freqtrade/optimize/lookahead_analysis.py b/freqtrade/optimize/lookahead_analysis.py index f8f9c7d55..e87c3c7de 100755 --- a/freqtrade/optimize/lookahead_analysis.py +++ b/freqtrade/optimize/lookahead_analysis.py @@ -214,6 +214,7 @@ class LookaheadAnalysis: self.entry_varHolders[idx].result, "open_date", self.entry_varHolders[idx].compared_dt): + # logger.info(f"found lookahead-bias in trade {self.entry_varHolders[idx][]} {idx}") self.current_analysis.false_entry_signals += 1 # register if buy or sell signal is broken @@ -261,6 +262,11 @@ class LookaheadAnalysis: return None if "force_exit" in result_row['exit_reason']: logger.info("found force-exit, skipping this one to avoid a false-positive.") + + # just to keep the IDs of both full, entry and exit varholders the same + # to achieve a better debugging experience + self.entry_varHolders.append(VarHolder()) + self.exit_varHolders.append(VarHolder()) continue self.analyze_row(idx, result_row)