performance improvevemnts - backtest freqai from saved predictions

This commit is contained in:
Wagner Costa
2022-12-01 12:53:19 -03:00
parent 95651fcd5a
commit 77dc2c92a7
2 changed files with 13 additions and 11 deletions

View File

@@ -462,10 +462,10 @@ class FreqaiDataKitchen:
:param df: Dataframe containing all candles to run the entire backtest. Here
it is sliced down to just the present training period.
"""
df = df.loc[df["date"] >= timerange.startdt, :]
if not self.live:
df = df.loc[df["date"] < timerange.stopdt, :]
df = df.loc[(df["date"] >= timerange.startdt) & (df["date"] < timerange.stopdt), :]
else:
df = df.loc[df["date"] >= timerange.startdt, :]
return df