The Weekly High/Low Day Breakdown indicator provides a detailed statistical analysis of the days of the week (Monday to Sunday) on which weekly highs and lows occur for a given timeframe. It helps traders identify recurring patterns, correlations, and tendencies in price behavior across different days of the week. This can assist in planning trading strategies by leveraging day-specific patterns.
The indicator visually displays the statistical distribution of weekly highs and lows in an easy-to-read tabular format on your chart. Users can customize how the data is displayed, including whether the table is horizontal or vertical, the size of the text, and the position of the table on the chart.
Key Features:
Weekly Highs and Lows Identification:
Tracks the highest and lowest price of each trading week.
Records the day of the week on which these events occur.
Customizable Table Layout:
Option to display the table horizontally or vertically.
Text size can be adjusted (Small, Normal, or Large).
Table position is customizable (top-right, top-left, bottom-right, or bottom-left of the chart).
Flexible Value Representation:
Allows the display of values as percentages or as occurrences.
Default setting is occurrences, but users can toggle to percentages as needed.
Day-Specific Display:
Option to hide Saturday or Sunday if these days are not relevant to your trading strategy.
Visible Date Range:
Users can define a start and end date for the analysis, focusing the results on a specific period of interest.
User-Friendly Interface:
The table dynamically updates based on the selected timeframe and visibility of the chart, ensuring the displayed data is always relevant to the current context.
Adaptable to Custom Needs:
Includes all-day names from Monday to Sunday, but allows for specific days to be excluded based on the user’s preferences.
Indicator Logic:
Data Collection:
The indicator collects daily high, low, day of the week, and time data from the selected ticker using the request.security() function with a daily timeframe ('D').
Weekly Tracking:
Tracks the start and end times of each week.
During each week, it monitors the highest and lowest prices and the days they occurred.
Weekly Closure:
When a week ends (detected by Sunday’s daily candle), the indicator:
Updates the statistics for the respective days of the week where the weekly high and low occurred.
Resets tracking variables for the next week.
Visible Range Filter:
Only processes data for weeks that fall within the visible range of the chart, ensuring the table reflects only the visible portion of the chart.
Statistical Calculations:
Counts the number of weekly highs and lows for each day.
Calculates percentages relative to the total number of weeks in the visible range.
Dynamic Table Display:
Depending on user preferences, displays the data either horizontally or vertically.
Formats the table with proper alignment, colors, and text sizes for easy readability.
Custom Value Representation:
If set to "percentages," displays the percentage of weeks a high/low occurred on each day.
If set to "occurrences," displays the raw count of weekly highs/lows for each day.
Input Parameters:
High Text Color:
Color for the text in the "Weekly High" row or column.
Low Text Color:
Color for the text in the "Weekly Low" row or column.
High Background Color:
Background color for the "Weekly High" row or column.
Low Background Color:
Background color for the "Weekly Low" row or column.
Table Background Color:
General background color for the table.
Hide Saturday:
Option to exclude Saturday from the analysis and table.
Hide Sunday:
Option to exclude Sunday from the analysis and table.
Values Format:
Dropdown menu to select "percentages" or "occurrences."
Default value: "occurrences."
Table Position:
Dropdown menu to select the table position on the chart: "top_right," "top_left," "bottom_right," "bottom_left."
Default value: "top_right."
Text Size:
Dropdown menu to select text size: "Small," "Normal," "Large."
Default value: "Normal."
Vertical Table Format:
Checkbox to toggle the table layout:
Checked: Table displays days vertically, with Monday at the top.
Unchecked: Table displays days horizontally.
Start Date:
Allows users to specify the starting date for the analysis.
End Date:
Allows users to specify the ending date for the analysis.
Use Cases:
Day-Specific Pattern Recognition:
Identify if specific days, such as Monday or Friday, are more likely to form weekly highs or lows.
Seasonal Analysis:
Use the start and end date filters to analyze patterns during specific trading seasons.
Strategy Development:
Plan day-based entry and exit strategies by identifying recurring patterns in weekly highs/lows.
Historical Review:
Study historical data to understand how market behavior has changed over time.
TradingView TOS Compliance Notes:
Originality:
This script is uniquely designed to provide day-based statistics for weekly highs and lows, which is not a common feature in other publicly available indicators.
Usefulness:
Offers practical insights for traders interested in understanding day-specific price behavior.
Detailed Description:
Fully explains the purpose, features, logic, input settings, and use cases of the indicator.
Includes clear and concise details on how each input works.
Clear Input Descriptions:
All input parameters are clearly named and explained in the script and this description.
No Redundant Functionality:
Focused specifically on tracking weekly highs and lows, ensuring the indicator serves a distinct purpose without unnecessary features.