PROTECTED SOURCE SCRIPT
Day + HTF Separators + Midnight Open

Overview
The Day + HTF Separators + Midnight Open indicator is a versatile and easy-to-use tool for traders who want to track key price levels and time-based market events. It draws vertical lines to mark the start of each day, 4-hour period, and 1-hour period, adds labels to show the day of the week, and plots a horizontal line at a customizable hourly open price (defaulting to midnight, referred to as the "Time-Designated Open" or TDO). This indicator is perfect for day traders, swing traders, and anyone analyzing price action in Futures, forex, cryptocurrencies, or other markets on TradingView.
Designed for intraday charts (e.g., 1-minute, 5-minute, or 1-hour), this indicator offers extensive customization options, letting you toggle features, change colors, adjust line styles, and position labels. It’s built to be lightweight, ensuring smooth performance even on charts with lots of historical data.
Key Features
1. Daily Separators
What It Does: Draws a vertical line at the start of each new trading day to help you see daily boundaries clearly.
How It Works:
Places a vertical line at the beginning of each day, spanning the full price range of the opening moment.
Lines extend across the chart, making it easy to spot daily transitions.
Keeps up to 300 past daily lines visible, automatically managing older ones to stay within TradingView’s limits.
Customization:
Show/Hide: Always shown on intraday charts but tied to the "Show Days of Week Labels" setting for consistency.
Color: Choose any color (default: a medium gray).
Style: Pick Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Helps you track daily price ranges, identify daily open/close levels, and plan trades around daily market cycles.
2. Day of the Week Labels
What It Does: Displays the day of the week (e.g., "MON" for Monday) at a specific hour each day, making it easy to know which day you’re analyzing.
How It Works:
Shows labels like "MON", "TUE", "WED", "THU", "FRI", "SAT", or "SUN" at the bottom of the chart.
Labels appear at a user-chosen hour (default: 5:00 AM) each day.
Only works on intraday charts (e.g., 5-minute or 1-hour).
Customization:
Show/Hide: Turn on/off with "Show Days of Week Labels" (default: on).
Color: Set the label text color (default: dark gray).
Hour: Choose any hour from 0:00 to 23:00 for label placement (default: 5:00 AM).
Why Use It: Great for traders who need to track specific days for events like economic releases or to spot weekly patterns in price action.
3. 4-Hour Separators
What It Does: Marks the start of each 4-hour period with a vertical line, ideal for aligning with higher timeframe trends.
How It Works:
Draws vertical lines every 4 hours, covering the price range of the starting moment.
Lines extend across the chart for clear visibility.
Stores up to 100 past 4-hour lines, reusing older ones for efficiency.
Customization:
Show/Hide: Enable/disable with "Show 4H Separator" (default: off).
Color: Choose any color (default: gray, slightly transparent).
Style: Select Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Perfect for swing traders or those combining intraday trading with 4-hour chart analysis, such as identifying key support or resistance levels.
4. 1-Hour Separators
What It Does: Draws vertical lines to mark the start of each hour, helping short-term traders track hourly price movements.
How It Works:
Places a vertical line at the start of each hour, spanning the price range.
Lines extend across the chart and support up to 100 historical lines.
Customization:
Show/Hide: Enable/disable with "Show 1H Separator" (default: off).
Color: Pick any color (default: a light gray, slightly transparent).
Style: Choose Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Ideal for scalpers or day traders focusing on hourly trends, session changes, or short-term price action.
5. Time-Designated Open (TDO) Lines
What It Does: Plots a horizontal line at the opening price of a chosen hour (default: midnight, 00:00) each day, with an optional label to mark the price level, helping you track key price points across multiple days.
How It Works:
Draws a horizontal line at the open price of the selected hour (e.g., midnight) in your chosen timezone (default: New York time).
Lines start at the chosen hour and extend to the current moment on the chart (or a few bars beyond, based on settings) or until 5:00 PM New York time (market close for Futures).
Supports up to 100 past TDO lines, keeping historical opens visible for comparison.
Adds a label (e.g., "TDO") at the end or start of the line, which is invisible by default due to full transparency.
Lines and labels only appear if both the main toggle and TDO-specific toggle are enabled.
Customization:
Show/Hide Line and Label: Turn on/off with "Enable Candle Open Line/Label" and the TDO-specific toggle (both default: on).
Show/Hide Label: Enable/disable the label separately with "Enable Candle Open Label" (default: on).
Hour: Select any hour from 00:00 to 23:00 (default: 00:00).
Label Text: Customize the label name (default: "TDO").
Line Color: Choose any color (default: light cyan).
Line Style: Pick Solid, Dashed, or Dotted (default: Solid).
Label Text Color: Set the label text color (default: gray, fully transparent).
Label Background Color: Choose the label background color (default: black).
Label Transparency: Adjust transparency for both label text and background (default: fully transparent, invisible).
Label Size: Select Tiny, Small, Normal, or Large (default: Small).
Label Position: Place the label at the right or left of the line with "Stick Label to Right" (default: right) and adjust spacing with "Label Padding" (default: 1 bar).
Line Length: Shorten the left side with "Enable Left-Side Trimming" (default: off) and set the trim length with "Left Trim Bars" (default: 8 bars). Extend the right side with "Line Padding" (default: 2 bars).
Timezone: Choose from New York, UTC, London, Paris, Tokyo, Shanghai, Singapore, or Sydney (default: New York).
Max History: Set how many past TDO lines to show (default: 100).
Multi-Day Plotting:
Plots a TDO line for the chosen hour (e.g., 00:00) each day, based on historical data.
Each line starts at the open price of that hour and extends to the current moment or 5:00 PM New York time (for Futures).
Past TDO lines stay visible, letting you compare daily open prices over time (up to 100 days, adjustable).
How to Use
Add to Your Chart:
Add the indicator to an intraday chart (e.g., 1-minute, 5-minute, or 1-hour) for any market (Futures, forex, crypto, etc.).
It works best on intraday timeframes to show all features.
Customize Settings:
Open the settings panel in TradingView.
Turn on/off features like daily separators, DOW labels, 1-hour/4-hour separators, or TDO lines.
Adjust colors, line styles, and label positions to fit your chart’s look.
Set the TDO hour (e.g., 00:00 for midnight or 03:00 for London open) and timezone to match your market.
Make TDO labels visible by reducing "Label Transparency" or changing "Label Text Color" to an opaque color.
Analyze the Chart:
Use daily separators to spot daily price ranges and key levels.
Check DOW labels to track specific days for trading events or weekly trends.
Use 1-hour/4-hour separators to align with short-term or higher timeframe strategies.
Monitor TDO lines to identify key opening price levels across days, useful for support/resistance or breakout trading.
Test and Adjust:
Toggle the main TDO switch or specific TDO toggle to hide/show the TDO line.
Reduce "Label Transparency" to 0 or change "Label Text Color" to make TDO labels visible.
Performance: The indicator is optimized to handle up to 300 daily lines, 100 4-hour lines, 100 1-hour lines, and 100 TDO lines, ensuring it runs smoothly on long charts.
Markets: Best for intraday charts. The 5:00 PM New York close is designed for futures; switch to UTC for forex or crypto.
Labels: TDO labels are invisible by default (fully transparent). Adjust "Label Transparency" or "Label Text Color" to make them visible.
Time Context: As of September 17, 2025, 6:08 PM EDT, TDO lines on stock charts stop updating at 5:00 PM New York time. Use historical data or change the timezone for continuous markets.
Limitations
Only works on intraday charts (e.g., 1-minute to 1-hour).
TDO lines stop at 5:00 PM New York time for Futures; adjust the timezone for 24/7 markets.
TDO labels are hidden by default (fully transparent); change transparency or color to see them.
Limited to 500 total lines and labels due to TradingView’s restrictions, managed automatically.
Feedback
If something isn’t working (e.g., missing lines or labels), please share:
The market and timeframe (e.g., EUR/USD, 5-minute).
Your settings (e.g., TDO hour, timezone, transparency).
A description or screenshot of the issue. This indicator is designed to make your trading easier with clear visuals for time-based analysis. Happy trading!
The Day + HTF Separators + Midnight Open indicator is a versatile and easy-to-use tool for traders who want to track key price levels and time-based market events. It draws vertical lines to mark the start of each day, 4-hour period, and 1-hour period, adds labels to show the day of the week, and plots a horizontal line at a customizable hourly open price (defaulting to midnight, referred to as the "Time-Designated Open" or TDO). This indicator is perfect for day traders, swing traders, and anyone analyzing price action in Futures, forex, cryptocurrencies, or other markets on TradingView.
Designed for intraday charts (e.g., 1-minute, 5-minute, or 1-hour), this indicator offers extensive customization options, letting you toggle features, change colors, adjust line styles, and position labels. It’s built to be lightweight, ensuring smooth performance even on charts with lots of historical data.
Key Features
1. Daily Separators
What It Does: Draws a vertical line at the start of each new trading day to help you see daily boundaries clearly.
How It Works:
Places a vertical line at the beginning of each day, spanning the full price range of the opening moment.
Lines extend across the chart, making it easy to spot daily transitions.
Keeps up to 300 past daily lines visible, automatically managing older ones to stay within TradingView’s limits.
Customization:
Show/Hide: Always shown on intraday charts but tied to the "Show Days of Week Labels" setting for consistency.
Color: Choose any color (default: a medium gray).
Style: Pick Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Helps you track daily price ranges, identify daily open/close levels, and plan trades around daily market cycles.
2. Day of the Week Labels
What It Does: Displays the day of the week (e.g., "MON" for Monday) at a specific hour each day, making it easy to know which day you’re analyzing.
How It Works:
Shows labels like "MON", "TUE", "WED", "THU", "FRI", "SAT", or "SUN" at the bottom of the chart.
Labels appear at a user-chosen hour (default: 5:00 AM) each day.
Only works on intraday charts (e.g., 5-minute or 1-hour).
Customization:
Show/Hide: Turn on/off with "Show Days of Week Labels" (default: on).
Color: Set the label text color (default: dark gray).
Hour: Choose any hour from 0:00 to 23:00 for label placement (default: 5:00 AM).
Why Use It: Great for traders who need to track specific days for events like economic releases or to spot weekly patterns in price action.
3. 4-Hour Separators
What It Does: Marks the start of each 4-hour period with a vertical line, ideal for aligning with higher timeframe trends.
How It Works:
Draws vertical lines every 4 hours, covering the price range of the starting moment.
Lines extend across the chart for clear visibility.
Stores up to 100 past 4-hour lines, reusing older ones for efficiency.
Customization:
Show/Hide: Enable/disable with "Show 4H Separator" (default: off).
Color: Choose any color (default: gray, slightly transparent).
Style: Select Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Perfect for swing traders or those combining intraday trading with 4-hour chart analysis, such as identifying key support or resistance levels.
4. 1-Hour Separators
What It Does: Draws vertical lines to mark the start of each hour, helping short-term traders track hourly price movements.
How It Works:
Places a vertical line at the start of each hour, spanning the price range.
Lines extend across the chart and support up to 100 historical lines.
Customization:
Show/Hide: Enable/disable with "Show 1H Separator" (default: off).
Color: Pick any color (default: a light gray, slightly transparent).
Style: Choose Solid, Dashed, or Dotted lines (default: Dotted).
Why Use It: Ideal for scalpers or day traders focusing on hourly trends, session changes, or short-term price action.
5. Time-Designated Open (TDO) Lines
What It Does: Plots a horizontal line at the opening price of a chosen hour (default: midnight, 00:00) each day, with an optional label to mark the price level, helping you track key price points across multiple days.
How It Works:
Draws a horizontal line at the open price of the selected hour (e.g., midnight) in your chosen timezone (default: New York time).
Lines start at the chosen hour and extend to the current moment on the chart (or a few bars beyond, based on settings) or until 5:00 PM New York time (market close for Futures).
Supports up to 100 past TDO lines, keeping historical opens visible for comparison.
Adds a label (e.g., "TDO") at the end or start of the line, which is invisible by default due to full transparency.
Lines and labels only appear if both the main toggle and TDO-specific toggle are enabled.
Customization:
Show/Hide Line and Label: Turn on/off with "Enable Candle Open Line/Label" and the TDO-specific toggle (both default: on).
Show/Hide Label: Enable/disable the label separately with "Enable Candle Open Label" (default: on).
Hour: Select any hour from 00:00 to 23:00 (default: 00:00).
Label Text: Customize the label name (default: "TDO").
Line Color: Choose any color (default: light cyan).
Line Style: Pick Solid, Dashed, or Dotted (default: Solid).
Label Text Color: Set the label text color (default: gray, fully transparent).
Label Background Color: Choose the label background color (default: black).
Label Transparency: Adjust transparency for both label text and background (default: fully transparent, invisible).
Label Size: Select Tiny, Small, Normal, or Large (default: Small).
Label Position: Place the label at the right or left of the line with "Stick Label to Right" (default: right) and adjust spacing with "Label Padding" (default: 1 bar).
Line Length: Shorten the left side with "Enable Left-Side Trimming" (default: off) and set the trim length with "Left Trim Bars" (default: 8 bars). Extend the right side with "Line Padding" (default: 2 bars).
Timezone: Choose from New York, UTC, London, Paris, Tokyo, Shanghai, Singapore, or Sydney (default: New York).
Max History: Set how many past TDO lines to show (default: 100).
Multi-Day Plotting:
Plots a TDO line for the chosen hour (e.g., 00:00) each day, based on historical data.
Each line starts at the open price of that hour and extends to the current moment or 5:00 PM New York time (for Futures).
Past TDO lines stay visible, letting you compare daily open prices over time (up to 100 days, adjustable).
How to Use
Add to Your Chart:
Add the indicator to an intraday chart (e.g., 1-minute, 5-minute, or 1-hour) for any market (Futures, forex, crypto, etc.).
It works best on intraday timeframes to show all features.
Customize Settings:
Open the settings panel in TradingView.
Turn on/off features like daily separators, DOW labels, 1-hour/4-hour separators, or TDO lines.
Adjust colors, line styles, and label positions to fit your chart’s look.
Set the TDO hour (e.g., 00:00 for midnight or 03:00 for London open) and timezone to match your market.
Make TDO labels visible by reducing "Label Transparency" or changing "Label Text Color" to an opaque color.
Analyze the Chart:
Use daily separators to spot daily price ranges and key levels.
Check DOW labels to track specific days for trading events or weekly trends.
Use 1-hour/4-hour separators to align with short-term or higher timeframe strategies.
Monitor TDO lines to identify key opening price levels across days, useful for support/resistance or breakout trading.
Test and Adjust:
Toggle the main TDO switch or specific TDO toggle to hide/show the TDO line.
Reduce "Label Transparency" to 0 or change "Label Text Color" to make TDO labels visible.
Performance: The indicator is optimized to handle up to 300 daily lines, 100 4-hour lines, 100 1-hour lines, and 100 TDO lines, ensuring it runs smoothly on long charts.
Markets: Best for intraday charts. The 5:00 PM New York close is designed for futures; switch to UTC for forex or crypto.
Labels: TDO labels are invisible by default (fully transparent). Adjust "Label Transparency" or "Label Text Color" to make them visible.
Time Context: As of September 17, 2025, 6:08 PM EDT, TDO lines on stock charts stop updating at 5:00 PM New York time. Use historical data or change the timezone for continuous markets.
Limitations
Only works on intraday charts (e.g., 1-minute to 1-hour).
TDO lines stop at 5:00 PM New York time for Futures; adjust the timezone for 24/7 markets.
TDO labels are hidden by default (fully transparent); change transparency or color to see them.
Limited to 500 total lines and labels due to TradingView’s restrictions, managed automatically.
Feedback
If something isn’t working (e.g., missing lines or labels), please share:
The market and timeframe (e.g., EUR/USD, 5-minute).
Your settings (e.g., TDO hour, timezone, transparency).
A description or screenshot of the issue. This indicator is designed to make your trading easier with clear visuals for time-based analysis. Happy trading!
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。