OPEN-SOURCE SCRIPT
已更新 ORB Breakouts with alerts

"ORB Breakouts with Alerts" is a utility indicator that highlights an Opening Range Breakout (ORB) setup during a user-defined intraday time window. It allows traders to visualize price consolidation ranges and receive alerts when price breaks above or below the session high/low.
🔧 Features:
*Customizable session time (start and end), adjustable to local time using a timezone offset.
*Automatically plots:
*A shaded box around the session's high and low.
*Horizontal lines at session high and low levels.
*Optional "BUY"/"SELL" labels to mark breakout directions.
*Visual breakout signals when price crosses above or below the session range.
*Built-in alerts to notify when breakouts occur.
*Configurable styling options including box color, highlight color, and label placement.
⚙️ How It Works:
*During the defined time range, the script tracks the highest high and lowest low.
*After the session ends:
*A box is drawn to represent the opening range.
*Breakouts above the high or below the low trigger visual markers and optional alerts.
*Alerts are limited to one per direction per day to reduce noise.
⚠️ This indicator is a technical analysis tool only and does not provide financial advice or trade recommendations. Always use with proper risk management and in conjunction with your trading plan.
🔧 Features:
*Customizable session time (start and end), adjustable to local time using a timezone offset.
*Automatically plots:
*A shaded box around the session's high and low.
*Horizontal lines at session high and low levels.
*Optional "BUY"/"SELL" labels to mark breakout directions.
*Visual breakout signals when price crosses above or below the session range.
*Built-in alerts to notify when breakouts occur.
*Configurable styling options including box color, highlight color, and label placement.
⚙️ How It Works:
*During the defined time range, the script tracks the highest high and lowest low.
*After the session ends:
*A box is drawn to represent the opening range.
*Breakouts above the high or below the low trigger visual markers and optional alerts.
*Alerts are limited to one per direction per day to reduce noise.
⚠️ This indicator is a technical analysis tool only and does not provide financial advice or trade recommendations. Always use with proper risk management and in conjunction with your trading plan.
版本注释
🔹 Key BenefitsVisual Clarity: Instantly see the session’s high–low range through shaded boxes and horizontal lines.
Timely Alerts: Receive instant notifications when price breaks above or below the opening range.
Noise Reduction: Limits alerts to one per direction per day to prevent repeated signals and reduce trading noise.
Customization: Tailor session times, colors, and visual elements to match your trading style and local market hours.
Strategic Insights: Includes a midline option for extra context, helping you gauge intraday market momentum within the ORB.
🔧 Features & Functionality
1. Session Range Definition:
Define a specific intraday time window for the opening range (start & end times).
Adjust for local timezone to match exchange hours.
2. Automatic Visualization:
Shaded ORB Box: Highlights the high–low range of the session for clear visual reference.
High/Low Lines: Horizontal lines extend beyond the session to indicate key breakout levels.
Optional Midline: Plot a line at a custom percentage between the high and low, useful for intraday support/resistance reference.
Breakout Labels: Optional BUY/SELL labels appear on breakout candles for immediate clarity.
3. Breakout Detection & Alerts:
Monitors price outside the session range.
Triggers alerts when:
Price breaks above the session high → BUY signal
Price breaks below the session low → SELL signal
Alerts are limited to one per direction per day to avoid repeated notifications.
4. Fully Customizable Visuals:
Choose highlight colors, box fill and border colors, and label placement (left/right).
Supports clean, readable visualization for both dark and light chart themes.
5. Reset Mechanism:
Automatically resets session high/low and breakout flags at the start of each trading day to ensure accurate daily tracking.
⚙️ How It Works
During the defined opening range, the script continuously tracks the highest high and lowest low.
At session end:
A shaded box is drawn between the high and low.
Horizontal lines mark the breakout levels.
Optional midline and labels are added.
Outside of the session:
A price breakout above the session high triggers a BUY alert.
A price breakout below the session low triggers a SELL alert.
Alerts are fired only once per breakout direction per day.
版本注释
🔧 Buffer Lines (Technical Specification)Definition: Two auxiliary horizontal lines plotted relative to the session’s breakout levels.
Placement:
Upper Buffer Line = Session High + (Buffer Distance × pip size)
Lower Buffer Line = Session Low – (Buffer Distance × pip size)
Buffer Distance: User-defined in pips via Buffer Distance (pips) input.
Pip size is derived from syminfo.mintick.
Display Options:
Toggle visibility with Show Buffer Lines.
Customizable color (Buffer Line Color).
Adjustable style (Solid / Dashed / Dotted).
Persistence: Lines are drawn for each completed ORB session and remain visible historically, aligned with the corresponding session high/low lines.
Use Case: Creates a configurable buffer zone around the breakout levels to help mitigate false signals triggered at exact ORB boundaries.
版本注释
ORB Breakouts Update – Take Profit (TP) Lines:--Added BUY and SELL TP lines (TP1 & TP2) to measure potential profit targets.
--BUY TP lines calculate distance from the BUY breakout line to the session midline and extend 100% and 200% above the BUY line.
--SELL TP lines calculate distance from the SELL breakout line to the midline and extend 100% and 200% below the SELL line.
版本注释
1. Take Profit (TP) LinesAdded three customizable TP levels for both the BUY side (above session high) and the SELL side (below session low).
Each TP line is calculated as a percentage distance from the opposite session level (High or Low).
TP lines are fully customizable:
Toggle On/Off individually for each TP level.
Choose line color and style (Solid, Dashed, Dotted).
Separate controls for BUY and SELL TP lines.
2. TP Labels
Each TP line now includes a label (“TP1”, “TP2”, “TP3”) for quick identification.
3. Optional % Display on TP Labels
New toggle to show or hide the percentage value used for each TP.
TP1 (25%)
TP2 (50%)
TP3 (75%)
When disabled, labels display only TP1, TP2, TP3.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。