You can plot the levels and display some stats when all-time happened and how far away are we at this moment.
Also, you can create alerts to get notified on ATH / ATL breakout.
Thanks to @Verleiht for helping me with the code.
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Pine Progr: https://qntly.com/pineprog
Adv.Pine Use-Cases: https://qntly.com/advpine
Buy me a beer: https://qntly.com/beer
Access to Pro Indic.: https://qntly.com/proind
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.