OPEN-SOURCE SCRIPT

Session High Low 2024

https://www.tradingview.com/x/oQ8qVUnU/

Overview of the Code:
Input for Session Times:

You set up inputs for the start and end times of the trading session, allowing you to customize them as needed.

Time Range Function:
A function isTimeInRange checks whether the current time falls within the specified session start and end times.

initialize High and Low:
indicator initialize session high, low, and their corresponding labels and lines.

Tracking Session High and Low:
Within the specified time range, continuously update session1High and session1Low based on the highest and lowest prices encountered.

Time of Session High/Low:
The High_Time and Low_Time are tracked using the ta.valuewhen() function to capture the exact times when the session high and low occur.

Notes Creation:
You format the high and low values along with their timestamps to create notes that will be displayed alongside the lines.
Drawing Lines and Labels:

After the session ends, you check if there is a new session high or low and draw lines and labels accordingly. If a line or label already exists, you delete it before drawing a new one.
Resetting for Next Session:

At the end of the session, the high and low values are reset for the next session.
Suggestions for Improvement:
Dynamic Line Extensions:

Clear Variable Names Used in Code:
Consider using more descriptive names for variables like Entry_Point and SL_Point to make the code easier to understand.

Commenting:
Although the code is well-commented, always ensure the comments explain the "why" behind the code rather than just the "what."

Example Output:
The output will show the highest and lowest prices during the specified session times and the times they occurred formatted correctly. This output is useful for quick reference during trading and aids in making informed decisions.

Added functionality tool tip Note:
Added a tooltip Note to Get All information of Session High Low & Range.

If you need further modifications, enhancements, or specific functionalities added to this script, please let me know!









Bands and Channels

开源脚本

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

想在图表上使用此脚本?


更多:

免责声明