Objects
118 entries. What each one takes, what it returns, and a working example.
Equivalent to referans dil box.all. Count with arraySize, access with arrayGet; usually to loop and delete/update boxs on barstate.islast. Deleted handles are excluded.
Returns a NEW box handle copying all properties of the source box.
Creates an independent clone; changing the copy does not affect the original.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) k = boxCopy(b) boxSetXy1(k, barIndex-30, high) boxSetXy2(k, barIndex-15, low) }
Clones the box and moves it to the previous range.
Returns nothing (na); the box no longer appears on the next draw.
Marks the box deleted; it is excluded from output at flush time.
if barstate.islast { b = boxNew(barIndex-10, high, barIndex, low) if close > high { boxDelete(b) } }
Deletes the box if close breaks above the high.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetBottom(b), "x") }
Plots the bottom edge price.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetLeft(b), "x") }
Plots the left edge bar index.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetRight(b), "x") }
Plots the right edge bar index.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetTop(b), "x") }
Plots the top edge price.
Returns the first corner's bar index (same value as boxGetLeft).
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetX1(b), "x") }
Plots the first corner's bar index.
Returns the second corner's bar index (same value as boxGetRight).
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetX2(b), "x") }
Plots the second corner's bar index.
Returns the first corner's price (same value as boxGetTop).
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetY1(b), "x") }
Plots the first corner's price.
Returns the second corner's price (same value as boxGetBottom).
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) plot(boxGetY2(b), "x") }
Plots the second corner's price.
boxNew(bar1, fiyat1, bar2, fiyat2, renk?, metin?, bgcolor?, border_color?, text_color?, text_halign?, text_valign?, xloc?, extend?, text_size?)
Returns an updatable box (rectangle) handle; change it with boxSetXy1/boxSetBgColor/boxSetText.
Draws a rectangle from two corners. The 5th argument is the BORDER color — not the fill; the fill is transparent by default and set with boxSetBgColor. Text is centered by default.
Border color (color / boxSetColor / boxSetBorderColor) and fill color (boxSetBgColor) are SEPARATE properties; set both together.
if barstate.islast { b = boxNew(barIndex-20, high, barIndex, low, "#2962ff", "Bolge") boxSetBgColor(b, "#2962ff22") }
A box spanning the last 20 bars' high-low range, lightly blue-filled, labeled 'Zone'.
Returns the same box handle.
Sets the box's INTERIOR fill color. The fill is transparent by default; usually you pass an alpha color like #rrggbbAA.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBgColor(b, "#ef535022") }
Shades the box with a light red fill.
Returns the same box handle.
Sets the box's border color (the borderColor property). Serves the same purpose as boxSetColor; use it when you want to color the border explicitly.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBorderColor(b, "#ffffff") }
Colors the box border white.
Returns the same box handle.
Sets the border style. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBorderStyle(b, "dashed") }
Makes the box border dashed.
boxSetBorderWidth(kutu, kalınlık)
Returns the same box handle.
Sets the border thickness (rounded to an integer). A non-numeric value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBorderWidth(b, 2) }
Sets the box border to 2 pixels.
Returns the same box handle.
Moves the bottom edge (price2) to the given price.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBottom(b, low) }
Aligns the bottom edge to the current low.
boxSetBottomRightPoint(kutu, nokta)
Returns the same box handle.
Sets the bottom-right corner from a chartPoint (bar2/price2).
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetBottomRightPoint(b, chartPointNow(low)) }
Moves the bottom-right corner to a low point on the current bar.
Returns the same box handle.
Changes the box border color. Not the fill — use boxSetBgColor for that. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetColor(b, "#26a69a") }
Colors the box outline green.
Returns the same box handle.
Extends the box horizontally beyond its edges. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetExtend(b, "right") }
Extends the box to the right.
Returns the same box handle.
Moves the left edge (bar1) to the given bar.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetLeft(b, barIndex-40) }
Moves the left edge 40 bars back.
boxSetLefttop(kutu, bar, fiyat)
Returns the same box handle.
Sets the top-left corner (bar1 + price1) in one call; targets the same corner as boxSetXy1.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetLefttop(b, barIndex-25, high) }
Sets the top-left corner at a high point 25 bars ago.
Returns the same box handle.
Moves the right edge (bar2) to the given bar.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetRight(b, barIndex) }
Moves the right edge to the current bar.
boxSetRightbottom(kutu, bar, fiyat)
Returns the same box handle.
Sets the bottom-right corner (bar2 + price2) in one call.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetRightbottom(b, barIndex, low) }
Sets the bottom-right corner at the current bar-low point.
Returns the same box handle.
Changes the box text. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Arz Bolgesi") }
Writes 'Supply Zone' inside the box.
Returns the same box handle.
Sets the box text color. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Bolge") boxSetTextColor(b, "#ffffff") }
Colors the text white.
boxSetTextFontFamily(kutu, font)
Returns the same box handle.
Sets the box text's font family. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "123.45") boxSetTextFontFamily(b, "monospace") }
Renders the text in a monospace font.
boxSetTextFormatting(kutu, biçim)
Returns the same box handle.
Applies bold/italic formatting to the box text. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Onemli") boxSetTextFormatting(b, "bold") }
Renders the text in bold.
Returns the same box handle.
Sets the text's horizontal alignment inside the box. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Bolge") boxSetTextHalign(b, "left") }
Left-aligns the text.
Returns the same box handle.
Sets the text size. A name maps to its pixel equivalent; a number is clamped to 7–40.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Bolge") boxSetTextSize(b, "large") }
Sets the text to 'large' size.
Returns the same box handle.
Sets the text's vertical alignment inside the box. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Bolge") boxSetTextValign(b, "top") }
Top-aligns the text.
Returns the same box handle.
Turns line wrapping on/off so long text fits the box width. A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetText(b, "Uzun bir aciklama metni") boxSetTextWrap(b, "auto") }
Wraps long text across lines to fit the box.
Returns the same box handle.
Moves the top edge (price1) to the given price.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetTop(b, high) }
Aligns the top edge to the current high.
boxSetTopLeftPoint(kutu, nokta)
Returns the same box handle.
Sets the top-left corner from a chartPoint (bar1/price1); a missing field on the point is skipped.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetTopLeftPoint(b, chartPointNew(barIndex-30, time, high)) }
Moves the top-left corner to a high point 30 bars ago.
Returns the same box handle.
Sets the box's horizontal placement unit (bar order or timestamp). A non-string value is a no-op.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetXloc(b, "bar_index") }
Puts the box in bar-index location mode.
Returns the same box handle.
Moves the box's FIRST corner (top-left: bar1, price1) together. If price is omitted, only the bar moves.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetXy1(b, barIndex-30, high) }
Moves the top-left corner 30 bars back and to the current high.
Returns the same box handle.
Moves the box's SECOND corner (bottom-right: bar2, price2) together.
if barstate.islast { b = boxNew(barIndex-15, high, barIndex, low) boxSetXy2(b, barIndex, low) }
Moves the bottom-right corner to the current bar and low (grows the box).
Returns an independent copy of the given drawing point.
Copies all fields (index/time/price) of a chartPoint; changing the copy does not affect the original.
if barstate.islast { p = chartPointNow(close) k = chartPointCopy(p) l = lineNew(p, k) }
Copies a point and draws a line between the two.
chartPointFromIndex(indeks, fiyat)
Returns a bar-index-based drawing point (no time field).
Builds a chartPoint from index + price; it carries no time, so it suits bar_index placement.
if barstate.islast { p = chartPointFromIndex(barIndex-5, low) e = labelNew(close, "N", barIndex) labelSetPoint(e, p) }
Binds a low point 5 bars ago to a label.
chartPointFromTime(zaman, fiyat)
Returns a time-based drawing point (no index field).
Builds a chartPoint from time + price; it suits bar_time placement (alignment holds across timeframes).
if barstate.islast { p = chartPointFromTime(time, close) e = labelNew(close, "T", barIndex) labelSetPoint(e, p) }
Binds the current time-price point to a label.
chartPointNew(indeks, zaman, fiyat)
Returns a drawing point (chartPoint) carrying index, time and price.
Produces an {index, time, price} record used by the point-based APIs of lines/boxes/labels. If price is a series its last value is taken; if index is omitted the last bar is used.
if barstate.islast { p1 = chartPointNew(barIndex-10, time, low) p2 = chartPointNow(high) l = lineNew(p1, p2, "#26a69a") }
Draws a green line between two chartPoints.
Returns a drawing point at the last bar's index.
Builds a chartPoint from the current (last) bar's index + the given price; the most common shortcut in live drawings.
if barstate.islast { p = chartPointNow(close) l = lineNew(chartPointNew(barIndex-15, time, low), p) }
Sets the line's second endpoint at the current bar-close.
Returns an array of all currently existing (non-deleted) label handles (in creation order).
Equivalent to referans dil label.all. Count with arraySize, access with arrayGet; usually to loop and delete/update labels on barstate.islast. Deleted handles are excluded.
Returns a NEW label handle copying all properties of the source label.
Creates an independent clone; changing the copy does not affect the original.
if barstate.islast { e = labelNew(high, "Zirve", barIndex, "#26a69a") k = labelCopy(e) labelSetXy(k, barIndex-10, low) labelSetText(k, "Dip") }
Clones the label, moves it 10 bars back and changes its text.
Returns nothing (na); the label no longer appears on the next draw.
Marks the label deleted; it is excluded from output at flush time. Later calls on a deleted handle have no effect.
if barstate.islast { e = labelNew(close, "Not", barIndex) if close < open { labelDelete(e) } }
Deletes the label on a down bar.
Returns the label's text (string); an empty string if the handle is invalid.
Read-only; does not mutate the label.
if barstate.islast { e = labelNew(high, "Zirve", barIndex) k = labelNew(low, labelGetText(e), barIndex) }
Reads one label's text and uses it in a second label.
Returns the label's horizontal position: time (ms) if xloc is bar_time, otherwise the bar index.
Read-only; returns the raw x value in the xloc unit (no resolution). Returns na if unset.
if barstate.islast { e = labelNew(close, "X", barIndex) plot(labelGetX(e), "x") }
Plots the label's bar index.
Returns the label's price level; na if unset.
Read-only; does not mutate the label.
if barstate.islast { e = labelNew(high, "X", barIndex) plot(labelGetY(e), "y") }
Plots the label's price level.
labelNew(fiyat, metin, bar?, renk?, boyut?)
Returns an updatable label handle; store it in a variable and change it later with labelSetText/labelSetXy/labelSetColor.
Usually called inside a conditional block: if cond { e = labelNew(...) }. Text is white and the style is fixed downward-pointing (label_down); you set only price, text, bar, color and size. Keep the handle and you can update the same label instead of recreating it.
Store the handle in a var variable and update it with labelSetText/labelSetXy instead of creating a new label; that keeps a single label on the chart.
var e = na if barstate.islast { e := labelNew(close, "Fiyat: " + str.tostring(close), barIndex, "#2962ff") }
A single blue label on the last bar showing the closing price; its text updates as the chart advances.
if crossover(close, sma(close, 20)) { e = labelNew(low, "AL", barIndex, "#26a69a", "large") }
A large green 'BUY' label at the low level on every 20-SMA cross-above bar.
Returns the same label handle.
Sets the label background color. Passing na (None) hides the box (only the text remains); a string applies the color.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetColor(e, iff(close > open, "#26a69a", "#ef5350")) }
Green background on an up bar, red on a down bar.
Returns the same label handle.
Positions the label from a chartPoint: bar index, time and price are all written (time is preserved).
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetPoint(e, chartPointNow(high)) }
Moves the label to a high point on the current bar.
Returns the same label handle.
Sets the label font size. A name maps to its pixel equivalent; a number is clamped to 7–40.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetSize(e, "large") }
Sets the label to 'large' size.
Returns the same label handle.
Sets the label's arrow/box style. Supported styles: label_up/label_down/label_left/label_right/none. Any other value falls back to label_down and produces a warning.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetStyle(e, "label_up") }
Turns the label into an upward-pointing style.
Returns the same label handle.
Changes the label text. A non-string value is a no-op. Ideal for keeping a handle and updating the text without creating a new label each bar.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetText(e, "Fiyat: " + str.tostring(close)) }
Updates the label text with the current close.
labelSetTextFontFamily(etiket, font)
Returns the same label handle.
Sets the label text's font family. A non-string value is a no-op.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetTextFontFamily(e, "monospace") }
Renders the label in a monospace font.
labelSetTextFormatting(etiket, biçim)
Returns the same label handle.
Applies bold/italic formatting to the label text. A non-string value is a no-op.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetTextFormatting(e, "bold") }
Renders the label text in bold.
labelSetTextalign(etiket, hiza)
Returns the same label handle.
Sets the alignment of multi-line label text. A non-string value is a no-op.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetText(e, "Satir1\nSatir2") labelSetTextalign(e, "left") }
Left-aligns multi-line text.
labelSetTextcolor(etiket, renk)
Returns the same label handle.
Sets the label text color. Passing na (None) hides the text; a string applies the color.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetTextcolor(e, "#000000") }
Colors the text black.
labelSetTooltip(etiket, metin)
Returns the same label handle.
Adds a tooltip to the label that appears on hover. A non-string value is a no-op.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetTooltip(e, "RSI: " + str.tostring(rsi(close,14))) }
Adds the current RSI value as the label tooltip.
Returns the same label handle.
Changes only the label's horizontal position; the price is untouched. x is written in the label's xloc unit.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetX(e, barIndex-5) }
Moves the label 5 bars back.
Returns the same label handle.
Changes the label's horizontal location unit AND rewrites x in that new unit (three arguments: label, x, mode). Only bar_index/bar_time are accepted as valid modes.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetXloc(e, time, "bar_time") }
Switches the label to timestamp location mode and places it at the current time.
labelSetXy(etiket, bar, fiyat)
Returns the same label handle.
Moves the label both horizontally (bar) and vertically (price). The x value is written in the label's xloc unit (bar_index → barIndex, bar_time → time).
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetXy(e, barIndex, high) }
Moves the label to the current bar and high level.
Returns the same label handle.
Changes only the label's vertical (price) position. Passing na (None) drops the price (meaningful with abovebar/belowbar yloc).
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetY(e, high) }
Moves the label to the current high level.
Returns the same label handle.
Sets the label's vertical placement: price uses the price level, abovebar/belowbar pins above/below the bar (the price argument is ignored in those modes). Only one of the three values is valid.
if barstate.islast { e = labelNew(close, "Not", barIndex) labelSetYloc(e, "abovebar") }
Pins the label above the bar.
Returns an array of all currently existing (non-deleted) line handles (in creation order).
Equivalent to referans dil line.all. Count with arraySize, access with arrayGet; usually to loop and delete/update lines on barstate.islast. Deleted handles are excluded.
Returns a NEW line handle copying all properties of the source line.
Creates an independent clone; changing the copy does not affect the original. Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-20, low, barIndex, low) k = lineCopy(l) lineSetY1(k, high) lineSetY2(k, high) }
Clones the lower line and moves it to the high level to form a parallel upper line.
Returns nothing (na); the line no longer appears on the next draw.
Marks the line deleted — it is excluded from the output list at flush time. Later calls on a deleted handle have no effect.
if barstate.islast { l = lineNew(barIndex-10, low, barIndex, high) if close < low { lineDelete(l) } }
Deletes the line if close drops below the low.
Returns the line's price at the given bar (linear inter/extrapolation); if both ends share a bar, price1 is returned.
Treats the line as a straight line and computes its y value at the requested bar — works beyond the endpoints too (extrapolation). Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) plot(lineGetPrice(l, barIndex), "x") }
Plots the line's (extrapolated) price value at the current bar.
Returns the first endpoint's bar index (as a float).
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) plot(lineGetX1(l), "x") }
Plots the first endpoint's bar index.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) plot(lineGetX2(l), "x") }
Plots the second endpoint's bar index.
Returns the first endpoint's price level.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) plot(lineGetY1(l), "x") }
Plots the first endpoint's price.
Returns the second endpoint's price level.
Read-only; does not mutate the handle. Returns na for an invalid handle.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) plot(lineGetY2(l), "x") }
Plots the second endpoint's price.
lineNew(bar1, fiyat1, bar2, fiyat2, renk?, stil?, kalinlik?, uzat?)
Returns an updatable line handle drawn between the two points; store it in a variable and change it later with lineSetXy1/lineSetColor/lineSetWidth.
Draws a free line between two (bar, price) pairs. Width defaults to 1 (change to 1–4 via lineSetWidth) and extension is off (turn on with lineSetExtend). Usually called inside a conditional block; keep the handle to update the same line instead of recreating it.
Store the handle in a var variable and extend the second endpoint with lineSetXy2 instead of creating a new line each bar; that grows a single line.
if barstate.islast { l = lineNew(barIndex-20, low, barIndex, high, "#26a69a", "dashed") lineSetWidth(l, 2) }
A dashed green line from the low 20 bars ago to the current high; width 2.
if barstate.islast { p1 = chartPointNew(barIndex-10, time, low) p2 = chartPointNow(high) l = lineNew(p1, p2, "#2962ff") }
A blue line between two chartPoints (point pairs are auto-expanded).
Returns the same line handle.
Changes the line color. Only a string (color) argument is applied; a number/na is a no-op.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetColor(l, iff(close > open, "#26a69a", "#ef5350")) }
Green line when close is above open, red otherwise.
Returns the same line handle.
Extends the line beyond its endpoints. The value is lowercased; anything other than none/right/left/both is a no-op. Default is none.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetExtend(l, "right") }
Extends the line to the right (into the future).
lineSetFirstPoint(çizgi, nokta)
Returns the same line handle.
Sets the first endpoint from a chartPoint: if the point's bar and price fields are present, bar1/price1 update (missing fields are skipped).
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetFirstPoint(l, chartPointNew(barIndex-25, time, low)) }
Moves the first endpoint to a low point 25 bars ago.
lineSetSecondPoint(çizgi, nokta)
Returns the same line handle.
Sets the second endpoint from a chartPoint (bar2/price2).
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetSecondPoint(l, chartPointNow(high)) }
Moves the second endpoint to a high point on the current bar.
Returns the same line handle.
Changes the line style. A non-string value is a no-op.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetStyle(l, "dotted") }
Turns the line into a dotted style.
Returns the same line handle.
Sets the width. The value is clamped to 1–4 (1 is thinnest). A non-numeric value is a no-op.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetWidth(l, 3) }
Sets the line to width 3.
Returns the same line handle.
Changes only the HORIZONTAL position (bar1) of the first endpoint; the price is untouched.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetX1(l, barIndex-40) }
Moves the first endpoint 40 bars back, keeping its price.
Returns the same line handle.
Changes only the second endpoint's bar index (bar2).
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetX2(l, barIndex) }
Moves the end to the current bar.
Returns the same line handle.
Sets the line's horizontal placement unit: bar_index places by bar order, bar_time by timestamp.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetXloc(l, "bar_index") }
Puts the line in bar-index location mode.
Returns the same line handle (chainable).
Moves the FIRST endpoint (bar1, price1) together. If price is omitted, only the bar moves. Mutates the handle in place — no new line.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetXy1(l, barIndex-30, close) }
Moves the line's first endpoint 30 bars back and to the current close.
Returns the same line handle.
Moves the SECOND endpoint (bar2, price2) together. If price is omitted, only the bar updates.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetXy2(l, barIndex, close) }
Moves the line's end to the current bar and close.
Returns the same line handle.
Changes only the VERTICAL position (price1) of the first endpoint. If you pass a series, its value at the line's current bar1 index is used.
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetY1(l, close) }
Moves the first endpoint to the current close level.
Returns the same line handle.
Changes only the second endpoint's price level (price2).
if barstate.islast { l = lineNew(barIndex-15, low, barIndex, high) lineSetY2(l, high) }
Moves the end to the current high level.
Returns nothing (na); the fill no longer appears on the next draw.
Marks the fill deleted; it is excluded from output at flush time. The underlying lines are not deleted.
if barstate.islast { a = lineNew(barIndex-20, low, barIndex, low) b = lineNew(barIndex-20, high, barIndex, high) f = linefillNew(a, b, "#2962ff22") linefillDelete(f) }
Deletes the fill, leaving the two lines.
Returns the handle of the fill's first line.
Read-only; returns the first line handle passed when creating the fill (you can then modify that line separately).
if barstate.islast { a = lineNew(barIndex-20, low, barIndex, low) b = lineNew(barIndex-20, high, barIndex, high) f = linefillNew(a, b, "#2962ff22") lineSetColor(linefillGetLine1(f), "#26a69a") }
Colors the fill's first (lower) line green.
Returns the handle of the fill's second line.
Read-only; returns the second line handle passed when creating the fill.
if barstate.islast { a = lineNew(barIndex-20, low, barIndex, low) b = lineNew(barIndex-20, high, barIndex, high) f = linefillNew(a, b, "#2962ff22") lineSetColor(linefillGetLine2(f), "#ef5350") }
Colors the fill's second (upper) line red.
linefillNew(çizgi1, çizgi2, renk?)
Returns a line-fill handle shading the area between the two lines.
Shades the area between two lines; both arguments must be line handles or it errors. You usually pass an alpha color (e.g. #2962ff22).
if barstate.islast { a = lineNew(barIndex-20, low, barIndex, low) b = lineNew(barIndex-20, high, barIndex, high) f = linefillNew(a, b, "#2962ff22") }
A channel filling between the lower (low) and upper (high) lines in light blue.
Returns the same line-fill handle.
Changes the fill color. A non-string value is a no-op.
if barstate.islast { a = lineNew(barIndex-20, low, barIndex, low) b = lineNew(barIndex-20, high, barIndex, high) f = linefillNew(a, b) linefillSetColor(f, "#26a69a22") }
Turns the channel fill light green.
Returns an array of all currently existing (non-deleted) polyline handles (in creation order).
Equivalent to referans dil polyline.all. Count with arraySize, access with arrayGet; usually to loop and delete/update polylines on barstate.islast. Deleted handles are excluded.
Returns nothing (na); the polyline no longer appears on the next draw.
Marks the polyline deleted; it is excluded from output at flush time.
if barstate.islast { bi = array.new_int() pr = array.new_float() array.push(bi, barIndex-10) array.push(pr, low) array.push(bi, barIndex) array.push(pr, high) pl = polylineNew(bi, pr) polylineDelete(pl) }
Deletes the polyline right away.
polylineNew(barDizisi, fiyatDizisi, renk?, kalınlık?, curved?, closed?)
Returns a multi-segment (polyline) handle connecting the points in order.
Connects points taken from two arrays (bar + price) in order; it uses as many points as the shorter array. If a price element is a series, its last value is used. width is clamped to 1–4. Both arguments must be arrays; otherwise it errors.
if barstate.islast { bi = array.new_int() pr = array.new_float() array.push(bi, barIndex-20) array.push(pr, low) array.push(bi, barIndex-10) array.push(pr, high) array.push(bi, barIndex) array.push(pr, close) pl = polylineNew(bi, pr, "#2962ff", 2) }
A blue zigzag connecting three points (low→high→close).
Returns the same polyline handle.
Changes the polyline color. A non-string value is a no-op.
if barstate.islast { bi = array.new_int() pr = array.new_float() array.push(bi, barIndex-10) array.push(pr, low) array.push(bi, barIndex) array.push(pr, high) pl = polylineNew(bi, pr) polylineSetColor(pl, "#26a69a") }
Colors the polyline green.
Returns an array of all currently existing (non-deleted) table handles (in creation order).
Equivalent to referans dil table.all. Count with arraySize, access with arrayGet; usually to loop and delete/update tables on barstate.islast. Deleted handles are excluded.
tableCell(tablo, sütun, satır, metin, yazıRengi?, dolguRengi?)
Returns the same table handle.
Writes text into the (column, row) cell; optionally takes text and fill colors. If the text is a number/series it is auto-converted (a float is trimmed to 4 decimals, a series takes its last value).
t = tableNew("topRight", 2, 1) tableCell(t, 0, 0, "RSI", "#ffffff", "#26a69a") tableCell(t, 1, 0, str.tostring(rsi(close,14)))
A green-filled 'RSI' header at the top right with the current RSI value beside it.
tableCellSetBgcolor(tablo, sütun, satır, renk)
Returns nothing (na); updates the cell in place.
Sets a single cell's fill (background) color. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetBgcolor(t, 0, 0, "#26a69a")
Fills the cell green.
tableCellSetHeight(tablo, sütun, satır, yükseklik)
Returns nothing (na); updates the cell in place.
Sets a single cell's height as a percentage (0 = automatic). A non-numeric value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableCellSetHeight(t, 0, 0, 8)
Sets the cell height to 8% of the chart height.
tableCellSetText(tablo, sütun, satır, metin)
Returns nothing (na); updates the cell in place.
Changes an existing cell's text; the cell is created if absent. A number/series text is auto-converted.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "...") tableCellSetText(t, 0, 0, str.tostring(close))
Updates the cell text with the current close.
tableCellSetTextColor(tablo, sütun, satır, renk)
Returns nothing (na); updates the cell in place.
Sets a single cell's text color. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTextColor(t, 0, 0, "#ef5350")
Colors the cell text red.
tableCellSetTextFontFamily(tablo, sütun, satır, font)
Returns nothing (na); updates the cell in place.
Sets a single cell's font family. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTextFontFamily(t, 0, 0, "monospace")
Renders the cell in a monospace font.
tableCellSetTextFormatting(tablo, sütun, satır, biçim)
Returns nothing (na); updates the cell in place.
Applies bold/italic formatting to a single cell. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTextFormatting(t, 0, 0, "bold")
Renders the cell text in bold.
tableCellSetTextHalign(tablo, sütun, satır, hiza)
Returns nothing (na); updates the cell in place.
Sets a single cell's horizontal text alignment. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTextHalign(t, 0, 0, "right")
Right-aligns the cell text.
tableCellSetTextSize(tablo, sütun, satır, boyut)
Returns nothing (na); updates the cell in place.
Sets a single cell's text size. A name maps to its pixel equivalent; a number is clamped to 7–40.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Baslik") tableCellSetTextSize(t, 0, 0, "large")
Sets the cell text to 'large' size.
tableCellSetTextValign(tablo, sütun, satır, hiza)
Returns nothing (na); updates the cell in place.
Sets a single cell's vertical text alignment. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTextValign(t, 0, 0, "top")
Top-aligns the cell text.
tableCellSetTooltip(tablo, sütun, satır, metin)
Returns nothing (na); updates the cell in place.
Adds a hover tooltip to a single cell. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Deger") tableCellSetTooltip(t, 0, 0, "Son 14 barin RSI'i")
Adds an explanatory tooltip to the cell.
tableCellSetWidth(tablo, sütun, satır, genişlik)
Returns nothing (na); updates the cell in place.
Sets a single cell's width as a percentage (0 = automatic). A non-numeric value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableCellSetWidth(t, 0, 0, 10)
Sets the cell width to 10% of the chart width.
Returns nothing (na); all cells are emptied.
Clears all cell contents of the table; the table object and its position remain and can be refilled.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Eski") tableClear(t) tableCell(t, 0, 0, "Yeni")
Clears the cells and refills with a new value.
Returns nothing (na); the table no longer appears on the next draw.
Marks the table deleted; it is excluded from output at flush time.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") if rsi(close,14) < 30 { tableDelete(t) }
Deletes the panel while RSI is below 30.
tableMergeCells(tablo, c1, r1, c2, r2)
Returns nothing (na); the given range is merged into a single cell.
Merges the cells in the (c1,r1)–(c2,r2) rectangular range; handy for header rows.
t = tableNew("topRight", 2, 2) tableCell(t, 0, 0, "Baslik") tableMergeCells(t, 0, 0, 1, 0)
Merges the two top-row cells into a single header.
A table object; you fill its cells with tableCell(t, column, row, text).
Create it with tableNew, write cells with tableCell. The position is fixed to the chart (not tied to a bar); it stays in place when the chart scrolls.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "RSI: " + str.tostring(rsi(close,14)))
The current RSI value in a single cell at the top right.
t = tableNew("topRight", 2, 2) tableCell(t, 0, 0, "RSI") tableCell(t, 1, 0, str.tostring(rsi(close,14))) tableCell(t, 0, 1, "ATR") tableCell(t, 1, 1, str.tostring(atr(14)))
A 2x2 table at the top right: RSI and ATR rows.
Returns the same table handle.
Sets the table's overall background color. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableSetBg(t, "#1e222d")
Gives the table a dark background color.
tableSetBorderColor(tablo, renk)
Returns the same table handle.
Sets the color of the borders (grid) between cells. A non-string value is a no-op.
t = tableNew("topRight", 2, 2) tableCell(t, 0, 0, "A") tableSetBorderColor(t, "#787b86")
Makes the cell borders grey.
tableSetBorderWidth(tablo, kalınlık)
Returns the same table handle.
Sets the thickness of the cell border lines (integer). A non-numeric value is a no-op.
t = tableNew("topRight", 2, 2) tableCell(t, 0, 0, "A") tableSetBorderColor(t, "#787b86") tableSetBorderWidth(t, 2)
Sets the cell borders to 2 pixels.
tableSetFrameColor(tablo, renk)
Returns the same table handle.
Sets the color of the table's OUTER frame (separate from the cell borders). A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableSetFrameColor(t, "#2962ff")
Gives the panel a blue outer frame.
tableSetFrameWidth(tablo, kalınlık)
Returns the same table handle.
Sets the outer frame thickness (integer). A non-numeric value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableSetFrameColor(t, "#2962ff") tableSetFrameWidth(t, 2)
Sets the outer frame to 2 pixels.
tableSetPosition(tablo, konum)
Returns the same table handle.
Changes the table's corner/position on screen. A non-string value is a no-op.
t = tableNew("topRight", 1, 1) tableCell(t, 0, 0, "Panel") tableSetPosition(t, "bottomLeft")
Moves the panel to the bottom-left corner.