Thread: How to code?
View Single Post
  #1047 (permalink)  
Old 06-28-2008, 12:25 AM
luxinterior luxinterior is offline
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
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
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
Reply With Quote