Home › Forums › kdb+ › Range Bar in kdb › Reply To: Range Bar in kdb
-
<div>It seems to me, you need to break when the range is met.</div>
f:{1+1_first -2#{x,last where z=abs y[last x] - y}[;x;y]\ [{0<=last deltas -2#x};0]}
where (1+til count c)!c:deltas f[lastPrice;rangeTarget]
1 1 1 1 2 2 2 3 3 3 4 4 4