# GoCharting > GoCharting documentation. This site currently covers Lipi Script, GoCharting's scripting language: the v2 manual and the language reference. The platform user guide and the Charting SDK documentation are at https://gocharting.com/docs. - [Scripting on GoCharting](https://gocharting.com/docs/scripting/index.md): What Lipi v2 is, what an indicator or a strategy script can produce, what it cannot do, and where to start. - [Why Lipi exists](https://gocharting.com/docs/scripting/lipi-genesis.md): Where Lipi comes from, how the language is defined, how its versions are told apart, and what this manual describes. - [Write your first script](https://gocharting.com/docs/scripting/getting-started/first-script.md): Build an average-bar-range indicator from a declaration, one calculation and two plot calls. - [The Lipi editor](https://gocharting.com/docs/scripting/getting-started/editor.md): How the editor checks a script, what a problem report contains, and what a clean check does not prove. - [Reading someone else's script](https://gocharting.com/docs/scripting/getting-started/reading-scripts.md): How to find your way in a script you did not write: where to look first, how a script is organised, and how to look up a name you do not know. - [What Lipi does not do](https://gocharting.com/docs/scripting/getting-started/not-supported.md): Names and forms that do not exist in Lipi v2, the compiler's message for each, and what to write instead. - [Moving a script from Lipi v1 to v2](https://gocharting.com/docs/scripting/getting-started/migrating-from-v1.md): The version header, what Lipi v2 adds to Lipi v1, and what to check when you move a v1 script. - [Add an input to your script](https://gocharting.com/docs/scripting/learn/add-an-input.md): Turn a hard-coded length into an input.int the chart user can change, with bounds, a step, a tooltip, and a color input. - [Alert on your own condition](https://gocharting.com/docs/scripting/learn/alert-on-your-condition.md): Build a condition for a close crossing above a moving average, mark it on the chart, raise it with alert() on a closed bar, and offer it with alertcondition(). - [Color a plot by condition](https://gocharting.com/docs/scripting/learn/color-by-condition.md): Plot the close and color it by a condition, soften the colors with color.new, and color it by a value with color.from_gradient. - [Read someone else's script](https://gocharting.com/docs/scripting/learn/read-someone-elses-script.md): A line-by-line walk through one short script, naming the job each line does, and the names that tell you a script will not compile. - [Draw a level and a label](https://gocharting.com/docs/scripting/learn/draw-a-level-and-a-label.md): Draw a line at the highest high of the last N bars and a label with its price, created once on the last bar and then moved instead of redrawn. - [Keep the last values in an array](https://gocharting.com/docs/scripting/learn/keep-the-last-values-in-an-array.md): Keep the last N closes in a static array, trim it as bars arrive, calculate from it, and loop over it. - [Backtest a moving-average crossover](https://gocharting.com/docs/scripting/learn/backtest-a-crossover.md): Build a complete strategy that buys when a fast average crosses above a slow one and closes when it crosses back, with an account set up in strategy(). - [How to avoid a result that changes after the bar closes](https://gocharting.com/docs/scripting/how-to/avoid-a-result-that-changes-after-the-bar-closes.md): Keeping a value fixed once drawn by latching it on barstate.isconfirmed, reading the previous bar, or running the script only when a bar closes. - [How to color bars by a condition](https://gocharting.com/docs/scripting/how-to/color-bars-by-a-condition.md): Recoloring the chart's bars with barcolor and shading the pane with bgcolor, with the condition written inside the color argument. - [How to draw a line between two pivots](https://gocharting.com/docs/scripting/how-to/draw-a-line-between-two-pivots.md): Finding swing highs with a comparison on neighbouring bars, remembering the last one in static variables, and drawing a line to it with line.new. - [How to group and lay out your inputs](https://gocharting.com/docs/scripting/how-to/group-and-lay-out-your-inputs.md): Putting inputs under a heading with group, sharing a row with inline, adding help text with tooltip, and choosing from a list with options. - [How to keep a running total across bars](https://gocharting.com/docs/scripting/how-to/keep-a-running-total-across-bars.md): Carrying a total from one bar to the next with static, restarting it each session, and the built-in cumulative functions. - [How to let the chart user choose a color](https://gocharting.com/docs/scripting/how-to/let-the-chart-user-choose-a-color.md): Declaring a color control with input.color, passing the choice to a plot, and offering one color for rising and one for falling. - [How to plot a value on its own scale rather than over price](https://gocharting.com/docs/scripting/how-to/plot-a-value-on-its-own-scale.md): Setting overlay in the indicator declaration, forcing one plot over price with force_overlay, and formatting the scale's numbers. - [How to plot only during part of the session](https://gocharting.com/docs/scripting/how-to/plot-only-during-part-of-the-session.md): Leaving a gap outside a time window by plotting na, testing the window with time() and a session string or with hour() in a named zone. - [How to put a marker on a specific bar](https://gocharting.com/docs/scripting/how-to/put-a-marker-on-a-specific-bar.md): Marking one bar with plotshape by writing a condition that is true on exactly that bar, or with a label for a marker that carries text. - [How to reference a value from a previous bar](https://gocharting.com/docs/scripting/how-to/reference-a-value-from-a-previous-bar.md): Reading an earlier bar's value with the index suffix, computing the index, and the limits on how far back it can reach. - [How to return more than one value from a function](https://gocharting.com/docs/scripting/how-to/return-more-than-one-value-from-a-function.md): Returning a tuple from an arrow body or a braced body, unpacking it with [a, b] = f(), and the built-in functions that return tuples the same way. - [How to reuse a calculation with your own function](https://gocharting.com/docs/scripting/how-to/reuse-a-calculation-with-your-own-function.md): Declaring a function once and calling it twice, the arrow and braced body forms, parameter defaults, and what a function cannot do. - [How to send a webhook when your condition fires](https://gocharting.com/docs/scripting/how-to/send-a-webhook-when-your-condition-fires.md): Raising an alert with the message you want delivered, choosing between alert and alertcondition, and what is set outside the script. - [How to shade the area between two plots](https://gocharting.com/docs/scripting/how-to/shade-the-area-between-two-plots.md): Keeping each plot in a variable and passing both to fill, in a plain form with a color per bar and in a gradient form between two prices. - [How to tell a forming bar from one that has closed](https://gocharting.com/docs/scripting/how-to/tell-a-forming-bar-from-one-that-has-closed.md): Reading barstate.isconfirmed and barstate.isrealtime to separate a bar that is still updating from a closed one, and the flags that mark the end of the chart. - [How to work around a name Lipi does not have](https://gocharting.com/docs/scripting/how-to/work-around-a-name-lipi-does-not-have.md): The names other languages have that Lipi v2 does not, the compiler's message for each, and what to write instead. - [How to keep one label that moves with the last bar](https://gocharting.com/docs/scripting/how-to/keep-one-label-that-moves.md): Keeping a single label in a static variable and moving it with label.set_xy, or deleting and re-creating it on the last bar. - [How to show a table of values](https://gocharting.com/docs/scripting/how-to/show-a-table-of-values.md): Creating a table once, filling its cells on the last bar, and the limit of one table per position on the chart. - [How to group values in your own type](https://gocharting.com/docs/scripting/how-to/group-values-in-your-own-type.md): Declaring a type, creating one instance in a static variable, reading its fields and updating them with :=. - [How to keep drawings under the limit](https://gocharting.com/docs/scripting/how-to/keep-drawings-under-the-limit.md): Keeping the newest N boxes, lines or labels in an array and deleting the oldest, and raising the limit with max_boxes_count and its siblings. - [How to format a time as text](https://gocharting.com/docs/scripting/how-to/format-a-time-as-text.md): Turning a bar's time into a readable string with str.format_time, which takes seconds, a layout written as the reference date, and an optional time zone. - [Bar-by-bar evaluation](https://gocharting.com/docs/scripting/evaluation/bar-by-bar.md): How a script runs once per bar from the oldest bar to the newest, and what that means for variables. - [Referencing previous bars](https://gocharting.com/docs/scripting/evaluation/referencing-past-bars.md): Reading a value from earlier bars with x[n], what it accepts, the 500-bar reach, and the messages for a bad index. - [Values that persist across bars](https://gocharting.com/docs/scripting/evaluation/persistence.md): static and intra variables, when each is initialised and committed, and how they behave on history and on a forming bar. - [Recalculation and confirmation](https://gocharting.com/docs/scripting/evaluation/recalculation.md): How the script runs on every tick of the forming bar, what is reset between ticks, barstate.isconfirmed, and calc_on_every_tick. - [Calls that must run on every bar](https://gocharting.com/docs/scripting/evaluation/call-contract.md): Why talib functions and your own functions must run on every bar, once per call site, and how to keep a condition from breaking their history. - [Script anatomy](https://gocharting.com/docs/scripting/language/anatomy.md): The parts of a Lipi v2 script, what may appear only at the top level, and what a script cannot contain. - [Statements and lines](https://gocharting.com/docs/scripting/language/statements-and-lines.md): One statement to a line, where a long statement may continue on the next line, how blocks are written, and the forms the compiler refuses. - [Values and types](https://gocharting.com/docs/scripting/language/values-and-types.md): The five basic types and their literals, na, typed declarations, conversions, reassignment and the whole-number rule for division. - [const, input, simple and series](https://gocharting.com/docs/scripting/language/qualifiers.md): The qualifier every value carries, which arguments require which, and the message when a series value goes where a fixed one is needed. - [Operators and expressions](https://gocharting.com/docs/scripting/language/expressions.md): The operators with their exact precedence, logic with na, the conditional expression, the history operator x[n] and string joining. - [Branching](https://gocharting.com/docs/scripting/language/branching.md): if, else if, else and switch as statements, and which calls may and may not be placed inside a branch. - [Loops](https://gocharting.com/docs/scripting/language/repetition.md): Counted for loops with step, for-in over an array, while, break and continue, and how each behaves when the script runs. - [Your own functions](https://gocharting.com/docs/scripting/language/custom-functions.md): Declaring functions with func and def, parameters and defaults, return values and tuples, and what a function may and may not change. - [Custom types and enums](https://gocharting.com/docs/scripting/language/custom-types.md): Declaring your own object type, creating instances with new, reading and changing their fields, keeping them in arrays, and declaring enums. - [Arrays](https://gocharting.com/docs/scripting/language/arrays.md): Lists of values: creating a typed array, adding and reading elements, looping over one, keeping one across bars, and arrays of drawings and of your own types. - [Names and conventions](https://gocharting.com/docs/scripting/language/names-and-conventions.md): The Lipi spelling of things other languages call differently, with the message the compiler gives for the other form, and the rules for names. - [Price and volume](https://gocharting.com/docs/scripting/market-data/price-and-volume.md): The built-in series for a bar's prices, volume and position in the chart, and how to read earlier bars. - [Orderflow: buying, selling and delta](https://gocharting.com/docs/scripting/market-data/orderflow.md): The orderflow series for trade counts, buy and sell volume and delta, and the cumulative volume delta function. - [Open interest](https://gocharting.com/docs/scripting/market-data/open-interest.md): The single open-interest series, `oi`, and what it holds where an instrument has no open interest. - [Sessions and intervals](https://gocharting.com/docs/scripting/market-data/sessions-and-intervals.md): Bar times and their parts, building a time with timestamp, testing a trading session, and reading the chart's interval. - [Instrument properties](https://gocharting.com/docs/scripting/market-data/instrument.md): The syminfo names that describe the chart's instrument, their types, and the names that do not exist. - [Data availability by market](https://gocharting.com/docs/scripting/market-data/availability.md): What market data a script can read, how it behaves where an instrument lacks it, and that no other instrument's data can be requested. - [Plotting](https://gocharting.com/docs/scripting/chart-output/plotting.md): Putting a series on the chart with plot and its styles, marking bars with plotshape, plotchar and plotarrow, drawing your own bars with plotbar and plotcandle, and the display argument. - [Color and transparency](https://gocharting.com/docs/scripting/chart-output/color.md): Color constants, hex colors with alpha, opacity with color.new and color.rgb, gradients, reading a color's parts, and colors that change by bar. - [Fills and levels](https://gocharting.com/docs/scripting/chart-output/fills-and-levels.md): Drawing fixed levels with hline and shading between two plots or two levels with fill, with a plain color or a gradient. - [Bar coloring and background](https://gocharting.com/docs/scripting/chart-output/bars-and-background.md): Recoloring the chart's own bars with barcolor and shading the pane background with bgcolor. - [Text and markers](https://gocharting.com/docs/scripting/chart-output/text-and-markers.md): Attaching fixed text to plotshape and plotchar marks, and showing text built from data with label.new. - [Lines, labels, boxes and polylines](https://gocharting.com/docs/scripting/chart-output/drawings.md): Creating, changing and deleting lines, labels, boxes, polylines and linefills, positioning them with bars, times and chart points, and the limits on how many a script keeps. - [Tables](https://gocharting.com/docs/scripting/chart-output/tables.md): Showing a grid of text on the chart with table.new and table.cell, positioning it, changing cells, and filling it once on the last bar. - [Plots or drawings: which to use](https://gocharting.com/docs/scripting/chart-output/plots-or-drawings.md): When to plot a series and when to draw an object, and what to use in place of each plot form the compiler refuses. - [Strategies and backtesting](https://gocharting.com/docs/scripting/strategies/overview.md): Declaring a strategy, the arguments that set its account, sizing and costs, and what a strategy does and does not do. - [Orders and positions](https://gocharting.com/docs/scripting/strategies/orders-and-positions.md): The order functions, when and at what price each order fills, how entries, exits and reversals change the position, and the errors orders can raise. - [Reading a strategy's results](https://gocharting.com/docs/scripting/strategies/strategy-results.md): The strategy variables for position, equity and profit, and the functions that read single open and closed trades. - [Inputs](https://gocharting.com/docs/scripting/configuration/inputs.md): The input functions that make a script's settings editable from the chart, their common arguments, options and steps, time and enum inputs, and what a default may be. - [Alerts](https://gocharting.com/docs/scripting/automation/alerts.md): The two ways a script can raise an alert, alert and alertcondition, where each may be called, and when each acts. - [Webhooks for algo trading](https://gocharting.com/docs/scripting/automation/webhooks.md): What a script controls in an alert that reaches an outside service, the message, and what the platform controls. - [House style and naming](https://gocharting.com/docs/scripting/distribution/house-style.md): The one spelling to use where Lipi v2 accepts several, and the naming conventions for scripts shared on GoCharting. - [Limits](https://gocharting.com/docs/scripting/distribution/limits.md): Every limit the Lipi compiler and runtime enforce, with the phase that enforces it and the message you see. - [Sharing scripts](https://gocharting.com/docs/scripting/distribution/sharing.md): Publishing an indicator or strategy to the script store, choosing who can see and use it, and what readers can do with a published script. - [Use Lipi with AI](https://gocharting.com/docs/scripting/ai/overview.md): The ways to work on Lipi scripts with an AI assistant: GoCharting's own agent skill, these docs as Markdown, the docs search server and the docs assistant. - [The GoCharting Lipi skill](https://gocharting.com/docs/scripting/ai/skill.md): Install GoCharting's own agent skill for Lipi in your AI agent, to write, convert, describe and fix Lipi scripts, and what the skill does not do. - [Docs for AI tools](https://gocharting.com/docs/scripting/ai/docs-for-ai-tools.md): Give an AI tool these docs as Markdown, connect its agent to the docs search server, or ask the docs assistant, and report a page that is wrong. - [Lipi v2 reference](https://gocharting.com/docs/scripting/reference/index.md): The Lipi v2 language reference: every keyword, operator, type, constant, variable and function, by kind and namespace, with the page and entry that define it. - [Compiler messages](https://gocharting.com/docs/scripting/reference/errors.md): The messages a Lipi writer meets most, grouped by cause, with what each means and how to fix it. - [Global functions](https://gocharting.com/docs/scripting/reference/functions/global.md): Reference for the 40 functions (79 entries with overloads) of the global scope (the names with no namespace): alert, alertcondition, barcolor, bgcolor and 36 more, each with its definition and an example. - [array functions](https://gocharting.com/docs/scripting/reference/functions/array.md): Reference for the 56 functions (66 entries with overloads) of the array namespace: array.abs, array.avg, array.binary_search, array.binary_search_leftmost and 52 more, each with its definition and an example. - [box functions](https://gocharting.com/docs/scripting/reference/functions/box.md): Reference for the 30 functions (31 entries with overloads) of the box namespace: box.all, box.copy, box.delete, box.get_bottom and 26 more, each with its definition and an example. - [chartPoint functions](https://gocharting.com/docs/scripting/reference/functions/chartpoint.md): Reference for the 5 functions of the chartPoint namespace: chartPoint.copy, chartPoint.from_index, chartPoint.from_time, chartPoint.new and 1 more, each with its definition and an example. - [color functions](https://gocharting.com/docs/scripting/reference/functions/color.md): Reference for the 7 functions (28 entries with overloads) of the color namespace: color.a, color.b, color.from_gradient, color.g and 3 more, each with its definition and an example. - [input functions](https://gocharting.com/docs/scripting/reference/functions/input.md): Reference for the 12 functions (14 entries with overloads) of the input namespace: input.bool, input.color, input.enum, input.float and 8 more, each with its definition and an example. - [interval functions](https://gocharting.com/docs/scripting/reference/functions/interval.md): Reference for the 3 functions of the interval namespace: interval.change, interval.from_seconds and interval.in_seconds, each with its definition and an example. - [label functions](https://gocharting.com/docs/scripting/reference/functions/label.md): Reference for the 22 functions of the label namespace: label.all, label.copy, label.delete, label.get_text and 18 more, each with its definition and an example. - [line functions](https://gocharting.com/docs/scripting/reference/functions/line.md): Reference for the 22 functions (24 entries with overloads) of the line namespace: line.all, line.copy, line.delete, line.get_price and 18 more, each with its definition and an example. - [linefill functions](https://gocharting.com/docs/scripting/reference/functions/linefill.md): Reference for the 6 functions of the linefill namespace: linefill.all, linefill.delete, linefill.get_line1, linefill.get_line2 and 2 more, each with its definition and an example. - [math functions](https://gocharting.com/docs/scripting/reference/functions/math.md): Reference for the 24 functions (106 entries with overloads) of the math namespace: math.abs, math.acos, math.asin, math.atan and 20 more, each with its definition and an example. - [orderflow functions](https://gocharting.com/docs/scripting/reference/functions/orderflow.md): Reference for the 1 functions of the orderflow namespace: orderflow.cvd, each with its definition and an example. - [polyline functions](https://gocharting.com/docs/scripting/reference/functions/polyline.md): Reference for the 3 functions of the polyline namespace: polyline.all, polyline.delete and polyline.new, each with its definition and an example. - [str functions](https://gocharting.com/docs/scripting/reference/functions/str.md): Reference for the 17 functions (74 entries with overloads) of the str namespace: str.contains, str.endswith, str.format_time, str.length and 13 more, each with its definition and an example. - [strategy functions](https://gocharting.com/docs/scripting/reference/functions/strategy.md): Reference for the 29 functions of the strategy namespace: strategy.cancel, strategy.cancel_all, strategy.close, strategy.close_all and 25 more, each with its definition and an example. - [ta functions](https://gocharting.com/docs/scripting/reference/functions/ta.md): Reference for the 62 functions (64 entries with overloads) of the ta namespace: ta.alma, ta.atr, ta.barssince, ta.bb and 58 more, each with its definition and an example. - [table functions](https://gocharting.com/docs/scripting/reference/functions/table.md): Reference for the 23 functions of the table namespace: table.all, table.cell, table.cell_set_bgcolor, table.cell_set_height and 19 more, each with its definition and an example. - [talib functions](https://gocharting.com/docs/scripting/reference/functions/talib.md): Reference for the 62 functions (64 entries with overloads) of the talib namespace: talib.alma, talib.atr, talib.barssince, talib.bb and 58 more, each with its definition and an example. - [Global variables](https://gocharting.com/docs/scripting/reference/variables/global.md): Reference for the 24 variables of the global scope (the names with no namespace): bar_index, close, dayofmonth, dayofweek and 20 more, each with its definition and an example. - [barstate variables](https://gocharting.com/docs/scripting/reference/variables/barstate.md): Reference for the 7 variables of the barstate namespace: barstate.isconfirmed, barstate.isfirst, barstate.ishistory, barstate.islast and 3 more, each with its definition and an example. - [box variables](https://gocharting.com/docs/scripting/reference/variables/box.md): Reference for the 1 variables of the box namespace: box.all, each with its definition and an example. - [chart variables](https://gocharting.com/docs/scripting/reference/variables/chart.md): Reference for the 9 variables of the chart namespace: chart.bg_color, chart.fg_color, chart.is_heikinashi, chart.is_kagi and 5 more, each with its definition and an example. - [interval variables](https://gocharting.com/docs/scripting/reference/variables/interval.md): Reference for the 11 variables of the interval namespace: interval.interval, interval.isdaily, interval.iseod, interval.ishourly and 7 more, each with its definition and an example. - [label variables](https://gocharting.com/docs/scripting/reference/variables/label.md): Reference for the 1 variables of the label namespace: label.all, each with its definition and an example. - [line variables](https://gocharting.com/docs/scripting/reference/variables/line.md): Reference for the 1 variables of the line namespace: line.all, each with its definition and an example. - [linefill variables](https://gocharting.com/docs/scripting/reference/variables/linefill.md): Reference for the 1 variables of the linefill namespace: linefill.all, each with its definition and an example. - [orderflow variables](https://gocharting.com/docs/scripting/reference/variables/orderflow.md): Reference for the 10 variables of the orderflow namespace: orderflow.buy, orderflow.buyvolume, orderflow.cothigh, orderflow.cotlow and 6 more, each with its definition and an example. - [polyline variables](https://gocharting.com/docs/scripting/reference/variables/polyline.md): Reference for the 1 variables of the polyline namespace: polyline.all, each with its definition and an example. - [session variables](https://gocharting.com/docs/scripting/reference/variables/session.md): Reference for the 2 variables of the session namespace: session.date and session.isfirst, each with its definition and an example. - [strategy variables](https://gocharting.com/docs/scripting/reference/variables/strategy.md): Reference for the 15 variables of the strategy namespace: strategy.account_currency, strategy.closedtrades, strategy.equity, strategy.grossloss and 11 more, each with its definition and an example. - [syminfo variables](https://gocharting.com/docs/scripting/reference/variables/syminfo.md): Reference for the 14 variables of the syminfo namespace: syminfo.asset_type, syminfo.currency, syminfo.exchange, syminfo.isindex and 10 more, each with its definition and an example. - [table variables](https://gocharting.com/docs/scripting/reference/variables/table.md): Reference for the 1 variables of the table namespace: table.all, each with its definition and an example. - [Global constants](https://gocharting.com/docs/scripting/reference/constants/global.md): Reference for the 3 constants of the global scope (the names with no namespace): false, na and true, each with its definition and an example. - [color constants](https://gocharting.com/docs/scripting/reference/constants/color.md): Reference for the 17 constants of the color namespace: color.aqua, color.black, color.blue, color.fuchsia and 13 more, each with its definition and an example. - [dayofweek constants](https://gocharting.com/docs/scripting/reference/constants/dayofweek.md): Reference for the 7 constants of the dayofweek namespace: dayofweek.friday, dayofweek.monday, dayofweek.saturday, dayofweek.sunday and 3 more, each with its definition and an example. - [extend constants](https://gocharting.com/docs/scripting/reference/constants/extend.md): Reference for the 4 constants of the extend namespace: extend.both, extend.left, extend.none and extend.right, each with its definition and an example. - [format constants](https://gocharting.com/docs/scripting/reference/constants/format.md): Reference for the 5 constants of the format namespace: format.inherit, format.mintick, format.percent, format.price and 1 more, each with its definition and an example. - [label constants](https://gocharting.com/docs/scripting/reference/constants/label.md): Reference for the 21 constants of the label namespace: label.style_arrowdown, label.style_arrowup, label.style_circle, label.style_cross and 17 more, each with its definition and an example. - [line constants](https://gocharting.com/docs/scripting/reference/constants/line.md): Reference for the 6 constants of the line namespace: line.style_arrow_both, line.style_arrow_left, line.style_arrow_right, line.style_dashed and 2 more, each with its definition and an example. - [math constants](https://gocharting.com/docs/scripting/reference/constants/math.md): Reference for the 4 constants of the math namespace: math.e, math.phi, math.pi and math.rphi, each with its definition and an example. - [order constants](https://gocharting.com/docs/scripting/reference/constants/order.md): Reference for the 2 constants of the order namespace: order.ascending and order.descending, each with its definition and an example. - [position constants](https://gocharting.com/docs/scripting/reference/constants/position.md): Reference for the 9 constants of the position namespace: position.bottom_center, position.bottom_left, position.bottom_right, position.middle_center and 5 more, each with its definition and an example. - [strategy constants](https://gocharting.com/docs/scripting/reference/constants/strategy.md): Reference for the 9 constants of the strategy namespace: strategy.commission_cash_per_contract, strategy.commission_cash_per_order, strategy.commission_percent, strategy.fixed and 5 more, each with its definition and an example. - [text constants](https://gocharting.com/docs/scripting/reference/constants/text.md): Reference for the 8 constants of the text namespace: text.align_bottom, text.align_center, text.align_left, text.align_right and 4 more, each with its definition and an example. - [xloc constants](https://gocharting.com/docs/scripting/reference/constants/xloc.md): Reference for the 2 constants of the xloc namespace: xloc.bar_index and xloc.bar_time, each with its definition and an example. - [yloc constants](https://gocharting.com/docs/scripting/reference/constants/yloc.md): Reference for the 3 constants of the yloc namespace: yloc.abovebar, yloc.belowbar and yloc.price, each with its definition and an example. - [Lipi types](https://gocharting.com/docs/scripting/reference/types.md): Reference for the 23 types of Lipi v2: array, bool, box, chartPoint and 19 more, each with its definition and an example. - [Lipi keywords](https://gocharting.com/docs/scripting/reference/keywords.md): Reference for the 24 keywords of Lipi v2: and, break, case, const and 20 more, each with its definition and an example. - [Lipi operators](https://gocharting.com/docs/scripting/reference/operators.md): Reference for the 22 operators of Lipi v2: -, -=, :=, ! and 18 more, each with its definition and an example. - [Lipi enums](https://gocharting.com/docs/scripting/reference/enums.md): Reference for the 8 enums of Lipi v2: display, font, hlineStyle, location and 4 more, each with its definition and an example. - [Lipi language map](https://gocharting.com/docs/scripting/reference/language-map/index.md): A factual map from MQL4, MQL5, NinjaScript, Pine Script and thinkScript to Lipi: 205 concepts, each with the Lipi construct, the matching construct in every language and the differences to handle when converting. - [Execution and types across languages](https://gocharting.com/docs/scripting/reference/language-map/execution-and-types.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for execution and types: bar-by-bar evaluation, declare an indicator, declare a strategy, price pane or own pane, recalculate on every update, language version header and more, with the differences that matter when converting. - [History and state across languages](https://gocharting.com/docs/scripting/reference/language-map/history-and-state.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for history and state: value on an earlier bar, bar number, last bar, how far back a script can read, history functions on every bar, keep a value across bars and more, with the differences that matter when converting. - [Control flow, functions and collections across languages](https://gocharting.com/docs/scripting/reference/language-map/control-flow-and-functions.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for control flow, functions and collections: conditional block, choose by value, inline condition, counted loop, loop over a collection, conditional loop and more, with the differences that matter when converting. - [Inputs across languages](https://gocharting.com/docs/scripting/reference/language-map/inputs.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for inputs: whole-number input, decimal input, on/off input, text or choice input, colour input, price source input and more, with the differences that matter when converting. - [Plots and drawings across languages](https://gocharting.com/docs/scripting/reference/language-map/plots-and-drawings.md): 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. - [Strategies and alerts across languages](https://gocharting.com/docs/scripting/reference/language-map/strategies-and-alerts.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for strategies and alerts: enter a position, place an order, exit with stop or target, close a position, cancel pending orders, current position and more, with the differences that matter when converting. - [Market data and time across languages](https://gocharting.com/docs/scripting/reference/language-map/market-data-and-time.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for market data and time: price and volume of the bar, average prices of the bar, open interest, orderflow of the bar, instrument details, chart timeframe and more, with the differences that matter when converting. - [Math and strings across languages](https://gocharting.com/docs/scripting/reference/language-map/math-and-strings.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for math and strings: absolute value, rounding, round to the tick size, smaller or larger of values, powers and roots, exponent and logarithms and more, with the differences that matter when converting. - [Arrays across languages](https://gocharting.com/docs/scripting/reference/language-map/arrays.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for arrays: create an array, arrays of drawing objects, read and write an element, number of elements, add or remove at the end, add or remove at the start and more, with the differences that matter when converting. - [Moving averages across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/moving-averages.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for moving averages: arnaud legoux moving average, exponential moving average, hull moving average, wilder's moving average, simple moving average, symmetrically weighted moving average and more, with the differences that matter w - [Oscillators across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/oscillators.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for oscillators: commodity channel index, chande momentum oscillator, center of gravity, directional movement index, macd, money flow index and more, with the differences that matter when converting. - [Volatility and bands across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/volatility-and-bands.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for volatility and bands: average true range, bollinger bands, bollinger bands width, donchian channel, donchian channel width, mean absolute deviation and more, with the differences that matter when converting. - [Volume across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/volume.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for volume: cumulative sum, negative volume index, on-balance volume, positive volume index, price-volume trend, volume-weighted average price and more, with the differences that matter when converting. - [Extremes, pivots and statistics across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/extremes-and-pivots.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for extremes, pivots and statistics: highest value, offset of the highest value, lowest value, offset of the lowest value, pivot high, pivot low and more, with the differences that matter when converting. - [Series helpers across languages](https://gocharting.com/docs/scripting/reference/language-map/indicators/series-helpers.md): How Lipi maps to MQL4, MQL5, NinjaScript, Pine Script and thinkScript for series helpers: bars since a condition, change over bars, cross of two series, cross above, cross below, falling for a number of bars and more, with the differences that matter when converting. - [What Lipi does not have](https://gocharting.com/docs/scripting/reference/language-map/not-in-lipi.md): The 5 concepts of other chart-script languages that Lipi has no construct for, what to use instead, and which languages have each one. - [How to convert a script to Lipi](https://gocharting.com/docs/scripting/reference/language-map/convert-a-script.md): The order of work for converting a script from MQL4, MQL5, NinjaScript, Pine Script and thinkScript to Lipi with the language map, and the corrections a conversion most often needs. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.