Fix test warning
This commit is contained in:
@@ -284,7 +284,7 @@ def load_backtest_data(filename: Union[Path, str], strategy: Optional[str] = Non
|
||||
df['enter_tag'] = df['buy_tag']
|
||||
df = df.drop(['buy_tag'], axis=1)
|
||||
if 'orders' not in df.columns:
|
||||
df.loc[:, 'orders'] = None
|
||||
df['orders'] = None
|
||||
|
||||
else:
|
||||
# old format - only with lists.
|
||||
|
@@ -370,10 +370,10 @@ class Backtesting:
|
||||
for col in HEADERS[5:]:
|
||||
tag_col = col in ('enter_tag', 'exit_tag')
|
||||
if col in df_analyzed.columns:
|
||||
df_analyzed.loc[:, col] = df_analyzed.loc[:, col].replace(
|
||||
df_analyzed[col] = df_analyzed.loc[:, col].replace(
|
||||
[nan], [0 if not tag_col else None]).shift(1)
|
||||
elif not df_analyzed.empty:
|
||||
df_analyzed.loc[:, col] = 0 if not tag_col else None
|
||||
df_analyzed[col] = 0 if not tag_col else None
|
||||
|
||||
df_analyzed = df_analyzed.drop(df_analyzed.head(1).index)
|
||||
|
||||
|
Reference in New Issue
Block a user