All time weekly closing high script in watchlist

Hi,

I have a watchlist with 2 columns. I am asking 2 things. Did the week make an all time high? Did the week make an all time closing high? My script for the weekly all time high works properly, but my script for the weekly all time closing high does not. I have made sure the watchlist date range is set to everything. I have the timeframe set to week in all the parts of the script, so changing the timeframe to week in the watchlist properties does not help, and with the HighestHigh function I have tried the include current bar checkbox as well. Please let me know where I have gone wrong with the 2nd script looking for a weekly all time closing high. Here are the scripts:

HIGH(Week(PERIODAMOUNT=1)) >= HIGHESTHIGH(Week(PERIODAMOUNT=1), RANGE=All Time)
CLOSE(Week(PERIODAMOUNT=1)) >= HIGHESTHIGH(CLOSE(), Week(PERIODAMOUNT=1), RANGE=All Time)

I have attached the work book if that makes it easier. You can open it and look at the XLP tab to see price has made a weekly all time closing high this last candle, but it shows false in the watchlist, on last tab, in the column ATCH? which has the 2nd script from above.

thank you
Louis

SectorInspector.owb (61.8 KB)

Hi Louis,

As all the columns in your watchlist are using weekly data it would be best to not use the timeframe in the formulas (leave them as default) and just change the watchlist timeframe to weekly.

However, the issue in your formula is that the Week component needs to be nested in the CLOSE() function, otherwise the daily close will be used when the watchlist timeframe is set to daily (it will work if set to weekly).

CLOSE(Week(PERIODAMOUNT=1)) >= HIGHESTHIGH(CLOSE(Week(PERIODAMOUNT=1)), RANGE=All Time)