All Time High (ATH) Levels [LuxAlgo]The All Time High (ATH) Levels indicator displays a user-set amount of historical all-time high levels made on the user's chart, highlighting potential key price levels.
Displayed levels can be filtered out based on their duration, as well as their relative distance from each other.
The script also evaluates the role a level might have as a support or resistance using a percentage, classifying ATH levels as either support or resistance depending on the result.
🔶 USAGE
On certain assets market participants give a high level of attention to all-time highs made by an asset, with the most pertinent example being Bitcoin.
Previous all-time highs can play important roles as psychological price levels, with the most recent ones often offering major resistance points, and older ones being used as support.
Users can filter out temporary ATHs using the ATH Minimum Duration setting, removing any ATH that lasts less than the user-specified number of bars. Higher values of this setting effectively preserve ATHs that become distinguishable peaks. These can offer more significant support/resistance levels.
When displaying each historical level some of them can be very close to each other. Users can use the "Minimum Distance Between ATH" setting to filter out levels too close to each other, with higher values of this setting returning more spaced levels. Distances are first evaluated from the most recent ATH. Note that this setting can cause repainting.
🔹 SR Classification
The script evaluates the ability of an ATH level to act as a support or resistance since its occurrence, and measures its strength as a percentage, with higher percentage values suggesting a stronger support or resistance.
Levels classified with "R" suggest that the price was located below the level most of the time, indicative of a resistance, while a level classified with "S" suggests that the price was located above the level most of the time, indicative of a support.
Percentages between 99% to 50% are often indicative of supports/resistances being tested, while values below 50% reflect more centered levels. A value of 100% suggests that an ATH level was not tested enough. users can filter out any level with a percentage below the "Minimum %" setting.
🔶 SETTINGS
Show Last ATH: Specify the amount of most recent ATH's to display.
ATH Minimum Duration: Minimum duration (in bars) of an ATH, that is the minimum number of bars that must elapse before another ATH can be made.
Minimum Distance Between ATH: Minimum distance between displayed ATH levels, starting from the most recent ATH. This distance is a multiple of the average true range.
🔹 SR Classification
Show SR%: Show percentage as well as ATH level classification.
Minimum %: Minimum percentage values required to display an ATH level.
Supportresistancelevels
HT: Intraday LevelsIndicator draws several most important intraday levels: last day RTH high/low, ETH high/low, Half Back, Day Close and current day RTH Day Open. These levels often act as support/resistance for intraday price movements. Also, they can help to assess day character and control of power.
Indicator can be used for ETH + RTH sessions.
Important notes:
• User must specify RTH session time, appropriate for his time zone and exchange
• Half-back is calculated as a middle line between RTH High and Low.
• Day Close is always equal to close of the last bar of the previous day
• RTH Day Open will be redrawn for the current day as soon as it is known (after RTH session opens and at least one bar gets confirmed).
Known issues:
• Day open will not be shown if there is no bar, clearly corresponding to RTH open time (e.g. if 4h timeframe is selected)
• For some ETH sessions it is not possible to determine session’s last bar (this is pine script limitation) until next day trading starts. This means that daily levels will be also update with only then.
Parameters:
Date – user can select date, for which levels will be plotted. Works only if “Use” check box is on. Otherwise, levels will be plotted for the last day. (“time” value doesn’t matter; unfortunately, there is no way to hide the input box)
RTH Open/Close time – it is important to specify time, appropriate for your time zone.
Time zone – your chart time zone (as UTC offset)
Visuals – controls visibility and colors
Script is published as an open source. It uses two libraries: Levels Lib and Functions Lib. First one demonstrates how to work with pine-script object model and arrays. You can also reuse it in your custom scripts where there is need to construct any support/resistance levels. The second library contains some useful functions for working with time and dates.
Disclaimer
This indicator should not be used as a standalone tool to make trading decisions but only in conjunction with other technical analysis methods.