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)
This commit is contained in:
@@ -214,6 +214,7 @@ class LookaheadAnalysis:
|
|||||||
self.entry_varHolders[idx].result,
|
self.entry_varHolders[idx].result,
|
||||||
"open_date",
|
"open_date",
|
||||||
self.entry_varHolders[idx].compared_dt):
|
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
|
self.current_analysis.false_entry_signals += 1
|
||||||
|
|
||||||
# register if buy or sell signal is broken
|
# register if buy or sell signal is broken
|
||||||
@@ -261,6 +262,11 @@ class LookaheadAnalysis:
|
|||||||
return None
|
return None
|
||||||
if "force_exit" in result_row['exit_reason']:
|
if "force_exit" in result_row['exit_reason']:
|
||||||
logger.info("found force-exit, skipping this one to avoid a false-positive.")
|
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
|
continue
|
||||||
|
|
||||||
self.analyze_row(idx, result_row)
|
self.analyze_row(idx, result_row)
|
||||||
|
|||||||
Reference in New Issue
Block a user