Maximum drawdown from a return series
Asked at Two Sigma, Citadel
Often you are handed periodic returns, not the equity curve itself. Given simple returns (as decimals, so means ), the equity after period is the running product . Find the maximum drawdown, the largest peak-to-trough fractional drop, of the equity curve those returns generate.
returns = [0.10, -0.20, 0.05, -0.30, 0.10]
-> 0.412 # peak 1.10 down to trough 0.6468
Return the maximum drawdown as a fraction, in time and space. Do not materialize the whole equity array.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.