KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Range Bar in kdb Reply To: Range Bar in kdb

  • sujoy

    Member
    July 27, 2024 at 6:25 am

    <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