Update on note

This commit is contained in:
Nicolas Papp 2022-04-24 17:42:52 -03:00
parent 086cc6be93
commit e8aec967dd

View File

@ -446,7 +446,8 @@ def _calc_drawdown_series(profit_results: pd.DataFrame, *, date_col: str, value_
max_balance = starting_balance + max_drawdown_df['high_value']
max_drawdown_df['drawdown_relative'] = ((max_balance - cumulative_balance) / max_balance)
else:
# This is not completely accurate
# NOTE: This is not completely accurate,
# but might good enough if starting_balance is not available
max_drawdown_df['drawdown_relative'] = (
(max_drawdown_df['high_value'] - max_drawdown_df['cumulative'])
/ max_drawdown_df['high_value'])