horizontalRay
Draws a flat line that begins at the candle you choose and extends to the right into the future. This is very useful for marking support or resistance levels so you can see how price reacts when it comes back later.
Syntax
horizontalRay(time, price, styles?, text?)
Parameters
time: The candle time where the ray starts (for example,
time(10)means the line starts from 10 candles ago).price: The price level where the line is drawn (like
low(10)orcloseC(0)).text (optional): A short label you want to show on the line.
Return Value
string — A unique drawing
id.
Example
Here we draw a green horizontal ray at the low price from 15 candles ago, and we only do it every 25 candles to keep the chart clean.
Result

Tips
Great for projecting old swing highs/lows forward in time.
Use different colors for support (green) and resistance (red) for clarity.
Warning
If
priceis missing or invalid, the line won’t appear.Passing a
textlabel withoutshowLabel: truemeans the label will stay hidden.
Last updated