CODESCRIPT

Objects

118 entries. What each one takes, what it returns, and a working example.

boxAll()

Returns an array of all currently existing (non-deleted) box handles (in creation order).

NOTE

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.

boxCopy(kutu)

Returns a NEW box handle copying all properties of the source box.

kutu
box
A box handle created by boxNew.
NOTE

Creates an independent clone; changing the copy does not affect the original.

CODESCRIPT
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.

boxDelete(kutu)

Returns nothing (na); the box no longer appears on the next draw.

kutu
box
A box handle created by boxNew.
NOTE

Marks the box deleted; it is excluded from output at flush time.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-10, high, barIndex, low)
  if close > high {
    boxDelete(b)
  }
}

Deletes the box if close breaks above the high.

boxGetBottom(kutu)

Returns the bottom edge price (price2).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetBottom(b), "x")
}

Plots the bottom edge price.

boxGetLeft(kutu)

Returns the left edge bar index (bar1).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetLeft(b), "x")
}

Plots the left edge bar index.

boxGetRight(kutu)

Returns the right edge bar index (bar2).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetRight(b), "x")
}

Plots the right edge bar index.

boxGetTop(kutu)

Returns the top edge price (price1).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetTop(b), "x")
}

Plots the top edge price.

boxGetX1(kutu)

Returns the first corner's bar index (same value as boxGetLeft).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetX1(b), "x")
}

Plots the first corner's bar index.

boxGetX2(kutu)

Returns the second corner's bar index (same value as boxGetRight).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetX2(b), "x")
}

Plots the second corner's bar index.

boxGetY1(kutu)

Returns the first corner's price (same value as boxGetTop).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  plot(boxGetY1(b), "x")
}

Plots the first corner's price.

boxGetY2(kutu)

Returns the second corner's price (same value as boxGetBottom).

kutu
box
A box handle created by boxNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
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.

bar1
number
Bar index of the top-left corner (left edge).
fiyat1
number
Price of the top-left corner (top edge; series → its value at that bar).
bar2
number
Bar index of the bottom-right corner (right edge).
fiyat2
number
Price of the bottom-right corner (bottom edge).
renk
color
Optional. Border color (default blue #2962ff).
metin
string
Optional. Text inside the box.
NOTE

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.

TIP

Border color (color / boxSetColor / boxSetBorderColor) and fill color (boxSetBgColor) are SEPARATE properties; set both together.

CODESCRIPT
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'.

boxSetBgColor(kutu, renk)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
renk
color
New fill color (usually with a semi-transparent alpha).
NOTE

Sets the box's INTERIOR fill color. The fill is transparent by default; usually you pass an alpha color like #rrggbbAA.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetBgColor(b, "#ef535022")
}

Shades the box with a light red fill.

boxSetBorderColor(kutu, renk)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
renk
color
New border color.
NOTE

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.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetBorderColor(b, "#ffffff")
}

Colors the box border white.

boxSetBorderStyle(kutu, stil)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
stil
string
Border style: solid / dashed / dotted.
NOTE

Sets the border style. A non-string value is a no-op.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
kalınlık
number
Border width (pixels, integer).
NOTE

Sets the border thickness (rounded to an integer). A non-numeric value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetBorderWidth(b, 2)
}

Sets the box border to 2 pixels.

boxSetBottom(kutu, fiyat)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index.
NOTE

Moves the bottom edge (price2) to the given price.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
nokta
point
A chartPoint (bar+price drawing point).
NOTE

Sets the bottom-right corner from a chartPoint (bar2/price2).

CODESCRIPT
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.

boxSetColor(kutu, renk)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
renk
color
New border color.
NOTE

Changes the box border color. Not the fill — use boxSetBgColor for that. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetColor(b, "#26a69a")
}

Colors the box outline green.

boxSetExtend(kutu, yön)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
yön
string
Extension: none / left / right / both.
NOTE

Extends the box horizontally beyond its edges. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetExtend(b, "right")
}

Extends the box to the right.

boxSetLeft(kutu, bar)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index.
NOTE

Moves the left edge (bar1) to the given bar.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
bar
number
Bar index of the top-left corner.
fiyat
number
Price of the top-left corner.
NOTE

Sets the top-left corner (bar1 + price1) in one call; targets the same corner as boxSetXy1.

CODESCRIPT
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.

boxSetRight(kutu, bar)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index.
NOTE

Moves the right edge (bar2) to the given bar.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
bar
number
Bar index of the bottom-right corner.
fiyat
number
Price of the bottom-right corner.
NOTE

Sets the bottom-right corner (bar2 + price2) in one call.

CODESCRIPT
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.

boxSetText(kutu, metin)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
metin
string
Text to show inside the box.
NOTE

Changes the box text. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetText(b, "Arz Bolgesi")
}

Writes 'Supply Zone' inside the box.

boxSetTextColor(kutu, renk)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
renk
color
Text color.
NOTE

Sets the box text color. A non-string value is a no-op.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
font
string
Font family (e.g. default or monospace).
NOTE

Sets the box text's font family. A non-string value is a no-op.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
biçim
string
Text formatting: bold / italic (or both).
NOTE

Applies bold/italic formatting to the box text. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetText(b, "Onemli")
  boxSetTextFormatting(b, "bold")
}

Renders the text in bold.

boxSetTextHalign(kutu, hiza)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
hiza
string
Horizontal alignment: left / center / right.
NOTE

Sets the text's horizontal alignment inside the box. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetText(b, "Bolge")
  boxSetTextHalign(b, "left")
}

Left-aligns the text.

boxSetTextSize(kutu, boyut)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
boyut
string
Text size: tiny/small/normal/large/huge or a pixel number in 7–40.
NOTE

Sets the text size. A name maps to its pixel equivalent; a number is clamped to 7–40.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetText(b, "Bolge")
  boxSetTextSize(b, "large")
}

Sets the text to 'large' size.

boxSetTextValign(kutu, hiza)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
hiza
string
Vertical alignment: top / center / bottom.
NOTE

Sets the text's vertical alignment inside the box. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetText(b, "Bolge")
  boxSetTextValign(b, "top")
}

Top-aligns the text.

boxSetTextWrap(kutu, mod)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
mod
string
Text wrapping: none / auto.
NOTE

Turns line wrapping on/off so long text fits the box width. A non-string value is a no-op.

CODESCRIPT
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.

boxSetTop(kutu, fiyat)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index.
NOTE

Moves the top edge (price1) to the given price.

CODESCRIPT
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.

kutu
box
A box handle created by boxNew.
nokta
point
A chartPoint (bar+price drawing point).
NOTE

Sets the top-left corner from a chartPoint (bar1/price1); a missing field on the point is skipped.

CODESCRIPT
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.

boxSetXloc(kutu, mod)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
mod
string
Location mode: bar_index / bar_time.
NOTE

Sets the box's horizontal placement unit (bar order or timestamp). A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  b = boxNew(barIndex-15, high, barIndex, low)
  boxSetXloc(b, "bar_index")
}

Puts the box in bar-index location mode.

boxSetXy1(kutu, bar, fiyat)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index of the top-left corner.
fiyat
number
New price of the top-left corner.
NOTE

Moves the box's FIRST corner (top-left: bar1, price1) together. If price is omitted, only the bar moves.

CODESCRIPT
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.

boxSetXy2(kutu, bar, fiyat)

Returns the same box handle.

kutu
box
A box handle created by boxNew.
bar
number
New bar index of the bottom-right corner.
fiyat
number
New price of the bottom-right corner.
NOTE

Moves the box's SECOND corner (bottom-right: bar2, price2) together.

CODESCRIPT
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).

chartPointCopy(nokta)

Returns an independent copy of the given drawing point.

nokta
point
The chartPoint to copy.
NOTE

Copies all fields (index/time/price) of a chartPoint; changing the copy does not affect the original.

CODESCRIPT
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).

indeks
number
Bar index (defaults to the last bar).
fiyat
number
Price level.
NOTE

Builds a chartPoint from index + price; it carries no time, so it suits bar_index placement.

CODESCRIPT
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).

zaman
number
Timestamp.
fiyat
number
Price level.
NOTE

Builds a chartPoint from time + price; it suits bar_time placement (alignment holds across timeframes).

CODESCRIPT
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.

indeks
number
Bar index (defaults to the last bar).
zaman
number
Timestamp (for bar_time placement).
fiyat
number
Price level (series → its last value).
NOTE

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.

CODESCRIPT
if barstate.islast {
  p1 = chartPointNew(barIndex-10, time, low)
  p2 = chartPointNow(high)
  l = lineNew(p1, p2, "#26a69a")
}

Draws a green line between two chartPoints.

chartPointNow(fiyat)

Returns a drawing point at the last bar's index.

fiyat
number
Price level (series → its last value).
NOTE

Builds a chartPoint from the current (last) bar's index + the given price; the most common shortcut in live drawings.

CODESCRIPT
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.

labelAll()

Returns an array of all currently existing (non-deleted) label handles (in creation order).

NOTE

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.

labelCopy(etiket)

Returns a NEW label handle copying all properties of the source label.

etiket
label
A label handle created by labelNew.
NOTE

Creates an independent clone; changing the copy does not affect the original.

CODESCRIPT
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.

labelDelete(etiket)

Returns nothing (na); the label no longer appears on the next draw.

etiket
label
A label handle created by labelNew.
NOTE

Marks the label deleted; it is excluded from output at flush time. Later calls on a deleted handle have no effect.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  if close < open {
    labelDelete(e)
  }
}

Deletes the label on a down bar.

labelGetText(etiket)

Returns the label's text (string); an empty string if the handle is invalid.

etiket
label
A label handle created by labelNew.
NOTE

Read-only; does not mutate the label.

CODESCRIPT
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.

labelGetX(etiket)

Returns the label's horizontal position: time (ms) if xloc is bar_time, otherwise the bar index.

etiket
label
A label handle created by labelNew.
NOTE

Read-only; returns the raw x value in the xloc unit (no resolution). Returns na if unset.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "X", barIndex)
  plot(labelGetX(e), "x")
}

Plots the label's bar index.

labelGetY(etiket)

Returns the label's price level; na if unset.

etiket
label
A label handle created by labelNew.
NOTE

Read-only; does not mutate the label.

CODESCRIPT
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.

price
number
Vertical position of the label (price level).
text
string
Label text (per-bar scalar; can be dynamic via str.tostring).
bar
number
Optional. Bar index (default last bar).
color
color
Optional. Background color (default blue #2962ff).
size
string
Optional. tiny/small/normal/large/huge or a pixel number (default normal).
NOTE

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.

TIP

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.

CODESCRIPT
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.

CODESCRIPT
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.

labelSetColor(etiket, renk)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
renk
color
New background color; passing na hides the box/arrow.
NOTE

Sets the label background color. Passing na (None) hides the box (only the text remains); a string applies the color.

CODESCRIPT
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.

labelSetPoint(etiket, nokta)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
nokta
point
A chartPoint (index+time+price drawing point).
NOTE

Positions the label from a chartPoint: bar index, time and price are all written (time is preserved).

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetPoint(e, chartPointNow(high))
}

Moves the label to a high point on the current bar.

labelSetSize(etiket, boyut)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
boyut
string
Size: tiny/small/normal/large/huge or 7–40 pixels.
NOTE

Sets the label font size. A name maps to its pixel equivalent; a number is clamped to 7–40.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetSize(e, "large")
}

Sets the label to 'large' size.

labelSetStyle(etiket, stil)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
stil
string
Label style: label_up / label_down / label_left / label_right / none.
NOTE

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.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetStyle(e, "label_up")
}

Turns the label into an upward-pointing style.

labelSetText(etiket, metin)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
metin
string
New label text.
NOTE

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.

CODESCRIPT
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.

etiket
label
A label handle created by labelNew.
font
string
Font family (e.g. default or monospace).
NOTE

Sets the label text's font family. A non-string value is a no-op.

CODESCRIPT
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.

etiket
label
A label handle created by labelNew.
biçim
string
Text formatting: bold / italic.
NOTE

Applies bold/italic formatting to the label text. A non-string value is a no-op.

CODESCRIPT
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.

etiket
label
A label handle created by labelNew.
hiza
string
Text alignment: left / center / right.
NOTE

Sets the alignment of multi-line label text. A non-string value is a no-op.

CODESCRIPT
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.

etiket
label
A label handle created by labelNew.
renk
color
Text color; passing na hides the text.
NOTE

Sets the label text color. Passing na (None) hides the text; a string applies the color.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetTextcolor(e, "#000000")
}

Colors the text black.

labelSetTooltip(etiket, metin)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
metin
string
Tooltip text shown on hover.
NOTE

Adds a tooltip to the label that appears on hover. A non-string value is a no-op.

CODESCRIPT
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.

labelSetX(etiket, bar)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
bar
number
New horizontal position (the label's xloc unit).
NOTE

Changes only the label's horizontal position; the price is untouched. x is written in the label's xloc unit.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetX(e, barIndex-5)
}

Moves the label 5 bars back.

labelSetXloc(etiket, x, xloc)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
x
number
New horizontal position (in the mode unit below).
mod
string
Location mode: bar_index or bar_time.
NOTE

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.

CODESCRIPT
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.

etiket
label
A label handle created by labelNew.
bar
number
New horizontal position (bar or time, per the label's xloc unit).
fiyat
number
New price level.
NOTE

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).

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetXy(e, barIndex, high)
}

Moves the label to the current bar and high level.

labelSetY(etiket, fiyat)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
fiyat
number
New price level; na leaves it position-less.
NOTE

Changes only the label's vertical (price) position. Passing na (None) drops the price (meaningful with abovebar/belowbar yloc).

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetY(e, high)
}

Moves the label to the current high level.

labelSetYloc(etiket, mod)

Returns the same label handle.

etiket
label
A label handle created by labelNew.
mod
string
Vertical location mode: price / abovebar / belowbar.
NOTE

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.

CODESCRIPT
if barstate.islast {
  e = labelNew(close, "Not", barIndex)
  labelSetYloc(e, "abovebar")
}

Pins the label above the bar.

lineAll()

Returns an array of all currently existing (non-deleted) line handles (in creation order).

NOTE

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.

lineCopy(çizgi)

Returns a NEW line handle copying all properties of the source line.

çizgi
line
A line handle created by lineNew.
NOTE

Creates an independent clone; changing the copy does not affect the original. Returns na for an invalid handle.

CODESCRIPT
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.

lineDelete(çizgi)

Returns nothing (na); the line no longer appears on the next draw.

çizgi
line
A line handle created by lineNew.
NOTE

Marks the line deleted — it is excluded from the output list at flush time. Later calls on a deleted handle have no effect.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-10, low, barIndex, high)
  if close < low {
    lineDelete(l)
  }
}

Deletes the line if close drops below the low.

lineGetPrice(çizgi, bar)

Returns the line's price at the given bar (linear inter/extrapolation); if both ends share a bar, price1 is returned.

çizgi
line
A line handle created by lineNew.
bar
number
The bar index at which to read the price.
NOTE

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.

CODESCRIPT
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.

lineGetX1(çizgi)

Returns the first endpoint's bar index (as a float).

çizgi
line
A line handle created by lineNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  plot(lineGetX1(l), "x")
}

Plots the first endpoint's bar index.

lineGetX2(çizgi)

Returns the second endpoint's bar index.

çizgi
line
A line handle created by lineNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  plot(lineGetX2(l), "x")
}

Plots the second endpoint's bar index.

lineGetY1(çizgi)

Returns the first endpoint's price level.

çizgi
line
A line handle created by lineNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  plot(lineGetY1(l), "x")
}

Plots the first endpoint's price.

lineGetY2(çizgi)

Returns the second endpoint's price level.

çizgi
line
A line handle created by lineNew.
NOTE

Read-only; does not mutate the handle. Returns na for an invalid handle.

CODESCRIPT
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.

bar1
number
First endpoint bar index (horizontal position). If na, the line is created first and positioned later with lineSetXy1.
fiyat1
number
First endpoint price level (scalar or a series → its value at that bar).
bar2
number
Second endpoint bar index.
fiyat2
number
Second endpoint price level.
renk
color
Optional. Line color (default blue #2962ff).
stil
string
Optional. Line style: solid/dashed/dotted (default solid).
NOTE

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.

TIP

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.

CODESCRIPT
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.

CODESCRIPT
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).

lineSetColor(çizgi, renk)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
renk
color
New line color (hex or a color constant).
NOTE

Changes the line color. Only a string (color) argument is applied; a number/na is a no-op.

CODESCRIPT
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.

lineSetExtend(çizgi, yön)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
yön
string
Extension direction: none / right / left / both.
NOTE

Extends the line beyond its endpoints. The value is lowercased; anything other than none/right/left/both is a no-op. Default is none.

CODESCRIPT
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.

çizgi
line
A line handle created by lineNew.
nokta
point
A chartPoint (drawing point carrying bar+price).
NOTE

Sets the first endpoint from a chartPoint: if the point's bar and price fields are present, bar1/price1 update (missing fields are skipped).

CODESCRIPT
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.

çizgi
line
A line handle created by lineNew.
nokta
point
A chartPoint (drawing point carrying bar+price).
NOTE

Sets the second endpoint from a chartPoint (bar2/price2).

CODESCRIPT
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.

lineSetStyle(çizgi, stil)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
stil
string
Line style: solid / dashed / dotted.
NOTE

Changes the line style. A non-string value is a no-op.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetStyle(l, "dotted")
}

Turns the line into a dotted style.

lineSetWidth(çizgi, kalınlık)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
kalınlık
number
Line width; clamped to the 1–4 range.
NOTE

Sets the width. The value is clamped to 1–4 (1 is thinnest). A non-numeric value is a no-op.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetWidth(l, 3)
}

Sets the line to width 3.

lineSetX1(çizgi, bar)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
bar
number
New bar index of the first endpoint (rounded to an integer).
NOTE

Changes only the HORIZONTAL position (bar1) of the first endpoint; the price is untouched.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetX1(l, barIndex-40)
}

Moves the first endpoint 40 bars back, keeping its price.

lineSetX2(çizgi, bar)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
bar
number
New bar index of the second endpoint.
NOTE

Changes only the second endpoint's bar index (bar2).

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetX2(l, barIndex)
}

Moves the end to the current bar.

lineSetXloc(çizgi, mod)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
mod
string
Location mode: bar_index (bar order) or bar_time (timestamp).
NOTE

Sets the line's horizontal placement unit: bar_index places by bar order, bar_time by timestamp.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetXloc(l, "bar_index")
}

Puts the line in bar-index location mode.

lineSetXy1(çizgi, bar, fiyat)

Returns the same line handle (chainable).

çizgi
line
A line handle created by lineNew.
bar
number
New bar index of the first endpoint.
fiyat
number
New price level of the first endpoint (series → its value at that bar).
NOTE

Moves the FIRST endpoint (bar1, price1) together. If price is omitted, only the bar moves. Mutates the handle in place — no new line.

CODESCRIPT
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.

lineSetXy2(çizgi, bar, fiyat)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
bar
number
New bar index of the second endpoint.
fiyat
number
New price level of the second endpoint.
NOTE

Moves the SECOND endpoint (bar2, price2) together. If price is omitted, only the bar updates.

CODESCRIPT
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.

lineSetY1(çizgi, fiyat)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
fiyat
number
New price level of the first endpoint (series → its value at bar1).
NOTE

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.

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetY1(l, close)
}

Moves the first endpoint to the current close level.

lineSetY2(çizgi, fiyat)

Returns the same line handle.

çizgi
line
A line handle created by lineNew.
fiyat
number
New price level of the second endpoint.
NOTE

Changes only the second endpoint's price level (price2).

CODESCRIPT
if barstate.islast {
  l = lineNew(barIndex-15, low, barIndex, high)
  lineSetY2(l, high)
}

Moves the end to the current high level.

linefillDelete(dolgu)

Returns nothing (na); the fill no longer appears on the next draw.

dolgu
linefill
A line-fill handle created by linefillNew.
NOTE

Marks the fill deleted; it is excluded from output at flush time. The underlying lines are not deleted.

CODESCRIPT
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.

linefillGetLine1(dolgu)

Returns the handle of the fill's first line.

dolgu
linefill
A line-fill handle created by linefillNew.
NOTE

Read-only; returns the first line handle passed when creating the fill (you can then modify that line separately).

CODESCRIPT
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.

linefillGetLine2(dolgu)

Returns the handle of the fill's second line.

dolgu
linefill
A line-fill handle created by linefillNew.
NOTE

Read-only; returns the second line handle passed when creating the fill.

CODESCRIPT
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.

çizgi1
line
The first line handle (lineNew).
çizgi2
line
The second line handle.
renk
color
Optional. Fill color (default blue #2962ff, usually with alpha).
NOTE

Shades the area between two lines; both arguments must be line handles or it errors. You usually pass an alpha color (e.g. #2962ff22).

CODESCRIPT
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.

linefillSetColor(dolgu, renk)

Returns the same line-fill handle.

dolgu
linefill
A line-fill handle created by linefillNew.
renk
color
New fill color.
NOTE

Changes the fill color. A non-string value is a no-op.

CODESCRIPT
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.

polylineAll()

Returns an array of all currently existing (non-deleted) polyline handles (in creation order).

NOTE

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.

polylineDelete(çoklu)

Returns nothing (na); the polyline no longer appears on the next draw.

çoklu
polyline
A polyline handle created by polylineNew.
NOTE

Marks the polyline deleted; it is excluded from output at flush time.

CODESCRIPT
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.

barDizisi
array
An array of bar indexes (array.new_int/array.new_float).
fiyatDizisi
array
An array of price levels; in the same order as the bar array.
renk
color
Optional. Line color (default blue #2962ff).
kalınlık
number
Optional. Line width 1–4 (default 1).
NOTE

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.

CODESCRIPT
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).

polylineSetColor(çoklu, renk)

Returns the same polyline handle.

çoklu
polyline
A polyline handle created by polylineNew.
renk
color
New line color.
NOTE

Changes the polyline color. A non-string value is a no-op.

CODESCRIPT
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.

tableAll()

Returns an array of all currently existing (non-deleted) table handles (in creation order).

NOTE

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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
metin
string
Cell text (a number/series is converted to text; a series → its last value).
yazıRengi
color
Optional. Text color.
dolguRengi
color
Optional. Cell fill color.
NOTE

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).

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
renk
color
Cell fill color.
NOTE

Sets a single cell's fill (background) color. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
yükseklik
number
Cell height (as a percentage of the chart height).
NOTE

Sets a single cell's height as a percentage (0 = automatic). A non-numeric value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
metin
string
New cell text (a number/series is converted to text).
NOTE

Changes an existing cell's text; the cell is created if absent. A number/series text is auto-converted.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
renk
color
Cell text color.
NOTE

Sets a single cell's text color. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
font
string
Font family (e.g. monospace).
NOTE

Sets a single cell's font family. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
biçim
string
Text formatting: bold / italic.
NOTE

Applies bold/italic formatting to a single cell. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
hiza
string
Horizontal alignment: left / center / right.
NOTE

Sets a single cell's horizontal text alignment. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
boyut
string
Text size: tiny/small/normal/large/huge or 7–40 pixels.
NOTE

Sets a single cell's text size. A name maps to its pixel equivalent; a number is clamped to 7–40.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
hiza
string
Vertical alignment: top / center / bottom.
NOTE

Sets a single cell's vertical text alignment. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
metin
string
Tooltip text.
NOTE

Adds a hover tooltip to a single cell. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
sütun
number
Column index (0-based).
satır
number
Row index (0-based).
genişlik
number
Cell width (as a percentage of the chart width).
NOTE

Sets a single cell's width as a percentage (0 = automatic). A non-numeric value is a no-op.

CODESCRIPT
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.

tableClear(tablo)

Returns nothing (na); all cells are emptied.

tablo
table
A table handle created by tableNew.
NOTE

Clears all cell contents of the table; the table object and its position remain and can be refilled.

CODESCRIPT
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.

tableDelete(tablo)

Returns nothing (na); the table no longer appears on the next draw.

tablo
table
A table handle created by tableNew.
NOTE

Marks the table deleted; it is excluded from output at flush time.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
c1
number
Start column of the merge range (0-based).
r1
number
Start row.
c2
number
End column.
r2
number
End row.
NOTE

Merges the cells in the (c1,r1)–(c2,r2) rectangular range; handy for header rows.

CODESCRIPT
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.

tableNew(konum, sütun, satır)

A table object; you fill its cells with tableCell(t, column, row, text).

konum
string
Position: topRight/topLeft/bottomRight/bottomLeft/middleCenter etc.
sütun
number
Number of columns.
satır
number
Number of rows.
NOTE

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.

CODESCRIPT
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.

CODESCRIPT
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.

tableSetBg(tablo, renk)

Returns the same table handle.

tablo
table
A table handle created by tableNew.
renk
color
Table background (fill) color.
NOTE

Sets the table's overall background color. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
renk
color
Cell border color.
NOTE

Sets the color of the borders (grid) between cells. A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
kalınlık
number
Cell border width (pixels, integer).
NOTE

Sets the thickness of the cell border lines (integer). A non-numeric value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
renk
color
Outer frame color.
NOTE

Sets the color of the table's OUTER frame (separate from the cell borders). A non-string value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
kalınlık
number
Outer frame width (pixels, integer).
NOTE

Sets the outer frame thickness (integer). A non-numeric value is a no-op.

CODESCRIPT
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.

tablo
table
A table handle created by tableNew.
konum
string
Position: topRight/topLeft/bottomRight/bottomLeft/middleCenter etc.
NOTE

Changes the table's corner/position on screen. A non-string value is a no-op.

CODESCRIPT
t = tableNew("topRight", 1, 1)
tableCell(t, 0, 0, "Panel")
tableSetPosition(t, "bottomLeft")

Moves the panel to the bottom-left corner.