Drawdown calculation

Is it possible to calculate max drawdown over a period?

For an individual position in a sim, use PctFromHi. -Debbie

Here’s the formula for the drawdown on each stock, eligible to be used in a screener:

100*(LowVal(100,0,#Low)-HighVal(100,0,#High))/HighVal(100,0,#High)

The 100 is the period that it’s examining in trading days.

To get the time ago in trading days that the high happened in the last 100 trading day period, use this:

HighValBar(100,0)

And the low bar is:

LowValBar(100,0)

Actually, since you have no control on the order of LowVal and HighVal, you have to leverage LoopMin to obtain drawdown.
To demonstrate scanning beyond the 100-bar limit of LoopMin, I split it over two rules.
[font=courier new]ShowVar(@dd1, LoopMin(“LowVal(CTR, 0, #Low) / Hi(CTR)”, 100, 2) - 1)
ShowVar(@dd2, LoopMin(“LowVal(CTR, 100, #Low) / Hi(100 + CTR)”, 100, 2) - 1)[/font]