You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we take cum_returns(returns, starting_value=1) to form the NAV time series off of which we calculate max drawdown, the first value of the NAV used in the max drawdown calculation is the portfolio value at the end of the first trading day. This means that when the first trading day is the first day of the max drawdown, we are not counting that day's loss in that max drawdown stat.
For example:
If the first trading day results in a 10% loss and subsequent trading days lead to a total 25% loss, we will be calculating max drawdown as:
(.90 - 0.75) / 0.90 = 0.16666666
when we should be calculating it as:
(1.0 - 0.75) / 1.0 = 0.25
I think the fix might be to append a dummy day with a value of 1 to the beginning of the df_cum time series in cum_returns in the case where there is no NaN in the first iloc.
The text was updated successfully, but these errors were encountered:
a-campbell
changed the title
max_drawdown incorrect if drawdown begins on first day of backtest
max_drawdown incorrect if drawdown begins on first day of returns time series
Oct 22, 2015
Because we take cum_returns(returns, starting_value=1) to form the NAV time series off of which we calculate max drawdown, the first value of the NAV used in the max drawdown calculation is the portfolio value at the end of the first trading day. This means that when the first trading day is the first day of the max drawdown, we are not counting that day's loss in that max drawdown stat.
For example:
If the first trading day results in a 10% loss and subsequent trading days lead to a total 25% loss, we will be calculating max drawdown as:
(.90 - 0.75) / 0.90 = 0.16666666
when we should be calculating it as:
(1.0 - 0.75) / 1.0 = 0.25
I think the fix might be to append a dummy day with a value of 1 to the beginning of the
df_cum
time series in cum_returns in the case where there is no NaN in the first iloc.The text was updated successfully, but these errors were encountered: