OPEN-SOURCE SCRIPT

KeyLevelsPivots

753
Indicator Name: Key Levels with Pivots

This indicator identifies key support and resistance levels using pivot high and pivot low values derived from TradingView’s built-in functions (ta.pivothigh and ta.pivotlow). When a new pivot is detected, the indicator checks if a similar level—within a specified percentage threshold (for example, ±1%) of the pivot value—already exists. If no such level is present, a horizontal line is drawn at that pivot level.

The drawn level extends to the right, automatically updating until one of two conditions occurs:

A breakout takes place—defined as the price moving beyond the level by the specified percentage—and then the level is fixed (truncated) at the bar where the breakout occurred.

The level reaches a maximum age (expressed in bars, e.g., 750 bars for a daily timeframe which approximates 3 years). In this case, the level is fixed at that maximum age.

Once fixed, the level no longer updates, allowing traders to view historically significant support and resistance levels from today's date up to approximately three years back. Additionally, the indicator prevents the re-plotting of a level if a similar level already exists within the defined percentage threshold, thereby avoiding duplicate reflections of the same level unless a breakout occurs.

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。