mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-13 03:33:55 +00:00
added mentioning which pair + timerange + idx is biased for visibility and debugging purposes
This commit is contained in:
parent
a33be8a349
commit
1ab357dc32
|
@ -141,7 +141,7 @@ class LookaheadAnalysis:
|
||||||
shutil.rmtree(path_to_current_identifier)
|
shutil.rmtree(path_to_current_identifier)
|
||||||
|
|
||||||
prepare_data_config = deepcopy(self.local_config)
|
prepare_data_config = deepcopy(self.local_config)
|
||||||
prepare_data_config['timerange'] = (str(self.dt_to_timestamp(varholder.from_dt)) + "-" +
|
prepare_data_config['timerange'] = (str(self.dt_to_timestamp(varholder.from_dt)) + " - " +
|
||||||
str(self.dt_to_timestamp(varholder.to_dt)))
|
str(self.dt_to_timestamp(varholder.to_dt)))
|
||||||
prepare_data_config['exchange']['pair_whitelist'] = pairs_to_load
|
prepare_data_config['exchange']['pair_whitelist'] = pairs_to_load
|
||||||
|
|
||||||
|
@ -209,13 +209,16 @@ class LookaheadAnalysis:
|
||||||
# fill entry_varHolder and exit_varHolder
|
# fill entry_varHolder and exit_varHolder
|
||||||
self.fill_entry_and_exit_varHolders(result_row)
|
self.fill_entry_and_exit_varHolders(result_row)
|
||||||
|
|
||||||
|
# this will trigger a logger-message
|
||||||
|
buy_or_sell_biased: bool = False
|
||||||
|
|
||||||
# register if buy signal is broken
|
# register if buy signal is broken
|
||||||
if not self.report_signal(
|
if not self.report_signal(
|
||||||
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
|
||||||
|
buy_or_sell_biased = True
|
||||||
|
|
||||||
# register if buy or sell signal is broken
|
# register if buy or sell signal is broken
|
||||||
if not self.report_signal(
|
if not self.report_signal(
|
||||||
|
@ -223,6 +226,13 @@ class LookaheadAnalysis:
|
||||||
"close_date",
|
"close_date",
|
||||||
self.exit_varHolders[idx].compared_dt):
|
self.exit_varHolders[idx].compared_dt):
|
||||||
self.current_analysis.false_exit_signals += 1
|
self.current_analysis.false_exit_signals += 1
|
||||||
|
buy_or_sell_biased = True
|
||||||
|
|
||||||
|
if buy_or_sell_biased:
|
||||||
|
logger.info(f"found lookahead-bias in trade "
|
||||||
|
f"pair: {result_row['pair']}, "
|
||||||
|
f"timerange:{result_row['open_date']}-{result_row['close_date']}, "
|
||||||
|
f"idx: {idx}")
|
||||||
|
|
||||||
# check if the indicators themselves contain biased data
|
# check if the indicators themselves contain biased data
|
||||||
self.analyze_indicators(self.full_varHolder, self.entry_varHolders[idx], result_row['pair'])
|
self.analyze_indicators(self.full_varHolder, self.entry_varHolders[idx], result_row['pair'])
|
||||||
|
@ -261,7 +271,9 @@ class LookaheadAnalysis:
|
||||||
f"Exiting this lookahead-analysis")
|
f"Exiting this lookahead-analysis")
|
||||||
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 in pair: {result_row['pair']}, "
|
||||||
|
f"timerange:{result_row['open_date']}-{result_row['close_date']}, "
|
||||||
|
f"idx: {idx}, skipping this one to avoid a false-positive.")
|
||||||
|
|
||||||
# just to keep the IDs of both full, entry and exit varholders the same
|
# just to keep the IDs of both full, entry and exit varholders the same
|
||||||
# to achieve a better debugging experience
|
# to achieve a better debugging experience
|
||||||
|
|
Loading…
Reference in New Issue
Block a user