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.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?