Matboom

Week designation

The script is primarily used for visualizing the beginning and end of the week. It is particularly helpful when working with time intervals shorter than one day. In a very simple and clear manner, you can see when a specific week has started. This makes it easier to assess the market sentiment in a short timeframe.

Here are the operating principles of this script:

Initialization:
The script begins with initialization, where basic parameters and settings such as line colors and line style are defined.

Determining the Session Start:
The startSession(hour, minute) function is used to calculate the starting time of a session on the chart. Sessions can be divided into different time intervals, such as the daily session (D), weekly session (W), and monthly session (M).

Checking for Session Start:
The script checks if a new session is starting. If so, a vertical line is inserted on the chart to mark the beginning of that session.
  • isSessionStart checks for the start of the daily session.
  • isSessionStart_2 checks for the start of the weekly session.
  • isSessionStart_3 checks for the start of the monthly session.

Marking Mondays:
The script checks if the current day is Monday (the day of the week number 2 represents Monday).
If the current session is starting or it is Monday, a vertical line is inserted on the chart with the day designation (color color_day).

Marking Lines on the Chart:
The lines inserted on the chart are vertical and have a specified style and color, which can be customized in the settings.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?