Merrilee, I'm sorry to hear that there was no success for you. That was intriguing so I tested the script because I most certainly do not want to be giving you bogus advice. I used a daily chart of the World Indices SPY (S&P 500 Stock Index) for testing. (Just use F2 and type SPY to open up its chart).
I found a date for SPY where the close was higher than the previous all-time high, and that occurred on 26 January 2018. Inspection of the chart around that time indicated that:
- 26 January 2018: today's close was higher than the previous all-time high
- 25 January 2018: today's close was not higher than the previous all-time high
- 24 January 2018: today's close was not higher than the previous all-time high
- 23 January 2018: today's close was higher than the previous all-time high
- 22 January 2018: today's close was higher than the previous all-time high
So now we have five data points to test the script against. The script used was as follows:
previousHighestHigh = HIGHESTHIGH(RANGE=All History, HIGH());
isCloseHigherThanPreviousHighestHigh = CLOSE(0) > previousHighestHigh[1];
isCloseHigherThanPreviousHighestHigh
(I apologise that I did not include the third line of the script in my original reply ... the script editor should give an error without that third line because it needs to output something. I've included it for completeness this time around).
The script was assigned to the Show Bar tool, which used green down arrows to signal that the script returned a TRUE result. So we should see a green down arrow on 26, 23, 22 January but not 25 and 24 January.
The screen shot attached agrees with our expectation, so the script does seem to be achieving the desired outcome of determining if today's close is higher than the previous all-time high.
Incidentally, the script can be distilled down to one line without variables as follows:
CLOSE(0) > HIGHESTHIGH(RANGE=All History, HIGH())[1];
This version of the script gives the same result.
One last thing that I found interesting, but you could ignore if you want. The HIGHESTHIGH function has a parameter called "Include Current Bar" which can be set to INCBAR=True or INCBAR=False. As follows:
CLOSE(0) > HIGHESTHIGH(RANGE=All History, INCBAR=False, HIGH());
I thought that that might be even the best way to achieve the desired outcome because the HIGHESTHIGH function would not include the current bar, essentially imitating the first two scripts. Unfortunately though, the script failed... and I'm not sure why.
My recommendation then is to use one of the first two scripts.
I really do hope that this gives you what you need.