extendedLine
Draw a line that goes through two chosen points and extends infinitely in both directions. This is handy when you want to see a complete trend extension that keeps going left and right, rather than stopping at your selected candles.
Syntax
extendedLine(fromPoint, toPoint, styles?, text?)
Parameters
fromPoint: First anchor point on the chart. Use
newPoint(time, price).toPoint: Second anchor point. The line will pass through this point too.
text (optional): A short label to display on the line (if
showLabel: true).
Return Value
string — A unique
idfor the drawing. Use it withupdateDrawingById(id, data)ordeleteDrawingById(id).
Example
Here’s how to draw a red extended line through the highs of the last 5 and last 0 candles:
This will draw one red line passing through the two highs and continuing both left and right across the chart, with a small label “Extended Line.”
Result

Tips
Extended lines are great for projecting old support/resistance across the entire chart.
Use them sparingly so your chart doesn’t become full of crossing lines.
Warning
If you pass invalid points (missing time or price), the line won’t appear.
If you give
textbut don’t enableshowLabel: true, the label won’t show.
Last updated