Mike,
Thanks for taking time to look into this. Your input seem to confirm
that HighestBar() has a problem, and it's not me doing something wrong.
As for the workaround, here's mine, I think it's more intuitive (that's
subjective, of course):
eq = Foreign("~~~EQUITY", "C");
// DDduration = HighestBars(eq); // This would've worked if not for
HighestBars problem
DDduration = IIf(BarsSince(Highest(eq) == Lowest(eq)) <= 1, 0,
HighestBars(eq)); // workaround
longestDD = LastValue(Highest(DDduration));
BTW, sorry for the stupid question, how do you paste formatted code with
colors etc into your posts?