Hello
Say we have a table like the following, with hundreds of symbols:
SYMBOL DATE OPEN HIGH LOW CLOSE VOLUME ALLTIMEMAX BIDU 03-01-2012 $120.00 $125.14 $120.00 $124.29 7311200
BIDU 04-01-2012 $122.75 $123.60 $121.15 $121.99 4398200
BIDU 05-01-2012 $121.10 $124.00 $120.68 $123.27 4772700
BIDU 06-01-2012 $123.72 $124.11 $120.00 $121.09 4978100
BIDU 09-01-2012 $122.97 $122.97 $117.17 $120.11 5594500
BIDU 10-01-2012 $124.21 $127.30 $124.00 $126.88 6929000
BIDU 11-01-2012 $126.47 $128.59 $125.53 $128.19 5328900
and we need to add the ALLTIMEMAX column. This is the MAX CLOSE price for the symbol on SYMBOL till the date on DATE.
How can we solve this efficiently?
I think that if we can take the first CLOSE for each symbol, then for the following date we´d just need to check if the new CLOSE is bigger than the previous. If it is, use it and if not, just keep the old one.
Could that be possible? How would it be?
I´d appreciate any help that you can provide.