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

  • rgiu70

    Member
    July 23, 2024 at 4:24 pm

    So it is necessary to:

    1. Map the cumulative (high – low)
    2. If the cumulative (high – low) is greater than the set range, then a new bar is generated, independent of time
    3. When a new bar is generated, the high – low “counter” must reset and start from 0

    Unfortunately, I can’t recreate this logic with scan. In the example I shared, it is very rudimentary but it works. That is, every time the range exceeds the set value, an index number is incremented by 1 (new bar index).