the simplest way is at each time, look back the full history and compute the max drawdown, then the result is the max of those max drawdown
Anonymous
Nov 24, 2016
It is fairly simple :
a. initialise temp_max_DD=max_DD=previous_max_DD=0;
b. loop through the values of your array starting at the second one :
if the current value in the array is higher than the previous one then temp_max_DD =temp_max_DD - (current_value - previous_value) else temp_max_DD=0
if temp_max_DD