In codes below, it introduces lookahead bias, I suggest trying 'merge' function or please check 'nearest' function's definition:
if not informative.empty:
Ujistěte se, že 'informative' je zarovnán s hlavním dataframe
informative = informative.reindex(dataframe.index, method='nearest')
# Nyní bezpečně porovnávejte uzavírací ceny, protože jsou zarovnané
conditions.append(dataframe['close'] < informative['close'].shift(1))
else:
logging.info(f"No data available for {metadata['pair']} in '{level}' timeframe. Skipping this condition.")
Your strategy is great and codes above is the only lookahead bias's root....
In codes below, it introduces lookahead bias, I suggest trying 'merge' function or please check 'nearest' function's definition: if not informative.empty:
Ujistěte se, že 'informative' je zarovnán s hlavním dataframe
Your strategy is great and codes above is the only lookahead bias's root....