chervolino

New day started with DST

New Day Started with DST Indicator

Description:
The "New Day Started with DST" indicator is designed for intraday charts and highlights the first bar of each new trading day, accounting for Germany's timezone and daylight saving time (DST) adjustments. This is particularly useful for traders who follow the German market or need precise day start indications based on Central European Time (CET) and Central European Summer Time (CEST).

Features:
- Timezone Adjustment: Automatically adjusts the time to CET (UTC+1) during standard time and CEST (UTC+2) during daylight saving time.
- Daylight Saving Time (DST) Handling: Correctly identifies the start and end of DST based on the last Sunday in March and October.
- New Day Highlight: Highlights the first bar of each new day, allowing traders to easily identify the start of a new trading day.

How It Works:
- Timezone Calculation: The script calculates the current time in Germany by adding the appropriate timezone offset to the UTC time.
- DST Rules: The script manually checks the conditions to determine if the current date falls within the DST period.
- New Day Detection: By checking the hour and minute of the corrected German time, the script determines if a new day has started and highlights the first bar accordingly.

Benefits:
- Enhanced Accuracy: Ensures that the start of a new day is accurately reflected according to German trading hours, considering both CET and CEST.
- Visual Aid: Provides a clear visual indication of the start of a new trading day, improving chart readability and trading precision.
- Customizable: Can be easily modified to adjust for other timezones and DST rules if needed.

Usage:
Apply this indicator to your intraday charts to automatically highlight the first bar of each new trading day, taking into account the timezone and DST adjustments for Germany. This tool is essential for traders operating in or tracking the German market, offering a reliable and precise method to monitor daily trading activity.

Example:
!(URL-to-your-screenshot)

This indicator ensures that you never miss the start of a new trading day, helping you to make timely and informed trading decisions.

---

How the Script Works:

1. Timezone Offset Calculation:
- The script begins by setting the base offset to 1 hour (CET is UTC+1).
- It initializes the DST offset to 0.

2. Determining the Current Month and Day:
- It retrieves the current month and day of the month from the `time` variable.

3. Checking DST Conditions:
- For months between April and September (inclusive), the DST offset is set to 1 hour (CEST is UTC+2).
- For March, it checks if the current date is after the last Sunday of March and if the time is past 2:00 AM to determine if DST should start.
- For October, it checks if the current date is before the last Sunday of October and if the time is before 2:00 AM to determine if DST should end.

4. Adjusting the Time for Germany:
- The script calculates the corrected German time by adding the base offset and DST offset to the UTC time.

5. Detecting the Start of a New Day:
- It checks if the hour and minute of the corrected German time are both zero (00:00), indicating the start of a new day.

6. Highlighting the First Bar:
- If the script detects a new day, it highlights the first bar of the new day with a green background color.

This approach ensures that the script accurately reflects the start of a new trading day according to German trading hours, including adjustments for daylight saving time.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?