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!
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.