Home › Forums › kdb+ › Range Bar in kdb › Reply To: Range Bar in kdb
-
So it is necessary to:
- Map the cumulative (high – low)
- If the cumulative (high – low) is greater than the set range, then a new bar is generated, independent of time
- 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).