Historical & Periodic Key Levels

Key Levels Displayed ๐:
* All-Time High (ATH) ๐ผ: The highest price reached in the available history for the instrument.
* All-Time Low (ATL) ๐ฝ: The lowest price reached in the available history for the instrument.
* Previous Daily Close D: The closing price of the previous trading day.
* Previous Weekly Close W: The closing price of the previous trading week.
* Previous Monthly Close M: The closing price of the previous trading month.
* Previous Yearly Close Y: The closing price of the previous trading year.
Features โจ:
* Clear Visualization ๐๏ธ: Levels are plotted as horizontal lines, extending to the most recent bar.
* Customizable Visibility ๐ถ๏ธ: Toggle the display of each key level type (ATH, ATL, Daily, Weekly, Monthly, Yearly closes) individually via the input settings.
* Customizable Colors ๐จ: Set distinct colors for ATH, ATL, and each of the periodic close lines to suit your charting preferences.
* Adjustable Line Width โ: Control the thickness of the ATH/ATL lines and the periodic close lines separately.
* Informative Labels ๐ท๏ธ: On the most recent bar, labels display the value and type of each active level (e.g., "ATH - 01/01/23", "D Close"). The ATH/ATL labels also include the date the level was established.
* Dynamic Updates ๐: ATH and ATL levels update automatically if new highs or lows are made.
How to Use ๐ ๏ธ:
1. Add the "Key Levels" indicator to your TradingView chart.
2. In the indicator settings, customize which levels you want to see (ATH, ATL, Daily Close, etc.).
3. Adjust the colors and line widths for optimal visibility on your chart setup.
4. Use the plotted lines as potential reference points for support, resistance, and overall market context.
This indicator is useful for traders who employ key historical and periodic price levels in their technical analysis strategy. It helps in quickly identifying significant price points without manual plotting.
Created by YouNesta โ๏ธ
Key Levels Displayed ๐:
* All-Time High (ATH) ๐ผ: The highest price reached in the available history for the instrument.
* All-Time Low (ATL) ๐ฝ: The lowest price reached in the available history for the instrument.
* Previous Daily Close D: The closing price of the previous trading day.
* Previous Weekly Close W: The closing price of the previous trading week.
* Previous Monthly Close M: The closing price of the previous trading month.
* Previous Yearly Close Y: The closing price of the previous trading year.
Features โจ:
* Clear Visualization ๐๏ธ: Levels are plotted as horizontal lines, extending to the most recent bar.
* Customizable Visibility ๐ถ๏ธ: Toggle the display of each key level type (ATH, ATL, Daily, Weekly, Monthly, Yearly closes) individually via the input settings.
* Customizable Colors ๐จ: Set distinct colors for ATH, ATL, and each of the periodic close lines to suit your charting preferences.
* Adjustable Line Width โ: Control the thickness of the ATH/ATL lines and the periodic close lines separately.
* Informative Labels ๐ท๏ธ: On the most recent bar, labels display the value and type of each active level (e.g., "ATH - 01/01/23", "D Close"). The ATH/ATL labels also include the date the level was established.
* Dynamic Updates ๐: ATH and ATL levels update automatically if new highs or lows are made.
How to Use ๐ ๏ธ:
1. Add the "Key Levels" indicator to your TradingView chart.
2. In the indicator settings, customize which levels you want to see (ATH, ATL, Daily Close, etc.).
3. Adjust the colors and line widths for optimal visibility on your chart setup.
4. Use the plotted lines as potential reference points for support, resistance, and overall market context.
This indicator is useful for traders who employ key historical and periodic price levels in their technical analysis strategy. It helps in quickly identifying significant price points without manual plotting.
Created by YouNesta โ๏ธ (Sol :4Qg3RJ3SqC3A5igRWo5u7qMBb8t8YqhcrguUVoS15cou)
* **Advanced Label Customization:**
* **Customizable Label Text:** Users can now define custom text for All-Time High (ATH), All-Time Low (ATL), and all periodic close labels (Daily, Weekly, Monthly, Yearly) via the "Style" tab.
* **Customizable Label Position:** Added options in the "Style" tab to control the position (style) and text alignment of ATH/ATL labels and periodic close labels independently.
* **Dynamic Coloring for Periodic Closes:**
* Periodic close lines and their corresponding labels now dynamically change color to indicate whether the previous period's close was positive (close > open), negative (close < open), or neutral (close == open).
* Dedicated color inputs for "Positive" and "Negative" states for each periodic level (Daily, Weekly, Monthly, Yearly) are available in the "Style" tab.
* **Enhanced Default Color Scheme:**
* Periodic close levels now feature a default color scheme that progresses from lighter to darker shades based on the timeframe (Daily being the lightest, Yearly the darkest). This applies to base, positive, and negative color states.
* **Timeframe-Aware Level Display:**
* Periodic levels (lines and labels) are now automatically hidden if the chart's current timeframe matches the period of the level. For example, the "Daily Close" level will not be displayed when the chart is set to a daily timeframe, "Weekly Close" will be hidden on a weekly chart, and so forth for Monthly and Yearly levels. This reduces clutter on higher timeframe charts.
* **Improved Settings Organization:**
* Indicator settings have been reorganized into two main tabs:
* **Inputs:** Contains toggles for the visibility of each level (ATH, ATL, Daily, Weekly, Monthly, Yearly closes).
* **Style:** Consolidates all visual customization options, including line colors, line widths, label texts, label position settings, and the new positive/negative state colors for periodic closes.
**Technical Updates:**
* Resolved an issue with color definitions by switching from `color.from_hex` to `color.rgb` for broader compatibility.
* Label management functions were refactored to correctly apply changes to label style and text alignment by recreating labels when settings are modified.
Changelog:
- Input Parameter Grouping: Reorganized input parameters into more descriptive and granular groups for improved user experience in the indicator settings.
Affected inputs: All style and visibility inputs.
Relevant functions: input.bool, input.color, input.string, input.int.
Consolidated all "Periodic Levels" styling options (base colors, trend colors, common line/label styles) under a single input group: Periodic Levels Style.
New group variable: group_periodic_style.
Removed group variables: group_periodic_base, group_periodic_trend, group_periodic_common.
- Base Color Functionality Removed:
- Eliminated the separate input options for "base" colors (e.g.,
, Pine Scriptยฎcolor_daily_close, Pine Scriptยฎcolor_weekly_close, Pine Scriptยฎcolor_monthly_close). Pine Scriptยฎcolor_yearly_close
Removed inputs: color_daily_close, color_weekly_close, color_monthly_close, color_yearly_close.
- Modified the
function: Pine Scriptยฎf_get_periodic_color
Removed the base_color parameter from the function signature.
Logic changed: If a periodic level's closing price is equal to its opening price, the line will now use the corresponding positive_color instead of a distinct base color.
- Updated all internal calls to
(for Pine Scriptยฎf_get_periodic_color, Pine Scriptยฎdaily_plot_color, Pine Scriptยฎweekly_plot_color, Pine Scriptยฎmonthly_plot_color) to remove the base color argument. Pine Scriptยฎyearly_plot_color
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.