disjointChannel
Draw a slanted price channel where the second line is offset by a custom distance (not necessarily parallel to a specific pivot like in parallelChannel). It’s perfect for visualizing things like:
Trend corridors (up or down)
Volatility envelopes around a move
“No‑trade” lanes while waiting for a breakout
Back‑testing a “walk the channel” strategy
think of it as two rails that follow your chosen slope, with the gap set by a third point you pick on the chart.
Syntax
disjointChannel(fromPoint, toPoint, offsetPoint, styles?, text?)
Parameters
fromPoint: First anchor for the channel’s direction. Build it with
newPoint(time, price), e.g.newPoint(time(30), low(30)).toPoint: Second anchor that sets the slope/direction of the channel. Also created with
newPoint(time, price), e.g.newPoint(time(10), high(10)).offsetPoint: A third point that defines the distance (gap) between the main line and the offset line. Use
newPoint(time, price), e.g.newPoint(time(0), closeC(0)).
styles (optional) Visual options you can pass as an object:
linecolor(string | RGBA) · Color of the base/parallel lines.linestyle(number) · Line style (e.g., solid/dashed).linewidth(number) · Line width.extendLeft(boolean) · Extend channel to the left.extendRight(boolean) · Extend channel to the right.fillBackground(boolean) · Fill the channel area.backgroundColor(string | RGBA) · Fill color.transparency(number) · Fill transparency (higher = more transparent).showBarsRange(boolean) · Show bars count.showDateTimeRange(boolean) · Show date/time span.showPriceRange(boolean) · Show price range stats.showPrices(boolean) · Show prices on labels.leftEnd(number) · Left line ending style.rightEnd(number) · Right line ending style.labelVisible(boolean) · Must be true to show thetextyou pass.labelBold(boolean) · Label bold text.labelItalic(boolean) · Label italic text.labelFontSize(number) · Label font size.labelTextColor(string | RGBA) · Label color.labelHorzAlign(string) · Label horizontal align.labelVertAlign(string) · Label vertical align.textcolor(string | RGBA) · Line text color (for stats/labels).fontsize(number) · Line font size.bold(boolean) · Line label bold.italic(boolean) · Line label italic.
text (optional): Short label for the drawing (e.g.,
"Disjoint Channel"). Visible only ifshowLabel: true.
Return Value
string — The unique drawing
idyou can later use withupdateDrawingById(id, data)ordeleteDrawingById(id).
Example
This script draws a disjoint channel every 40 candles. We:
Use an old low and a recent high to set the slope
Use the current close as the offset to define the channel’s width
Result

Tips
Mix and match pivots: for an uptrend, try low→high for the slope and use a recent low as
offsetPointto size the lower rail naturally.To mimic a volatility band, set
offsetPointnear a “far” swing; for a tight corridor, pick something close to the base line.If you want a live‑updating channel without stacking drawings, store the returned
idand callupdateDrawingById(id, [p1, p2, offset])instead of creating new ones.
Warning
If any point is missing
timeorprice(e.g., you passNaN), nothing will be drawn.Extremely close
offsetPointvalues can make the second rail overlap the first and look like a single line.Spamming channels (e.g., using very small intervals like
index % 1) will clutter the chart fast.
Good Practice
Use obvious swing points for
fromPointandtoPointso the slope reflects the actual market path.Keep a consistent color scheme across your script (e.g., purple for channels), and vary
linestyle(dashed vs. solid) to differentiate tools.When you only need one channel for context, create it less frequently (e.g.,
index % 30orindex % 50) so users aren’t overwhelmed.
Last updated