|
You could use an array then load it up with values. Then do a simple sort to move the highest value to the top. Then do the same for the lowest.
For example you'd compare item 2 to item 1. If 2 is higher put it in item 1. Then compare 3 to 1 and repeat to the end of the array.
You'd just do the initial loading of the array in the init() function then with every new bar just compare the value to item 1 of the array.
Hope that helps
Lux
|