Hi, We managed to work out how to calculate 52 week highs from daily stock market data. However we also need to work out how many days since the last 52 week high. Our data looks like this. It is 9m records so a little computationally intensive. 1168 21NOV2005 9.12 9.35 1168 22NOV2005 9.09 9.35 1168 23NOV2005 9.07 9.35 1168 24NOV2005 9.32 9.35 1168 25NOV2005 9.32 9.35 1168 28NOV2005 9.56 9.56 1168 29NOV2005 9.71 9.71 1168 30NOV2005 9.72 9.72 1168 01DEC2005 9.61 9.72 1168 02DEC2005 9.61 9.72 1168 05DEC2005 9.61 9.72 1168 06DEC2005 9.71 9.72 1168 07DEC2005 9.92 9.92 1168 08DEC2005 9.74 9.92 1168 09DEC2005 9.68 9.92 1168 12DEC2005 9.62 9.92 For example, on 6th December, the days since the last 52 week high would be 4. We need this for every date. Note that there will also been days with missing data i.e. no trade occurred. Many thanks for any assistance or direction!
... View more