_Merch_Man_
Active member
Evening all! I am trying to write ThinkScript that gives me the maximum down day volume in the last X days. If there are no down days in the last X days then the result would be 0. Pseudo code below. Is this possible in ThinkScript? TIA!
Code:
maxDownVol=0;
x = 10;
while x > 0
if (close[x+1] > close[x]) && (volume[x] > maxDownVol) then maxDownVol = volume[x];
x = x-1
done
Last edited: