I'm looking to use GoogleSheets to display ticker symbols and prices in real-time of stocks that have created new 26-week highs, i.e. today's highest trading price is greater than any trading price during the last 26-week period.
I think GoogleSheets's native GOOGLEFINANCE function allows this to be done for a 52-week trailing period (e.g. a formula comparing attributes "high52" against current day's "high"). The GOOGLEFINANCE function doesn't have an attribute for a 26-week period.
Does anyone have a script or template of one I can apply to retrieve a stock's highest traded price over a trailing 26-week period?
Best Answer
I'll describe the process in stages. Here is a command that returns a table with high price on every day within the last 26 weeks:
Output:
Since you only want the maximum of these numbers, let's add a
QUERY
selecting the maximum of the second column:Output:
This may be already good enough for your purposes. If you want to get rid of the column header "max High", end the query string with
label max(Col2) ''
:Output: