Today is Tuesday, so looking at weekly price bars the previous bar is the last full week of data. I want to know if last week’s price bar printed a 13-week closing high using a watchlist.
To know if the current bar is a 13-week closing high we can use the script:
CLOSE() >= HIGHESTHIGH(BARS=13)
I want to know about the last bar though, so I tried using the offset function thinking “is the previous bar >= to the 13-week closing high as of the previous bar”:
This does not work. I tried a bunch of other scripts as well. Please let me know the best script to ask if the previous bar’s close was a 13-week closing high when it closed. Thank you.
Hi Darren. Thank you. This works perfectly when I use the 13-bar range. I don’t know how to apply this when the range is All Time.
The attached chart shows weekly bars and a watchlist for the ticker ULTA. The current bar is the week in progress and printing an all-time closing higher. I can identify this using the script:
The Range = All-Time high is just a single price, so there’s no history. To get the all-time high as at a point in time (ie the previous week) use Range =All History: