MQL4 folmula to calculate max drawdoan in x bars

 
Does anyone know how to calculate the max draw down on a pair at a given bars e.g 100 bars?  
Reason: