Hi,
I am trying to do some back testing of stock prices looking at 52 week highs and lows.
I have the standard Yahoo stock data so with date in column A and close in column G.
I would like to calculate the preceding 52 week high in column H and the 52 week low in column I.
I found a formula that is almost there for the high:
=MAX(INDIRECT("G"&MATCH(A2-365,A:A,0)&":"&"G"&ROW()),0)
But it doesn’t quite work as if A?-365 isn’t a trading day (e.g. weekend) then you get #N/A. I would be happy to use the previous 260 data values (5 days * 52 weeks) as a proxy to calculate the 52 week range.
I have to say I don’t understand how the formula works and swapping MAX to MIN didn’t work to find the 52 week lows!
Any help would be much appreciated. Many thanks in advance…
Bookmarks