OPEN-SOURCE SCRIPT
Cập nhật Hourly Opening Price

The Inner Circle Trader has noted that the Opening Price of every Hourly candle can be used in a Power Of 3 (PO3) context.
The Power of 3 ICT model also know as "AMD" is a transformative trading strategy, ingeniously designed to streamline your time analyzing charts by focusing on three pivotal phases in market behavior: accumulation, manipulation, and distribution.
The ICT Power of Three Model dissects the market maker’s algorithm for price delivery into three pivotal actions: Accumulation, Manipulation, and Distribution. Accumulation involves smart money gathering positions before a price surge, while manipulation sees the market creating deceptive movements to trigger stops. Finally, distribution occurs as smart money offloads positions, often catching less informed traders off-guard. This strategy is a critical tool for traders to understand market makers’ maneuvers and to strategically position themselves in the market.
This indicator plots a line at the opening price of each hour and extends it on the chart for the duration of the hour. Each hour starts a new line.
You also have the option of extending the midnight opening price line across the entire trading day.
- If Bullish, buy BELOW the hourly open.
- If Bearish, sell ABOVE the hourly open.
The Power of 3 ICT model also know as "AMD" is a transformative trading strategy, ingeniously designed to streamline your time analyzing charts by focusing on three pivotal phases in market behavior: accumulation, manipulation, and distribution.
The ICT Power of Three Model dissects the market maker’s algorithm for price delivery into three pivotal actions: Accumulation, Manipulation, and Distribution. Accumulation involves smart money gathering positions before a price surge, while manipulation sees the market creating deceptive movements to trigger stops. Finally, distribution occurs as smart money offloads positions, often catching less informed traders off-guard. This strategy is a critical tool for traders to understand market makers’ maneuvers and to strategically position themselves in the market.
This indicator plots a line at the opening price of each hour and extends it on the chart for the duration of the hour. Each hour starts a new line.
You also have the option of extending the midnight opening price line across the entire trading day.
Phát hành các Ghi chú
*Added Midnight Price Label option and extended Midnight open line through entire calendar day.Phát hành các Ghi chú
*Minor tweak to labelPhát hành các Ghi chú
*Minor FixPhát hành các Ghi chú
Updated Timezone function to accommodate different exchanges.Phát hành các Ghi chú
Bug FixPhát hành các Ghi chú
** Updated to work on seconds time frame.Phát hành các Ghi chú
Changed behavior of Midnight Open line and label.Phát hành các Ghi chú
Accurate Hourly Range TrackingAdded dedicated arrays for storing historical range data for each hour
Implemented high/low tracking for precise range calculation
Added detection of hour transitions to properly record completed hours
Range Statistics
Added calculation of average ranges based on historical data
Implemented percentage tracking to show how much of average range has been used
Added identification of hours with highest and lowest average ranges
Enhanced Display Options
Created a table display for range statistics
Added formatted range values with appropriate decimal places
Added color coding to highlight the current hour
Phát hành các Ghi chú
Changed table to better reflect actual hourly statistics.Phát hành các Ghi chú
Label fixPhát hành các Ghi chú
Shows actual lookback when it is less than the user defined lookback.Phát hành các Ghi chú
Range calculations rounded to symbol minimum tick value.Phát hành các Ghi chú
Added Average/Median Option: New dropdown to choose between "Average" or "Median" for all range statistics calculations and displaysStatistics now calculate for all hours even when labels are disabled, ensuring the table always shows complete 24-hour data
Phát hành các Ghi chú
Range StatisticsThe indicator tracks the high-low range for each hour over a configurable lookback period (default 10 days) and calculates either the average or median range for each hour. This helps traders understand:
How much movement to expect during specific hours
Which hours tend to have the largest/smallest ranges
What percentage of the typical range has been "used up" in the current hour
Skew Function - Detailed Explanation
The skew function analyzes the distribution of historical range values to determine if the data is balanced or skewed in one direction.
How It Works:
1. Data Collection:
For the current hour, the indicator looks at the last N days (e.g., 10 days) of range data. Using your example:
Data points: 26.75, 35, 42, 45, 48, 55, 62, 95, 150, 242.5
Average (mean): 92.75
Median: 48
2. Distance-Based Calculation:
Instead of simply counting how many values are above vs. below the mean, the skew function calculates the total distance of values from the mean:
Above the mean:
95 is 2.25 away (95 - 92.75)
150 is 57.25 away (150 - 92.75)
242.5 is 149.75 away (242.5 - 92.75)
Total above distance: 209.25
Below the mean:
26.75 is 66 away (92.75 - 26.75)
35 is 57.75 away
42 is 50.75 away
45 is 47.75 away
48 is 44.75 away
55 is 37.75 away
62 is 30.75 away
Total below distance: 335.5
3. Skew Percentage:
The skew is calculated as:
Skew % = ((above_distance - below_distance) / total_distance) × 100
Skew % = ((209.25 - 335.5) / 544.75) × 100 = -23.2%
4. Interpretation:
Positive skew (>threshold%): "↑X% Upward" - A few large values pull the distribution upward (right-skewed). The mean is higher than the median.
Negative skew (>threshold%): "↓X% Downward" - A few small values pull the distribution downward (left-skewed). The mean is lower than the median.
Balanced (<threshold%): The distribution is relatively symmetric around the mean.
The threshold (default 60%) determines how much skew is needed before it's labeled as directional rather than balanced.
Why This Matters:
Understanding skew helps traders know if the typical range for an hour is:
Consistently similar (balanced) - predictable behavior
Occasionally explosive (upward skew) - rare large moves inflate the average
Usually smaller with rare compression (downward skew) - uncommon tight ranges
This context helps set realistic expectations and identify when current price action is behaving normally versus exceptionally for that specific hour.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.