Correction on tests

This commit is contained in:
Nicolas Papp
2022-04-24 17:37:09 -03:00
parent 0f943c482b
commit 086cc6be93
2 changed files with 14 additions and 6 deletions

View File

@@ -511,9 +511,7 @@ def calculate_max_drawdown(trades: pd.DataFrame, *, date_col: str = 'close_date'
high_val = max_drawdown_df.loc[max_drawdown_df.iloc[:idxmin]
['high_value'].idxmax(), 'cumulative']
low_val = max_drawdown_df.loc[idxmin, 'cumulative']
max_drawdown_rel = 0.0
if starting_balance != 0:
max_drawdown_rel = max_drawdown_df.loc[idxmin, 'drawdown_relative']
max_drawdown_rel = max_drawdown_df.loc[idxmin, 'drawdown_relative']
return (
abs(min(max_drawdown_df['drawdown'])),