In my previous post, I wrote "each int is a sequence number of the bar input." I was mistaken, and each input bar can have multiple sequence numbers (see pseudocode below).
In this pseudocode for adding a bar with high and low price to the histogram,
incremented and decremented actions are...