What is the best formula to calculate max drawdown in a set time period? I want to ignore the data before my time period starts.
1 Like
100*(highval(252,0,#high)-lowval(highvalbar(252),0,#low))/highval(252,0,#high) assuming you want 252 days; you can change that number. This gives you the value based on the day's highs and lows.
misread
Noticed that I get lots of NA’s with that formula. Think it necessary to add one minimum bar to the highvalbar to avoid NA’s.
100*(highval(252,0,#high)-lowval(max(highvalbar(252),1),0,#low))/highval(252,0,#high)