OPEN-SOURCE SCRIPT
Cập nhật Prior day and pre-market high low

This indicator displays the:
- Prior day high
- Prior day low
- Pre-market high
- Pre-market low
as a coloured line across the entire session for each individual session on an intraday chart.
For the extended session, this indicator marks the prior day and pre-market high low for each individual session starting at the pre-market and ending in the post-market, a feature not available on other indicators.
This indicator automatically marks out the levels for the prior day and pre-market high low for each individual session, allowing the user to observe how the price action behaves around the prior day and pre-market high low.
Note:
In this script, request.security() used with lookahead = barmerge.lookahead_on to fetch prices without offsetting the series by [1] for the extended session does not access future data. This is because for extended session, request.security() sees the start of the session to be at the start of the regular session and ends at the end of the pre-market, when in reality the session starts at the start of the pre-market and ends at the end of the post-market.
Hence in each extended session when the line is first drawn in the pre-market, request.security() returns the value of the prior day high/low, and not future data.
- Prior day high
- Prior day low
- Pre-market high
- Pre-market low
as a coloured line across the entire session for each individual session on an intraday chart.
For the extended session, this indicator marks the prior day and pre-market high low for each individual session starting at the pre-market and ending in the post-market, a feature not available on other indicators.
This indicator automatically marks out the levels for the prior day and pre-market high low for each individual session, allowing the user to observe how the price action behaves around the prior day and pre-market high low.
Note:
In this script, request.security() used with lookahead = barmerge.lookahead_on to fetch prices without offsetting the series by [1] for the extended session does not access future data. This is because for extended session, request.security() sees the start of the session to be at the start of the regular session and ends at the end of the pre-market, when in reality the session starts at the start of the pre-market and ends at the end of the post-market.
Hence in each extended session when the line is first drawn in the pre-market, request.security() returns the value of the prior day high/low, and not future data.
Phát hành các Ghi chú
Added individual line style (solid, dotted, dashed etc.) setting for prior day high, prior day low, pre-market high, and pre-market low price levels. This allows users to use different line styles for different price levels, such as having solid lines for prior day highs and lows, and having dotted lines for pre-market highs and lows.
In the previous version all 4 price levels use the same line style base on the user's selection.
Phát hành các Ghi chú
Added the option to show the most recent price level value on the price axis to allow users to be able to see the value of the price level at a glance.Added the option to toggle the display for each individual price level and price axis label.
Included additional options to customise each individual line colour, thickness, and style.
Changed the colour for prior day low from red to magenta so that it does not clash with the default red used in the charts.
Phát hành các Ghi chú
Added the option to customise the visibility of the value on the price axis according to the timeframe.Phát hành các Ghi chú
Added the option to customise the appearance of the price level to display one of the following:* Individual level for each day
* Most recent level on most recent day
* Most recent level across the chart
Phát hành các Ghi chú
Added option to allow users to create an alert for price crossing/closing above the pre-market high or below the pre-market low.Note that users will need to manually create the alert by doing the following:
1. Select their desired security and timeframe on the chart
2. Go to the Create Alert dialog
3. Under Condition, in the first drop-down, navigate to this indicator. In the second drop-down, select the desired alert
4. Under Trigger, if users would like to have the alert on bar close, select "Once Per Bar Close". Else if users would like to have the alert once condition is triggered, do not select "Once Per Bar Close".
5. Set Expiration, Alert name, and Message as desired
Phát hành các Ghi chú
Added a "No alert period" option for users to indicate a time period where they do not want alerts to trigger.Phát hành các Ghi chú
Added options to display price levels for prior day open, prior day close, current day open.Phát hành các Ghi chú
Added price level option for prior day’s after-hour high and lowAdded an option to display labels for price levels
Phát hành các Ghi chú
Edit: typoPhát hành các Ghi chú
Updated script to more accurately reflect prior day OHLC and current open, specifically to account for prices that the chart does not consider as regular session prices when viewing Extended Trading Hours, e.g. prices between 0930-0959 on the 1 hour timeframe.However, this limitation still applies to pre-market high and low. E.g. on the 1 hour timeframe, if the ticker reaches a new high between 0930-0959, pre-market high value will reflect this high.
Phát hành các Ghi chú
Added a setting to adjust the label offset from last bar for each price level to address the issue of labels overlapping.Added an option to include the price within the label text.
Phát hành các Ghi chú
Added price levels for:- Current day high
- Current day low
- First bar high
- First bar low
Phát hành các Ghi chú
Fixed the issue where current high and current low are not updating during regular market session.Phát hành các Ghi chú
Hide chart arguments to prevent it from appearing across the chart.Phát hành các Ghi chú
Included price levels for:- Prior week high
- Prior week low
- Current week high
- Current week low
Phát hành các Ghi chú
Increased the maximum number of lines that can be shown on the chart.Phát hành các Ghi chú
Included price levels for:- Prior week close
- Current week open
Phát hành các Ghi chú
Added:- All-time high price level
- Label font size setting
Phát hành các Ghi chú
Optimised indicator by:- Minimizing `request.*()` calls
- Reducing redrawing
Phát hành các Ghi chú
Fixed a bug where unchecking the "display price in label" checkbox did not hide the prices in the label.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.