New 52 week highs and lows

Use the HIGHESTHIGH() and LOWESTLOW() functions to scan for new highs and lows, for example over the last 52 weeks:

HIGH() > HIGHESTHIGH(BARS=52, BACKTYPE=Weeks)

For new closing highs nest CLOSE() in the highest high function:

CLOSE() > HIGHESTHIGH(CLOSE(), BACKTYPE=Weeks, BARS=52)

Similar for lowest lows, this time over 13 weeks:

LOW() < LOWESTLOW(BACKTYPE=Weeks, BARS=13)

Closing lows:

CLOSE() < LOWESTLOW(CLOSE(),BACKTYPE=Weeks, BARS=13)

All-Time Closing Highs:

CLOSE() >= HIGHESTHIGH(CLOSE(),RANGE=All Time)

Indicator Highs and Lows

You can also scan for highest values of any indicator, such as RSI(14) over 13 weeks:

RSI(BARS=14) > HIGHESTHIGH(RSI(BARS=14), BACKTYPE=Weeks, BARS=13)

Highest volume over the last month:

VOL() > HIGHESTHIGH(VOL(), BACKTYPE=Months, BARS=1)

Linking results to a watchlist

If running a scan click on Export Results > Open Results As a watchlist and add columns, charts etc. That watchlist is now linked to the scan, so when the workbook is next opened the scan is run automatically and the list is updated with the latest results.

Capture

To find a high X days ago use the TIMESINCESIGNAL function. So to find a new 52 week high that occurred 2 days ago:

​​V1 = HIGH() > HIGHESTHIGH(RANGE=Look Back Period, BACKTYPE=Weeks, BARS=52);
TIMESINCESIGNAL(V1) == 2

Hi Optuma,

I have the following script that scans for a new 52 week closing high, however I want to exclude ‘rolling 52 week highs’ (i.e. in the attached example, the previous bar was a new 52 week high close, however the current bar is a rolling 52 week high’. Thanks,

 

close()>=HIGHESTHIGH(Close(), BARS=52, BACKTYPE=Weeks, INCBAR=True);

Hi Daniel,

52 week highs will always be on a rolling basis. To change to a specific date change to a Date Range, eg new highs since Jan 1st:

Capture

Is that what you had in mind?