All Time High (ATH) Levels

All Time High (ATH) Levels

All-Time Highs (ATH) represent significant psychological barriers in financial markets. They act as “ceilings” where price discovery occurs, often triggering breakouts or strong rejections.

The ATH Levels indicator (by LuxAlgo) automates the detection of these historical peaks. Unlike a simple “Max Price” line, this tool identifies a sequence of significant historical highs and projects them forward, classifying them as dynamic Support or Resistance levels based on subsequent price action.

How it Works

This indicator scans the entire loaded history of an asset to identify every instance where a new All-Time High was established. However, simply plotting every single high would clutter the chart. To solve this, the indicator employs a smart filtering and classification system:

ATH Detection & Filtering:

The indicator tracks the global maximum price. It uses an ATR (Average True Range) filter to ensure that only distinct, significant levels are displayed. If a new ATH is too close to a previous one (based on the distMult setting), it is merged or ignored to keep the chart clean.

Dynamic Support/Resistance (S/R) Classification:

  • The indicator calculates how price interacts with each level after it was created.

  • Support (Bullish – Teal): If the price spends significant time above an old ATH level, that level is considered valid Support.

  • Resistance (Bearish – Red): If the price remains below an old ATH level, it acts as Resistance.

  • Visual Gradient: The lines change color dynamically. The solid lines are drawn from the historical point of the ATH extending to the right of the current price, making it easy to identify relevant levels for the current trading session.

Note: This indicator uses DEFPARAM DrawOnLastBarOnly = True. This means it is optimized for market analysis and chart reading, drawing the lines only on the most recent update to ensure fast performance.

Settings & Configuration

You can customize the sensitivity and visual style of the indicator by modifying the variables at the beginning of the code:

  • showLast (Default: 50): Determines the maximum number of historical ATH lines to display on the chart. Reducing this number improves performance on charts with massive amounts of data.

  • duration (Default: 3): The minimum duration (in bars) required to confirm a new ATH level. Higher values filter out “noise” spikes.

  • distMult (Default: 3.0): This is the ATR Multiplier. It dictates the minimum vertical distance required between two ATH levels for them to be displayed separately.

    • Increase this value to see fewer, more significant levels.

    • Decrease this value to see more granular levels.

  • showClassification (Default: 1): Set to 1 to display text labels ([S] for Support, [R] for Resistance) and the price level. Set to 0 to hide text.

  • minSr (Default: 0): A filter for the strength of the Support/Resistance. Increasing this value will hide levels that are “neutral” (where price oscillates around the line without clear direction), showing only strong S/R levels.

The Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or
Related users ' posts
Ciccarelli Franco Che cosa sono quei numeri a destra di Sell power e Buy power?
Iván d) Buy vs. Sell Power Over the last length candles, the script counts: Buy Power: ba...
Sofitech Hello Ivan is it possible to have an histogram version giving +1 when you have a green arrow...
Iván Provi a copiare e incollare il codice qui sopra. Che errore le dà?
Ciccarelli Franco Esattamente quanto scritto sopra
Ciccarelli Franco Ho provato a copiare ed incollare e funziona. Grazie
roccafragius Hi Ivan sorry another question, in order to create a bot that open the trade, I'm tryng to c...
roccafragius ////////////////////////////////////////// 0825-liquidity-test //--------------------------...
freddy382 Hello Ivan, I tested the indicator, which is great, but I only get the volume display for Bi...
Iván no it wasn't
xpe74 could be interesting to do so as visually it works well ....
xpe74 Hi ivan, still working on your indicator. Is there a way (as i'm not a coder) to integrate i...
geroniman merci Ivan, super indicatuer. Les cours vont souvent toucher 50% des zones vertes ou rouges....
Iván Pour ajouter une ligne supplémentaire, il suffit de créer une nouvelle variable, par exemple...
Maurizio A. excellent indicateur ! comment puis-je modifier le code pour afficher uniquement les dernier...
sanchota Mira que has hecho unos cuantos indicadores,pues este los supera a todos.Brillante.
Regisnew Bonjour Ivan serait il possible de proposer un screener pour détecter les zones de support v...
bembel242 Hello Ivan ! A belated HNY ! I know late ! Quick question on theis great indicator plse. I u...
gp38super Wow! This is GOLD! Great job!
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
skfomx I have a thread in pro screener support where I describe some problems with the creation of ...
fazel53 How do i attach this indicator to my mt5 platform?
Nicolas You can't! All indicators here are for ProRealTime trading platform: https://www.prorealtime...
mistersylv What parameter should we change to make another channel appear in the higher or lower time u...
carpentier Joffrey Bonjour à tous, Avant tout merci pour ce travail, cependant je suis bloqué quand je l'insta...
carpentier Joffrey Re, C'est ok, j'ai trouvé mon erreur... Cependant sur quel base peut on calculer son CALC...
Aragorna Hi Nicolas, How is it possible to use it in a higher timeframe plotted on a lower timeframe?...
thierrybl Thanks a lot
B-ling1 Hi Vonasi, I love this indicator - good job! Just one question: If I want the monthly OHLC L...
ezman Copy and paste this code, don't work. error!
datageek How do I change the thickness of the line or change it too dashed lines? Kind regards
lkiklkik NE fonctionne pas ( ou plus ... )
Nicolas il faut modifier toutes les références à top par itop et bottom par ibottom. Ces mots étant ...
Vonasi There is another version of this indicator that can plot the same lines but onto an indicato...
Martin35 Hello Vonasi, do you think it is possible with PRT to code with the same principle as on thi...
mathiasKN Steffen Schmauch • 12/11/2018 # hello Nicolas, can I change the indicator that I only get t...
Nicolas Please open a new topic in the indicator forum and explain there your query, thank you.
upupandaway This seems like a very useful indicator. However, it does not seem to open properly in the c...

Top