> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Plots and drawings across languages

> How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for plots and drawings: plot a series, plot styles, mark bars with a shape, mark bars with a character, up and down arrows, draw your own candles or bars and more, with the differences that matter when converting.

Putting values, shapes, colours, objects and tables on the chart. Each row maps one concept from Lipi to the other languages; the word in a cell is the relation, explained in the [language map overview](https://gocharting.com/docs/scripting/reference/language-map.md#relations).

| Concept | Lipi | MQL4 | MQL5 | NinjaScript | Pine Script | thinkScript |
| - | - | - | - | - | - | - |
| [Plot a series](#plot-line) | `plot` | Composite | Composite | Caveat | Caveat | Caveat |
| [Plot styles](#plot-style) | `plotStyle` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Mark bars with a shape](#plot-shape) | `plotshape` | Composite | Composite | Composite | Caveat | Caveat |
| [Mark bars with a character](#plot-char) | `plotchar` | Composite | Caveat | Composite | Caveat | Caveat |
| [Up and down arrows](#plot-arrow) | `plotarrow` | Composite | Composite | Composite | Caveat | Composite |
| [Draw your own candles or bars](#plot-candles) | `plotcandle`, `plotbar` | Absent | Caveat | Absent | Caveat | Absent |
| [Horizontal level](#plot-hline) | `hline` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Fill between two plots](#plot-fill) | `fill` | Absent | Caveat | Caveat | Caveat | Caveat |
| [Colour the background](#plot-bgcolor) | `bgcolor` | Absent | Absent | Caveat | Caveat | Caveat |
| [Colour the bars](#plot-barcolor) | `barcolor` | Absent | Caveat | Caveat | Caveat | Caveat |
| [Where a plot is shown](#plot-display) | `display` | Caveat | Caveat | Composite | Caveat | Composite |
| [Colour with transparency](#color-transparency) | `color.new` | Differs | Differs | Differs | Differs | Absent |
| [Colour from red, green, blue](#color-rgb) | `color.rgb` | Differs | Caveat | Caveat | Differs | Caveat |
| [Colour on a gradient](#color-gradient) | `color.from_gradient` | Absent | Absent | Absent | Caveat | Differs |
| [Line object](#draw-line) | `line.new`, `line.delete` | Differs | Caveat | Differs | Caveat | Absent |
| [Change a line object](#draw-line-update) | `line.set_xy1`, `line.set_xy2`, `line.set_color`, `line.set_width`, `line.set_style`, `line.set_extend` | Caveat | Composite | Caveat | Exact | Absent |
| [Text label object](#draw-label) | `label.new`, `label.set_text`, `label.set_xy`, `label.delete` | Differs | Composite | Caveat | Caveat | Caveat |
| [Rectangle object](#draw-box) | `box.new`, `box.set_lefttop`, `box.set_rightbottom`, `box.delete` | Caveat | Caveat | Caveat | Caveat | Absent |
| [Multi-point line object](#draw-polyline) | `polyline.new` | Absent | Absent | Caveat | Caveat | Absent |
| [Fill between two line objects](#draw-linefill) | `linefill.new` | Absent | Absent | Caveat | Exact | Absent |
| [Chart point](#draw-point) | `chartPoint.new`, `chartPoint.from_index`, `chartPoint.from_time` | Absent | Caveat | Caveat | Caveat | Absent |
| [Place objects by time](#draw-x-by-time) | `xloc` | Caveat | Caveat | Caveat | Exact | Absent |
| [Draw beyond the last bar](#draw-future-bars) | `xloc` | Unresolved | Unresolved | Unresolved | Caveat | Caveat |
| [How many objects a script keeps](#draw-object-limits) | `indicator` | Unresolved | Unresolved | Unresolved | Caveat | Absent |
| [List the script's objects](#draw-all-objects) | `line.all`, `label.all`, `box.all` | Composite | Composite | Caveat | Exact | Absent |
| [Table on the chart](#draw-table) | `table.new`, `table.cell` | Absent | Absent | Absent | Caveat | Absent |
| [Change table cells](#draw-table-update) | `table.cell_set_text`, `table.cell_set_bgcolor`, `table.merge_cells` | Absent | Absent | Absent | Caveat | Absent |
| [Text alignment and size](#draw-text-align) | `text`, `size` | Caveat | Caveat | Caveat | Caveat | Caveat |

Each section below gives the Lipi construct first, then the construct in each language, with a note wherever behaviour differs. The language name links to the documentation the row was checked against.

## Plot a series

Drawing one value per bar as a line or other style.

In Lipi: `plot`. `plot` must be called at top level, never in a function, if or loop; make it conditional through its arguments. `title` must be const.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setindexstyle) | `SetIndexBuffer + SetIndexStyle(DRAW_LINE)` | Built from several Lipi constructs | Bind a double array with SetIndexBuffer, set style with SetIndexStyle, then write each bar's value into the array; at most 8 lines. History indexing: Buffer array index 0 is the oldest bar unless ArraySetAsSeries is called. |
| [MQL5](https://www.mql5.com/en/docs/customind/setindexbuffer) | SetIndexBuffer + #property indicator\_type1 DRAW\_LINE | Built from several Lipi constructs | Needs a double buffer bound with SetIndexBuffer, indicator\_buffers and indicator\_plots counts, a draw type, and your loop writing each bar's value. History indexing: Buffers index from the oldest bar unless flagged as series. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/addplot.htm) | AddPlot(); Values\[i]\[0] = x | Equivalent, with a caveat | Plots are declared once in OnStateChange; each bar you assign Values\[i]\[0]. Plots show only after BarsRequiredToPlot bars (default 20). Warm-up and missing values: A 20-bar delay applies before any plot value appears unless BarsRequiredToPlot is changed. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_plot) | `plot()` | Equivalent, with a caveat | Pine plot has extra arguments Lipi lacks: join, editable, show\_last, precision and linestyle. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/plot) | `plot` | Equivalent, with a caveat | A named statement; colour and style come from methods such as SetDefaultColor(); the plot may be declared first and assigned inside if. |

## Plot styles

The ways a plotted series can be drawn: line, histogram, area, circles, steps and others.

In Lipi: `plotStyle`. Members: line, linebr, area, areabr, smoothedArea, stepLine, stepLinebr, stepArea, stepAreabr, bar, histogram, scatter, triangular, cross. No columns member.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/drawstyles) | `DRAW_LINE, DRAW_SECTION, DRAW_HISTOGRAM, DRAW_ARROW, DRAW_ZIGZAG, DRAW_NONE` | Equivalent, with a caveat | Only six draw styles; no area, step, circles or cross styles. Line styles solid, dash, dot, dash-dot, dash-dot-dot; width 1 to 5. |
| [MQL5](https://www.mql5.com/en/docs/constants/indicatorconstants/drawstyles) | ENUM\_DRAW\_TYPE (DRAW\_LINE, DRAW\_SECTION, DRAW\_HISTOGRAM, DRAW\_ARROW, DRAW\_ZIGZAG, DRAW\_FILLING ...) | Equivalent, with a caveat | Eighteen draw types chosen per plot; styles needing several buffers consume them in order, and colour variants add a colour-index buffer. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/addplot.htm) | `PlotStyle enum` | Equivalent, with a caveat | Listed styles: Bar (histogram-like), Block, Cross, Dot, Hash, HLine, Line, PriceBox, Square and four triangles. No area or step style is listed. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | plot.style\_line, style\_linebr, style\_area, style\_areabr, style\_histogram, style\_columns, style\_circles, style\_cross, style\_stepline, style\_steplinebr, style\_stepline\_diamond | Equivalent, with a caveat | Constants become plotStyle.X: columns is bar, circles is scatter, stepline is stepLine. stepline\_diamond has no Lipi member. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/SetPaintingStrategy) | `SetPaintingStrategy(PaintingStrategy.*)` | Equivalent, with a caveat | Style is a method on the plot using PaintingStrategy constants such as LINE, HISTOGRAM, POINTS, SQUARES, DASHES and HORIZONTAL; names differ from plotStyle. |

## Mark bars with a shape

Drawing a shape above, below or on bars where a condition holds.

In Lipi: `plotshape`. The argument is named `shape`, not `style`. A size string that is not a size name stops the compiler with `internal validator error`.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setindexarrow) | `DRAW_ARROW + SetIndexArrow(index, code)` | Built from several Lipi constructs | One arrow glyph code per buffer, drawn at the buffer value; no above/below placement, so set the value to high plus an offset yourself. |
| [MQL5](https://www.mql5.com/en/docs/customind/indicators_examples/draw_arrow) | DRAW\_ARROW with PLOT\_ARROW (Wingdings code); OBJ\_ARROW objects | Built from several Lipi constructs | Draws a Wingdings symbol where the buffer holds a value; the condition becomes a buffer filled with a price or EMPTY\_VALUE. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawing.htm) | Draw\.TriangleUp / TriangleDown / Diamond / Dot / Square, or PlotStyle.TriangleUp | Built from several Lipi constructs | No plotshape call: draw an object per bar with a unique tag (often CurrentBar in the tag) at a y price you offset yourself. State and side effects: Reusing a tag edits the same object; unique tags create one object per bar. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_plotshape) | `plotshape()` | Equivalent, with a caveat | Pine's style argument is named shape in Lipi; the shape.\* and location.\* constants keep their names and positions line up. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/PaintingStrategy/PaintingStrategy-BOOLEAN-ARROW-UP) | SetPaintingStrategy(PaintingStrategy.BOOLEAN\_ARROW\_UP / BOOLEAN\_ARROW\_DOWN / BOOLEAN\_WEDGE\_UP / BOOLEAN\_WEDGE\_DOWN / BOOLEAN\_POINTS) | Equivalent, with a caveat | Plot a true/false condition and pick a boolean painting strategy; shapes are limited to arrows, wedges and points, placed by the constant. |

## Mark bars with a character

Drawing a text character above, below or on bars where a condition holds.

In Lipi: `plotchar`. Only the first character of `char` is used.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setindexarrow) | DRAW\_ARROW + SetIndexArrow(index, Wingdings code); OBJ\_TEXT | Built from several Lipi constructs | A glyph is a Wingdings code per buffer, not a free character; arbitrary text needs an OBJ\_TEXT object. |
| [MQL5](https://www.mql5.com/en/docs/customind/indicators_examples/draw_arrow) | `DRAW_ARROW with PLOT_ARROW` | Equivalent, with a caveat | Characters come from the Wingdings set by code number (default 159); vertical offset in pixels via PLOT\_ARROW\_SHIFT. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_text.htm) | `Draw.Text(owner, tag, text, barsAgo, y, textBrush)` | Built from several Lipi constructs | Draw\.Text per bar with the character as text and a unique tag; position is a y price you compute, not above or below the bar. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_plotchar) | `plotchar()` | Equivalent, with a caveat | Lipi plotchar lacks editable, show\_last, precision; positional order differs after textcolor; float series draw at that price, whereas Pine treats them as bool. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble) | `AddChartBubble` | Equivalent, with a caveat | Nearest form is a text bubble pointing at a price you choose; there is no single-character marker with location presets. |

## Up and down arrows

Drawing arrows whose direction follows the sign of a value.

In Lipi: `plotarrow`. Arguments are colorup, colordown, minheight and maxheight; call it at top level only.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setindexarrow) | `DRAW_ARROW with up and down buffers` | Built from several Lipi constructs | Arrow direction is not driven by value sign; use one buffer per direction with matching arrow codes, or arrow objects. |
| [MQL5](https://www.mql5.com/en/docs/constants/indicatorconstants/drawstyles) | DRAW\_COLOR\_ARROW; OBJ\_ARROW\_UP; OBJ\_ARROW\_DOWN | Built from several Lipi constructs | Direction does not follow a value's sign: use two arrow plots, or one colour-indexed arrow plot, each fed by your own buffers. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_arrowup.htm) | `Draw.ArrowUp() / Draw.ArrowDown()` | Built from several Lipi constructs | Choose ArrowUp or ArrowDown yourself from the sign of the value; each call needs a unique tag and a y price. Size follows bar width. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_plotarrow) | `plotarrow()` | Equivalent, with a caveat | Lipi plotarrow omits editable, show\_last and precision, and its positional order after maxheight differs from Pine. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/PaintingStrategy/PaintingStrategy-ARROW-UP) | `PaintingStrategy.ARROW_UP / PaintingStrategy.ARROW_DOWN` | Built from several Lipi constructs | Direction comes from the constant, not from the sign of a value: plot two series, one with ARROW\_UP and one with ARROW\_DOWN. |

## Draw your own candles or bars

Drawing open-high-low-close candles or bars from values the script computes.

In Lipi: `plotcandle`, `plotbar`. plotcandle takes open, high, low, close and a color, plus wickcolor and bordercolor; plotbar takes the same without them.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/drawstyles) | | Not in MQL4 | No candle or bar draw style among the six; build wicks and bodies from histogram buffers or objects. |
| [MQL5](https://www.mql5.com/en/docs/customind/indicators_examples/draw_color_candles) | DRAW\_CANDLES; DRAW\_BARS; DRAW\_COLOR\_CANDLES | Equivalent, with a caveat | Four buffers in fixed order open, high, low, close, plus a colour-index buffer for the colour variants. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/alphabetical_reference.htm) | | Not in NinjaScript | No custom-OHLC plot call. Draw per-bar Draw\.Rectangle and Draw\.Line, custom-render in OnRender, or build a custom bars type. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | `plotcandle(), plotbar()` | Equivalent, with a caveat | Lipi plotcandle and plotbar omit editable, show\_last, format and precision; bordercolor sits earlier in Lipi's positional order. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel) | | Not in thinkScript | No function draws computed open-high-low-close candles or bars; Look and Feel only recolours the chart's own bars (AssignPriceColor) or sets the chart type. |

## Horizontal level

A fixed horizontal line at a price or value.

In Lipi: `hline`. `price` must be an input float, not a series. Style is hlineStyle.solid, dashed or dotted; there is no force\_overlay.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setlevelvalue) | #property indicator\_levelN / SetLevelValue(level, value) / OBJ\_HLINE | Equivalent, with a caveat | Levels (0 to 31) show only in a separate-window indicator; on the main chart use an OBJ\_HLINE object. |
| [MQL5](https://www.mql5.com/en/docs/basis/preprosessor/compilation) | #property indicator\_level1; indicator\_levelcolor; OBJ\_HLINE | Equivalent, with a caveat | Levels apply only in a separate indicator window; on the price chart use an OBJ\_HLINE object instead. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/addline.htm) | `AddLine(Brush, double value, string name)` | Equivalent, with a caveat | The level is fixed when the script is configured. For a level that moves per bar use Draw\.HorizontalLine or a plot. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_hline) | `hline()` | Equivalent, with a caveat | Pine takes linestyle (hline.style\_*) before linewidth; Lipi orders linewidth first, names the argument style and uses hlineStyle.*. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Others/FPL) | `plot <name> = <constant>` | Equivalent, with a caveat | A horizontal level is a plot of a constant, for example plot ZeroLine = 0; there is no dedicated hline call. |

## Fill between two plots

Shading the area between two plots or two levels.

In Lipi: `fill`. Fill two plots or two hlines, never one of each. The third and fourth arguments swap between the plot form and the hline form.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/drawstyles) | | Not in MQL4 | No fill draw style between plots or levels; use DRAW\_HISTOGRAM or rectangle objects as a stand-in. |
| [MQL5](https://www.mql5.com/en/docs/customind/indicators_examples/draw_filling) | `DRAW_FILLING` | Equivalent, with a caveat | Needs two buffers; both colours are set together with #property indicator\_color1 or PLOT\_LINE\_COLOR. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_region.htm) | `Draw.Region()` | Equivalent, with a caveat | One call fills over a bar range (CurrentBar down to 0) between two series, or a series and a price. Opacity is int 0-100. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_fill) | `fill()` | Equivalent, with a caveat | Pine's plot form takes color third; Lipi's plot form takes title third and color fourth. Name the arguments when converting. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud) | `AddCloud` | Equivalent, with a caveat | Takes two colours chosen by which series is higher, is translucent with no alpha argument, and its border is off unless showBorder is yes. |

## Colour the background

Colouring the chart background behind chosen bars.

In Lipi: `bgcolor`. An na colour means no background colour. `display` accepts only display.none and display.all when added to the chart.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/drawstyles) | | Not in MQL4 | No per-bar background colouring; closest are rectangle objects behind price. |
| [MQL5](https://www.mql5.com/en/docs/constants/chartconstants/enum_chart_property) | | Not in MQL5 | No per-bar background colouring; the chart property CHART\_COLOR\_BACKGROUND recolours the whole chart only. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/backbrush.htm) | `BackBrush` | Equivalent, with a caveat | Assign BackBrush on each bar; null restores the default colour (Lipi uses na). It affects only the script's own panel; BackBrushAll covers all panels. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_bgcolor) | `bgcolor()` | Equivalent, with a caveat | Pine orders offset before title; Lipi orders title before offset, so name these arguments when converting. Pine adds editable and show\_last. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignBackgroundColor) | `AssignBackgroundColor` | Equivalent, with a caveat | Takes a colour value chosen per bar with an if-expression; no transparency argument; also colours custom-quote cells. |

## Colour the bars

Colouring the price bars themselves.

In Lipi: `barcolor`. No force\_overlay argument. An na colour means no bar colour; display accepts only none or all.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/drawstyles) | | Not in MQL4 | No draw style recolours existing price bars; overlay arrows, histograms or objects instead. |
| [MQL5](https://www.mql5.com/en/docs/customind/indicators_examples/draw_color_candles) | DRAW\_COLOR\_CANDLES; DRAW\_COLOR\_BARS | Equivalent, with a caveat | Draws candles or bars from your own OHLC buffers plus a colour-index buffer, rather than recolouring the chart's own bars. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/barbrush.htm) | `BarBrush` | Equivalent, with a caveat | Assign BarBrush on each bar; null restores the chart's default bar colour. CandleOutlineBrush colours candle outlines separately. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_barcolor) | `barcolor()` | Equivalent, with a caveat | Pine orders offset before title; Lipi orders title before offset, so name these arguments when converting. Pine adds editable and show\_last. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignPriceColor) | `AssignPriceColor` | Equivalent, with a caveat | Color.CURRENT leaves a bar unchanged; only one study at a time can paint a given price bar. |

## Where a plot is shown

Choosing whether a plot appears on the chart, the price scale, the data window or nowhere.

In Lipi: `display`. display.\* are bit flags (none 0, pane 1, data\_window 2, price\_scale 4, status\_line 8, all 15) combined with +; the terminal decides what each shows.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/customind/setindexlabel) | DRAW\_NONE; SetIndexLabel(index, NULL) | Equivalent, with a caveat | DRAW\_NONE hides the line on the chart; a NULL label hides the value in the DataWindow. There is no price-scale-only switch. |
| [MQL5](https://www.mql5.com/en/docs/constants/indicatorconstants/drawstyles) | PLOT\_SHOW\_DATA; DRAW\_NONE; INDICATOR\_CALCULATIONS buffers | Equivalent, with a caveat | DRAW\_NONE draws nothing, PLOT\_SHOW\_DATA toggles the Data Window entry, calculation buffers are never drawn: separate switches. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/indicator.htm) | `DisplayInDataBox, PaintPriceMarkers, IsOverlay, DrawOnPricePanel` | Built from several Lipi constructs | No per-plot display flag: separate properties control the data box, price markers, panel, and the panel used by draw objects. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#const_display.all) | display argument; display.none, all, pane, data\_window, price\_scale, status\_line | Equivalent, with a caveat | Pine display constants combine with + and -; Lipi supports + only. display.pine\_screener has no Lipi member. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/SetHiding) | `Hide(), SetHiding(), HideTitle(), HideBubble(), declare hide_on_intraday` | Built from several Lipi constructs | Visibility only: Hide() sets hidden by default and SetHiding(cond) hides conditionally; the reference lists no data-window or scale targets. |

## Colour with transparency

Making a colour partly see-through.

In Lipi: `color.new`. Alpha is opacity from 0 to 1 (1 solid, 0 invisible), clamped. A literal 50 warns. There is no transp argument.

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Faint background", overlay=true)
// 1 is solid and 0 is invisible; 0.15 is a light tint
bgcolor(close > open ? color.new(color.green, 0.15) : na)
plot(close, title="Close")
```

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/convert/colortoargb) | `ColorToARGB(clr, alpha)` | Looks alike, behaves differently | Alpha is a 0 to 255 byte (Lipi: 0 to 1); result is a uint for graphical resources; the color type has no alpha. Numbers and types: Alpha scale 0-255 versus Lipi 0-1; returns uint, not a color. |
| [MQL5](https://www.mql5.com/en/docs/convert/colortoargb) | `ColorToARGB(color, alpha)` | Looks alike, behaves differently | Alpha runs 0 to 255 (255 replaces the underlying pixel), not 0 to 1, and the result is a uint ARGB value, not a color. Numbers and types: The color type itself has no alpha byte (0x00BBGGRR); opacity exists only in the ARGB uint. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/working_with_brushes.htm) | new SolidColorBrush(Color.FromArgb(a, r, g, b)); areaOpacity argument | Looks alike, behaves differently | Draw areaOpacity runs 0-100 (0 clear); custom brushes use FromArgb alpha. Lipi alpha is 0-1, so a literal 50 clamps to solid. Numbers and types: areaOpacity is an int 0-100; Lipi alpha is a float 0-1. Custom brushes must also be frozen. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | `color.new()` | Looks alike, behaves differently | transp runs 0 (opaque) to 100 (invisible); Lipi's alpha runs 0 (invisible) to 1 (solid). Convert with alpha = 1 - transp / 100. Numbers and types: Pine takes transparency 0-100 with 0 solid; Lipi takes opacity 0-1 with 1 solid, so the same number means opposite things. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/CreateColor) | | Not in thinkScript | CreateColor takes only red, green and blue, and no colour function has an alpha argument; AddCloud is fixed translucent. |

## Colour from red, green, blue

Building a colour from its red, green and blue parts.

In Lipi: `color.rgb`. r, g and b are integers 0 to 255, clamped; the optional a is an opacity from 0 to 1.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/types/integer/color) | C'r,g,b' literal; 0x00BBGGRR integer | Looks alike, behaves differently | No rgb function: colours are compile-time literals or an integer in blue-green-red byte order, the reverse of the usual RGB order. Numbers and types: Byte order is BGR, so a hex value written as RGB gives wrong colour. |
| [MQL5](https://www.mql5.com/en/docs/basis/types/integer/color) | `C'R,G,B' literal` | Equivalent, with a caveat | Documented as a constant literal, components 0 to 255. At run time, compute the 0x00BBGGRR integer yourself or parse 'R,G,B' text with StringToColor. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/working_with_brushes.htm) | new SolidColorBrush(Color.FromRgb(r, g, b)); brush.Freeze() | Equivalent, with a caveat | Color.FromRgb gives a Color; wrap it in a SolidColorBrush and freeze it. Prefer predefined Brushes.\*; up to 65535 unique brushes are allowed. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | `color.rgb()` | Looks alike, behaves differently | Fourth argument transp is transparency 0-100 with 0 opaque; Lipi's a is opacity 0-1 with 1 solid. Color components run 0-255 in both. Numbers and types: Pine transp 0 is opaque and 100 invisible; Lipi a 1 is opaque and 0 invisible. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/CreateColor) | `CreateColor` | Equivalent, with a caveat | Three components only, no alpha argument; the reference example uses 0 to 255 values. |

## Colour on a gradient

Picking a colour between two colours according to where a value sits in a range.

In Lipi: `color.from_gradient`. All five arguments are required. The value is clamped to its bounds; equal bounds or an na argument give na.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/types/integer/color) | | Not in MQL4 | No gradient function; interpolate each channel by hand and build the colour from the parts. |
| [MQL5](https://www.mql5.com/en/docs/convert) | | Not in MQL5 | The conversion functions include no gradient or colour-interpolation function; interpolate the R, G, B parts yourself. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/alphabetical_reference.htm) | | Not in NinjaScript | No value-to-colour interpolation function is in the language reference index. WPF gradient brushes paint areas; they do not map a value to a colour. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_color.from_gradient) | `color.from_gradient()` | Equivalent, with a caveat | Lipi returns na when either end colour is na; for an end with no colour use a fully transparent one, color.new(c, 0). |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignNormGradientColor) | `AssignNormGradientColor` | Looks alike, behaves differently | Paints the plot itself; the range is the extremes of the last length bars and the midpoint is fixed at zero, unlike from\_gradient's explicit bounds. |

## Line object

Creating a line between two points that the script can move, restyle or delete later.

In Lipi: `line.new`, `line.delete`. The overlay argument is `forceOverlay` on line.new, `force_overlay` on the other drawings. Setters on an na handle do nothing.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | ObjectCreate(name, OBJ\_TREND, window, time1, price1, time2, price2); ObjectDelete(name) | Looks alike, behaves differently | Object is reached by a unique string name (max 63 characters), not a handle; ObjectCreate returns bool; x is a time, not a bar index. State and side effects: Objects stay on the chart until deleted; the name is the only way to reach them. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectcreate) | ObjectCreate with OBJ\_TREND; ObjectDelete | Equivalent, with a caveat | Objects are identified by unique string names, not handles; creation is queued and true only means the command was enqueued. State and side effects: Creating an existing name changes its coordinates instead of failing. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_line.htm) | Draw\.Line(owner, tag, startBarsAgo, startY, endBarsAgo, endY, brush) | Looks alike, behaves differently | The x anchor is barsAgo (relative to the current bar) or a DateTime, never an absolute bar index. Reusing a tag edits the same line. History indexing: barsAgo shifts each bar, so a stored value drifts; use a DateTime overload or recompute for fixed anchors. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_line.new) | `line.new(), line.delete()` | Equivalent, with a caveat | Pine spells the overlay argument force\_overlay, Lipi's line.new spells it forceOverlay. Pine also has a chart.point overload. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddVerticalLine) | | Not in thinkScript | No drawing objects exist; vertical lines use AddVerticalLine and horizontal levels are plots, and none can be moved or deleted later. |

## Change a line object

Moving a line's end points or changing its colour, width, style or extension.

In Lipi: `line.set_xy1`, `line.set_xy2`, `line.set_color`, `line.set_width`, `line.set_style`, `line.set_extend`. line.set\_xloc with four arguments is function-only; the method form takes just the xloc. A setter on an na or deleted handle does nothing.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object_property) | `ObjectMove, ObjectSetInteger, ObjectSetDouble with OBJPROP_*` | Equivalent, with a caveat | Properties are set by OBJPROP id on the object name; width runs 1 to 5, and extension is a ray flag. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectmove) | ObjectMove; ObjectSetInteger with OBJPROP\_COLOR, OBJPROP\_WIDTH, OBJPROP\_STYLE, OBJPROP\_RAY\_RIGHT | Built from several Lipi constructs | Anchor points move with ObjectMove by point index; colour, width, style and ray extension are properties set by identifier through ObjectSetInteger. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/line.htm) | Line.StartAnchor, Line.EndAnchor, Line.Stroke (or Draw\.Line again with the same tag) | Equivalent, with a caveat | No setter calls: assign StartAnchor, EndAnchor or Stroke on the returned Line object, or call Draw\.Line again with the same tag. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | `line.set_xy1(), set_xy2(), set_color(), set_width(), set_style(), set_extend()` | Exact | |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddVerticalLine) | | Not in thinkScript | Nothing to modify: lines are not objects, and AddVerticalLine and plots are declarative per-bar outputs. |

## Text label object

Creating a text label at a point that the script can move, change or delete later.

In Lipi: `label.new`, `label.set_text`, `label.set_xy`, `label.delete`. Text is limited to 999 characters at run time. `size` takes size.\*; a string that is not a size name stops the compiler.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | `ObjectCreate(... OBJ_TEXT or OBJ_LABEL), ObjectSetString(OBJPROP_TEXT), ObjectDelete` | Looks alike, behaves differently | OBJ\_TEXT sits at a time and price; OBJ\_LABEL ignores them and uses pixel distance from a chart corner. Both are addressed by name. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property) | OBJ\_TEXT; OBJ\_LABEL; ObjectSetString with OBJPROP\_TEXT | Built from several Lipi constructs | OBJ\_TEXT anchors at time and price; OBJ\_LABEL anchors by pixel distance from a corner; the text is the OBJPROP\_TEXT property. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_text.htm) | Draw\.Text(owner, tag, text, barsAgo, y, textBrush); RemoveDrawObject(tag) | Equivalent, with a caveat | Anchor x is barsAgo or a DateTime. The same tag edits the existing text; RemoveDrawObject(tag) deletes it. Fill opacity is 0 to 100. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_label.new) | `label.new(), label.set_text(), label.set_xy(), label.delete()` | Equivalent, with a caveat | Pine label.new also has a chart.point overload and accepts numeric size; Lipi takes only the x,y form and size.\* constants. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble) | `AddChartBubble` | Equivalent, with a caveat | Bubble shown on each bar where condition holds, with no handle to move or delete; AddLabel is a corner status line, not a bar label. |

## Rectangle object

Creating a rectangle between two corners that the script can resize, restyle or delete later.

In Lipi: `box.new`, `box.set_lefttop`, `box.set_rightbottom`, `box.delete`. Old argument names (text\_halign, text\_size, ...) compile with a warning; write texthalign, textvalign, size, textcolor, textwrap.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object#OBJ_RECTANGLE) | `OBJ_RECTANGLE (time1, price1, time2, price2)` | Equivalent, with a caveat | Corners are time and price pairs on a named object; OBJPROP\_BACK sets background drawing. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property) | OBJ\_RECTANGLE; ObjectMove; OBJPROP\_FILL | Equivalent, with a caveat | Two time/price anchors are the corners; fill is the OBJPROP\_FILL boolean. OBJPROP\_BGCOLOR applies only to edit, button and rectangle-label objects. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_rectangle.htm) | Draw\.Rectangle(owner, tag, startBarsAgo, startY, endBarsAgo, endY, brush); RemoveDrawObject(tag) | Equivalent, with a caveat | Corners are barsAgo or DateTime plus price. Reusing a tag resizes the same box; fill opacity is an int 0 to 100. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_box.new) | `box.new(), box.set_lefttop(), box.set_rightbottom(), box.delete()` | Equivalent, with a caveat | Pine's text arguments are text\_size, text\_color, text\_halign, text\_valign, text\_wrap; Lipi renamed them (size, textcolor, texthalign...) and warns on the Pine names. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud) | | Not in thinkScript | No rectangle object; AddCloud shades between two series and AddVerticalLine marks single bars. |

## Multi-point line object

Creating one shape that joins many points.

In Lipi: `polyline.new`. At most 1000 points; an empty or larger array returns na with no error. A polyline has only new, delete and all.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object) | | Not in MQL4 | No multi-point shape type among the object types; chain several OBJ\_TREND segments. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object) | | Not in MQL5 | The object type list contains no polyline; chain several OBJ\_TREND objects instead. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_pathtool.htm) | `Draw.PathTool() / Draw.Polygon()` | Equivalent, with a caveat | PathTool joins an open list of anchors; Polygon closes and fills it. Anchors are ChartAnchor objects (time plus price) or bar/y pairs. |
| [Pine Script](https://www.tradingview.com/pine-script-docs/visuals/lines-and-boxes/#polylines) | `polyline.new()` | Equivalent, with a caveat | Pine polylines can join up to 10,000 points; Lipi caps them at 1,000 and returns na beyond that. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel) | | Not in thinkScript | No multi-point shape object; a path is only expressible as a plotted series. |

## Fill between two line objects

Shading the area between two line objects.

In Lipi: `linefill.new`. No max-count argument (fixed at 50) and no copy. Functions: new, delete, get\_line1, get\_line2, set\_color.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object) | | Not in MQL4 | No fill between line objects; rectangle, triangle or channel objects are the closest shapes. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object) | | Not in MQL5 | No object shades between two line objects; shading between two lines exists only as DRAW\_FILLING between indicator buffers. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_region.htm) | `Draw.Region()` | Equivalent, with a caveat | Region fills between two Series\<double> objects (or a series and a price) over a bar range, not between two drawn line objects. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_linefill.new) | `linefill.new()` | Exact | |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud) | | Not in thinkScript | No line objects to fill between; AddCloud fills between two series instead. |

## Chart point

A position on the chart given by bar or time and by price, used to place objects.

In Lipi: `chartPoint.new`, `chartPoint.from_index`, `chartPoint.from_time`. The type is `chartPoint`, not `chart.point`. array.from(chartPoint.now(x)) is refused: use array.new\<chartPoint> and array.push.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | | Not in MQL4 | No point type: anchor points are separate time and price arguments, passed in pairs. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectcreate) | datetime time and double price anchor arguments | Equivalent, with a caveat | No point type: each anchor is a separate time and price argument pair; a bar number must first be converted to time (iTime). |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_polygon.htm) | `ChartAnchor` | Equivalent, with a caveat | An anchor is built from a DateTime, a price and the ChartControl. The page shows no separate from-index or from-time constructors. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_chart.point.new) | `chart.point.new(), chart.point.from_index(), chart.point.from_time(), chart.point.now()` | Equivalent, with a caveat | Pine names the type and functions chart.point.*; Lipi spells them chartPoint.*. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Data-Types) | | Not in thinkScript | No chart-point type exists in the data types list; positions come from the bar where a condition is true. |

## Place objects by time

Positioning an object horizontally by a timestamp instead of a bar number.

In Lipi: `xloc`. xloc.bar\_time takes times in milliseconds; xloc.bar\_index, the default, takes bar numbers. Any other xloc string stops the script.

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Label by time", overlay=true)
if barstate.islast {
    label.new(time, high, "last bar", xloc=xloc.bar_time)
}
```

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | `datetime anchors of ObjectCreate` | Equivalent, with a caveat | Objects are always placed by datetime; convert a bar shift with Time\[shift] or iBarShift. There is no bar-index placement mode. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectcreate) | `ObjectCreate time anchors` | Equivalent, with a caveat | Anchors are always times; there is no bar-index mode, and pixel placement uses OBJ\_LABEL distances instead. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_line.htm) | `Draw.* overloads taking DateTime` | Equivalent, with a caveat | Pick the DateTime overload instead of barsAgo. The time is a DateTime, whereas Lipi xloc.bar\_time takes epoch milliseconds. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#const_xloc.bar_time) | `xloc.bar_time` | Exact | |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble) | | Not in thinkScript | Chart marks are tied to the bar where their condition holds; no timestamp placement argument is documented. |

## Draw beyond the last bar

Placing an object to the right of the most recent bar.

In Lipi: `xloc`. The compiler accepts any future bar index or time and keeps the object; whether the terminal draws it past the last bar is not shown.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | | Unresolved | ObjectCreate and the object-type pages do not say whether a time after the last bar is accepted or how it is placed. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectcreate) | | Unresolved | The ObjectCreate page states no limit or rule for anchor times beyond the last bar, so future placement is not established from first-party docs. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawing.htm) | | Unresolved | The first-party pages checked (drawing, draw\_line, draw\_text) do not say whether anchors may lie right of the last bar. |
| [Pine Script](https://www.tradingview.com/pine-script-docs/writing/limitations/#maximum-bars-forward) | `xloc.bar_index with an index past bar_index` | Equivalent, with a caveat | Pine bar-index coordinates may run at most 500 bars past the current bar. Lipi's compiler accepts any future index or time; drawing is undocumented. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/IsNaN) | plot values on the right expansion (bars where IsNaN(close)); price\[-n] | Equivalent, with a caveat | Bars to the right of the last one have NaN prices, so a script can plot there; negative-index plots shift forward but look ahead. |

## How many objects a script keeps

The maximum number of lines, labels, boxes and polylines a script may have on the chart at once.

In Lipi: `indicator`. Default 50 per kind. Maximum 500 lines, labels, boxes and 100 polylines (larger values are clamped); 9 tables; linefills fixed at 50.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectcreate) | | Unresolved | Object function pages state only a 63-character name limit; no maximum object count is documented. |
| [MQL5](https://www.mql5.com/en/docs/objects) | | Unresolved | The Object Functions index states no maximum number of graphical objects, so no limit can be quoted from first-party docs. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawingtools_drawobjects.htm) | | Unresolved | No page on the allowed hosts states a cap on script drawings; DrawObjects only warns that large collections affect performance. |
| [Pine Script](https://www.tradingview.com/pine-script-docs/writing/limitations/#line-box-polyline-and-label-limits) | `max_lines_count, max_labels_count, max_boxes_count, max_polylines_count arguments` | Equivalent, with a caveat | Same arguments, default 50, caps 500 (100 polylines). Pine deletes the oldest drawings past the limit; Lipi trims past limit plus 5. State and side effects: Lipi never trims a line, label, box or linefill held directly in a static variable; Pine's docs describe plain oldest-first deletion. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel) | | Not in thinkScript | No drawing objects exist, so no object-count limits are documented. |

## List the script's objects

Getting every object of a kind the script has drawn, for example to delete old ones.

In Lipi: `line.all`, `label.all`, `box.all`. The `.all` arrays hold live drawings only; a drawing trimmed over the limit is gone and its handle does nothing.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/objects/objectsdeleteall) | `ObjectsTotal(), ObjectName(index), ObjectsDeleteAll(window, type or prefix)` | Built from several Lipi constructs | Loop an index up to ObjectsTotal reading ObjectName; ObjectsDeleteAll removes by subwindow and type, with a prefix form that filters by name. |
| [MQL5](https://www.mql5.com/en/docs/objects/objectstotal) | ObjectsTotal; ObjectName; ObjectsDeleteAll | Built from several Lipi constructs | Count with ObjectsTotal and read each name with ObjectName, optionally by type; the list covers the whole chart, not just your script's objects. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawingtools_drawobjects.htm) | `DrawObjects (use DrawObjects.ToList())` | Equivalent, with a caveat | The collection holds every object on the chart, including user-drawn ones; filter by type and IsUserDrawn, and iterate a ToList() snapshot. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | `line.all, label.all, box.all` | Exact | |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel) | | Not in thinkScript | No object registry exists because drawings are not objects. |

## Table on the chart

A grid of cells fixed to a corner of the chart, with text and colours the script sets.

In Lipi: `table.new`, `table.cell`. One table per position.\* slot (9). A new table at an occupied slot replaces the old one; a cell outside the grid is ignored.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object) | | Not in MQL4 | No table object; arrange OBJ\_LABEL or OBJ\_RECTANGLE\_LABEL objects at pixel offsets from a corner. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object) | | Not in MQL5 | No table object exists; build a grid from OBJ\_LABEL, OBJ\_EDIT or OBJ\_RECTANGLE\_LABEL objects. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawing.htm) | | Not in NinjaScript | No table object. Draw\.TextFixed places text in one of five fixed chart positions; a grid needs custom OnRender drawing. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_table.cell) | `table.new(), table.cell()` | Equivalent, with a caveat | Pine's cell text arguments are text\_color, text\_halign, text\_valign, text\_size; Lipi names them textcolor, texthalign, textvalign, size and warns on the Pine names. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel) | | Not in thinkScript | No grid object: AddLabel adds single text rows in a chart corner; several labels stack, optionally with row ownership. |

## Change table cells

Changing a table cell's text, colours, size or alignment, or merging cells.

In Lipi: `table.cell_set_text`, `table.cell_set_bgcolor`, `table.merge_cells`. Old names such as text\_halign warn; write texthalign. Merge cells with t.merge\_cells(0, 0, 1, 0).

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object_property) | | Not in MQL4 | No cell object; change each stand-in label or rectangle label through its own OBJPROP\_TEXT or OBJPROP\_BGCOLOR. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object) | | Not in MQL5 | Without a table type, each cell is a separate object changed through ObjectSetString and ObjectSetInteger. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/drawing.htm) | | Not in NinjaScript | Without tables there are no cells to change; redraw Draw\.TextFixed under the same tag to update fixed text. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_table.merge_cells) | `table.cell_set_text(), table.cell_set_bgcolor(), table.merge_cells()` | Equivalent, with a caveat | Pine raises an error when a merged cell is merged again; Lipi completes the second merge without an error. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel) | | Not in thinkScript | No table cells to edit; each AddLabel call is its own text line driven by a condition. |

## Text alignment and size

Choosing how text sits inside a label, box or cell, and how large it is.

In Lipi: `text`, `size`. text.align\_\* are the const strings left, center, right, top, bottom; other values stop the script. Labels use textalign, boxes and tables texthalign and textvalign.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/objectconstants/enum_object_property) | `OBJPROP_ANCHOR, OBJPROP_FONTSIZE, OBJPROP_ALIGN, TextSetFont` | Equivalent, with a caveat | Anchor point picks one of nine positions for text and label objects; font size is an integer; OBJPROP\_ALIGN applies only to edit objects. |
| [MQL5](https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property) | OBJPROP\_ANCHOR; OBJPROP\_ALIGN; OBJPROP\_FONTSIZE | Equivalent, with a caveat | Anchor point and font size are separate properties; horizontal alignment (OBJPROP\_ALIGN) exists only for edit objects, not as one alignment keyword. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/draw_text.htm) | `TextAlignment, SimpleFont, TextPosition` | Equivalent, with a caveat | Draw\.Text takes TextAlignment (Left, Center, Right, Justify) and a SimpleFont; fixed-position text uses Draw\.TextFixed with five preset slots. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | text\_halign, text\_valign, text\_size arguments; text.align\_\* and size.\* constants | Equivalent, with a caveat | Pine text\_size takes size.\* or a positive integer; the argument names are text\_halign and text\_valign where Lipi uses texthalign, textvalign and size. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/FontSize) | AddLabel(..., location = Location.*, size = FontSize.*) | Equivalent, with a caveat | Only label font size (FontSize constants SMALL to X\_LARGE) and corner Location; no alignment control and no text inside boxes or cells. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.