Skip to content
All library documents

Horizontal Rays for Tracking Price Levels and Revisit Alerts

Article TradingView scripts

Summary

This Pine Script library draws horizontal rays from user-defined conditions and price levels. A ray can extend to the right or stop at the current bar; when price reaches the level, the active ray is removed and may be retained as a historical line. Its settings control line appearance and whether revisit alerts are enabled. An optional delay prevents an alert when the level is broken too soon after the ray begins.

Examples show rays started from a chosen chart point, moving-average crosses, and new all-time highs. These illustrate how the drawing can mark potential support or resistance levels and notify users when price returns. The library supplies charting and alert mechanics rather than a tested trading strategy: it gives no performance evidence, and the examples do not establish that these levels predict price behavior. The author also advises disabling historical lines before creating alerts to avoid alert problems.

Key ideas

  • A condition and price level determine where each horizontal ray begins.
  • The extension setting controls whether an active ray continues to the right.
  • When price reaches a ray, the script can preserve its past path as a styled historical line.
  • Optional alerts notify users when price revisits a level, with a delay measured in minutes.
  • Examples apply the drawing to moving-average crosses and new all-time highs.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.