is there a way filter the fold loop to leave out the greatest "m" values of the 1 to n set of "ret" values. ie add an m input where if m=1, leave out the one largest value when averaging the sum of the "ret" variables (divide the sum by n-m). Thanks in advance.
Code:
declare lower;
input n = 30;
def ret=absValue(close/close[1]-1);
plot mad = fold i = 0 to n
with s = 0
do s + GetValue(ret, i, n) / n;