Simple example (only show 5 lines)
bar 0, price = 2, volume = 23
bar 1, price = 4, volume = 3
bar 2, price = 8, volume = 21
bar 3, price = 6, volume = 7
bar 4, price = 9, volume = 13
bar 5, price = 5, volume = 85
bar 6, price = 3, volume = 13
bar 7, price = 1, volume = 4
bar 8, price = 7, volume = 9
Original map: [2:23, 4:3, 8:21, 6:7, 9:13, 5:85, 3:13, 1:4, 7:9]
Copied keys array: [2, 4, 8, 6, 9, 5, 3, 1, 7]
Sorted: [1, 2, 3, 4, 5, 6, 7, 8, 9]
-> 5 keys around last price (7) are fetched (5, 6, 7, 8, 9)
-> keys are placed into new map + volume values from original map
[5:85, 6:7, 7:9, 8:21, 9:13]
Lastly, these values are displayed.