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

# Inputs across languages

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

Settings the chart user can change. 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 |
| - | - | - | - | - | - | - |
| [Whole-number input](#input-int) | `input.int` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Decimal input](#input-float) | `input.float` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [On/off input](#input-bool) | `input.bool` | Caveat | Exact | Caveat | Caveat | Caveat |
| [Text or choice input](#input-string) | `input.string` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Colour input](#input-color) | `input.color` | Caveat | Caveat | Caveat | Caveat | Absent |
| [Price source input](#input-source) | `input.source` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Timeframe input](#input-timeframe) | `input.timeframe` | Caveat | Caveat | Unresolved | Caveat | Caveat |
| [Session input](#input-session) | `input.session` | Absent | Absent | Composite | Caveat | Composite |
| [Date and time input](#input-time) | `input.time` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Price level input](#input-price) | `input.price` | Caveat | Absent | Caveat | Caveat | Caveat |
| [Enumeration input](#input-enum) | `input.enum` | Caveat | Caveat | Caveat | Caveat | Caveat |
| [Group and lay out inputs](#input-layout) | `input.int` | Absent | Caveat | Caveat | Exact | Absent |

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.

## Whole-number input

A setting the chart user fills with a whole number, with optional bounds and step.

In Lipi: `input.int`. `defval` must be a const int, not na and not a series. minval and maxval are not checked against it; `step=0` is accepted.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input int` | Equivalent, with a caveat | Global declaration input int name=default; read-only in code, no minimum, maximum or step arguments; a trailing // comment becomes the label. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | `input int` | Equivalent, with a caveat | Label comes from the trailing comment or an input(name=...) attribute. The declaration has no min, max or step; the tester or ParameterSetRange sets optimisation ranges. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/creating_user_defined_input_pa.htm) | \[NinjaScriptProperty]\[Range(min, max)] public int Name \{ get; set; } | Equivalent, with a caveat | A class property with attributes; the default is assigned in State.SetDefaults. Range supplies bounds; no step attribute is documented. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.int) | `input.int()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/integer) | `input <name> = <integer>` | Equivalent, with a caveat | No bounds, step or tooltip arguments; the default alone fixes the integer type. |

## Decimal input

A setting the chart user fills with a decimal number.

In Lipi: `input.float`. An int default is accepted. `defval` must be const and not na; bounds are not checked against it.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input double` | Equivalent, with a caveat | Declared input double name=default; no bounds or step; read-only in code. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | `input double` | Equivalent, with a caveat | Label comes from the trailing comment or an input(name=...) attribute. The declaration has no min, max or step; the tester or ParameterSetRange sets optimisation ranges. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/rangeattribute.htm) | \[NinjaScriptProperty]\[Range(min, max)] public double Name \{ get; set; } | Equivalent, with a caveat | Same property pattern with type double; Range accepts double bounds. Default is set in State.SetDefaults. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.float) | `input.float()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/float) | `input <name> = <decimal>` | Equivalent, with a caveat | The default must contain a decimal point to be a float; no bounds or step arguments. |

## On/off input

A setting the chart user switches on or off.

In Lipi: `input.bool`. display defaults to display.none for input.bool, input.color, input.time and input.text\_area; the other inputs default to display.all.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input bool` | Equivalent, with a caveat | Declared input bool name=default; read-only in code; label comes from a trailing comment. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | `input bool` | Exact | |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/ninjascriptpropertyattribute.htm) | \[NinjaScriptProperty] public bool Name \{ get; set; } | Equivalent, with a caveat | A public bool property; \[NinjaScriptProperty] also adds it as a parameter when another script creates this one. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.bool) | `input.bool()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/boolean) | `input <name> = yes \| no` | Equivalent, with a caveat | The default is written yes or no; there are no title or tooltip arguments. |

## Text or choice input

A setting the chart user fills with text, or picks from a list of options.

In Lipi: `input.string`. A string default must be one of `options` when options are given.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input string` | Equivalent, with a caveat | Free text only; a fixed list of choices needs an enum input instead. String inputs cannot be optimised. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | input string; input of an enum type | Equivalent, with a caveat | Free text is input string; a list of choices needs an enum, whose members show as a dropdown. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/creating_user_defined_input_pa.htm) | \[NinjaScriptProperty] public string Name \{ get; set; } | Equivalent, with a caveat | A string property takes free text. For a fixed choice list use an enum property instead of Lipi's options argument. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.string) | `input.string()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/string) | `input <name> = "text"` | Equivalent, with a caveat | Free text comes from a quoted default; a pick-list is the separate enum input form, not an options argument. |

## Colour input

A setting the chart user picks a colour for.

In Lipi: `input.color`. The default is a const colour. Layout arguments (group, inline, tooltip) must be const.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/types/casting) | `input color` | Equivalent, with a caveat | Declared input color name=default using clr names or C'r,g,b'; value has no alpha. |
| [MQL5](https://www.mql5.com/en/docs/basis/types/integer/color) | `input color` | Equivalent, with a caveat | Value is a color constant such as clrRed; it holds no opacity. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/user_definable_color_inputs.htm#BorderBrushSerialize) | \[XmlIgnore] public Brush Name \{ get; set; } plus a Browsable(false) string twin | Equivalent, with a caveat | Needs an \[XmlIgnore] Brush property and a hidden string property using Serialize.BrushToString and StringToBrush so the choice is saved. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.color) | `input.color()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/constant) | | Not in thinkScript | Colour constants cannot define an input; colours are set in code, and Color()/DefineColor() names make plot colours editable in the dialog. |

## Price source input

A setting that picks which price series the script reads.

In Lipi: `input.source`. Only open, high, low, close, hl2, hlc3, ohlc4 and hlcc4 are accepted as the default; volume is refused.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/indicatorconstants/prices#ENUM_APPLIED_PRICE) | `input ENUM_APPLIED_PRICE` | Equivalent, with a caveat | Choice is limited to the applied-price list (close, open, high, low, median, typical, weighted); another series cannot be picked. |
| [MQL5](https://www.mql5.com/en/docs/constants/indicatorconstants/prices) | input ENUM\_APPLIED\_PRICE; the 'Apply to' field of an OnCalculate(price\[]) indicator | Equivalent, with a caveat | Pick from the ENUM\_APPLIED\_PRICE list, a price kind rather than an arbitrary series; another indicator's handle works only via 'Apply to'. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/input.htm) | `Input` | Equivalent, with a caveat | An indicator has one implicit Input series (price or another indicator). Lipi allows several named source settings. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.source) | `input.source()` | Equivalent, with a caveat | Pine also accepts volume as a default and orders display before confirm; Lipi puts confirm first and limits defaults to price series. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/price) | `input price = close` | Equivalent, with a caveat | The keyword is price. Besides price series it accepts vwap, volume, open\_interest, imp\_volatility and tick\_count. |

## Timeframe input

A setting that picks a chart timeframe.

In Lipi: `input.timeframe`. Choosing a timeframe does not fetch its data: there is no request namespace. Use it with time(timeframe).

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/constants/chartconstants/enum_timeframes#ENUM_TIMEFRAMES) | `input ENUM_TIMEFRAMES` | Equivalent, with a caveat | Dropdown of PERIOD\_ constants; PERIOD\_CURRENT (0) means the chart's own timeframe. |
| [MQL5](https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes) | `input ENUM_TIMEFRAMES` | Equivalent, with a caveat | Dropdown of PERIOD\_\* constants, PERIOD\_CURRENT meaning the chart timeframe; unlike Lipi, that timeframe's data can then be read. Other timeframes: The chosen timeframe can be passed straight to iClose, CopyRates or iMA. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/adddataseries.htm) | | Unresolved | No dedicated timeframe input type is documented. AddDataSeries arguments must be hard-coded, so a user-chosen timeframe cannot add a data series. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.timeframe) | `input.timeframe()` | Equivalent, with a caveat | Pine uses bare minutes ('60'), D and W; Lipi uses suffixes such as 1h. Pine also takes an options list; Lipi has none. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/constant) | `input <name> = AggregationPeriod.DAY` | Equivalent, with a caveat | A constant input holding an AggregationPeriod value, fed to the period argument of price functions; Lipi can only read the chart's own timeframe. |

## Session input

A setting that picks a time-of-day range.

In Lipi: `input.session`. Session strings are HHMM-HHMM, ranges comma-separated; an end before the start wraps midnight; day digits follow a colon, 1 = Sunday.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | | Not in MQL4 | No session input type; use two string or datetime inputs and parse them. Only simple types and enums can be inputs. |
| [MQL5](https://www.mql5.com/en/docs/basis/types) | | Not in MQL5 | No session input type exists; use string or datetime inputs, or read the symbol's own sessions with SymbolInfoSessionTrade. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/ninjascriptpropertyattribute.htm) | two TimeSpan properties (\[NinjaScriptProperty]\[XmlIgnore]) with string twins for serialisation | Built from several Lipi constructs | No session-range type: use begin and end TimeSpan properties, each with a serialised string twin, and compare against the bar time yourself. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.session) | `input.session()` | Equivalent, with a caveat | Pine accepts an options list of allowed sessions; Lipi's input.session has no options argument. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Date---Time/SecondsFromTime) | two integer HHMM inputs with SecondsFromTime / SecondsTillTime | Built from several Lipi constructs | No session input: take start and end as integer HHMM inputs, then test them with SecondsFromTime and SecondsTillTime (EST). |

## Date and time input

A setting that picks a point in time.

In Lipi: `input.time`. The default must be a millisecond integer literal: timestamp("2024-01-01") passes the editor check but fails on Add to chart.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input datetime` | Equivalent, with a caveat | Plain datetime input counting seconds since 1970 (Lipi uses milliseconds); defaults can be D'yyyy.mm.dd' literals. Numbers and types: Seconds, not milliseconds. |
| [MQL5](https://www.mql5.com/en/docs/basis/types/integer/datetime) | `input datetime` | Equivalent, with a caveat | datetime counts seconds since 1970, while Lipi time values count milliseconds. Numbers and types: Seconds in MQL5, milliseconds in Lipi: scale by 1000 when converting. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/rangeattribute.htm) | \[Range(typeof(DateTime), min, max)] public DateTime Name \{ get; set; } | Equivalent, with a caveat | A DateTime property with an optional Range attribute giving date bounds; the value is a DateTime, not epoch milliseconds. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.time) | `input.time()` | Equivalent, with a caveat | Pine allows a timestamp() of a constant date string as the default; Lipi needs an integer millisecond literal. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Date---Time/GetYYYYMMDD) | `input <name> = <YYYYMMDD integer>` | Equivalent, with a caveat | No date picker: dates are integers in YYYYMMDD form compared with GetYYYYMMDD(); times of day are HHMM integers. |

## Price level input

A setting that picks a price level.

In Lipi: `input.price`. It returns an input float, so it can drive hline(price).

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `input double` | Equivalent, with a caveat | No price-level input type; a plain double input is used. |
| [MQL5](https://www.mql5.com/en/docs/basis/types) | | Not in MQL5 | No price input type exists; use input double. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/creating_user_defined_input_pa.htm) | \[NinjaScriptProperty] public double Name \{ get; set; } | Equivalent, with a caveat | No price-level input type or chart picker; a plain double property holds the level. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.price) | `input.price()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/price) | `input <name> = <decimal>` | Equivalent, with a caveat | A price level is just a float input with no chart picking; the keyword price here means a data source, not a level. |

## Enumeration input

A setting whose options come from the script's own enumeration.

In Lipi: `input.enum`. The default must be a const member written Name.Member.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | `enum plus input` | Equivalent, with a caveat | Declare an enum, then input EnumName x=Member; comments on members become the dropdown labels. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | `input <enum type>` | Equivalent, with a caveat | Dropdown shows member names, or comments attached to the members. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/creating_a_user-defined_parame.htm) | enum (C#) used as a public property type | Equivalent, with a caveat | Declare the enum separately, then use it as a public property type; the user picks from its hard-coded members. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/#fun_input.enum) | `input.enum()` | Equivalent, with a caveat | Pine accepts an active argument that greys out the input; Lipi rejects it as an unknown named argument, so it must be dropped. |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/enum) | input \<name> = \{default A, B, C} | Equivalent, with a caveat | Options are listed inline in the input with one default; there is no separate enum declaration to reuse. |

## Group and lay out inputs

Grouping settings under headings and placing several on one line.

In Lipi: `input.int`. `group`, `inline` and `tooltip` must be const strings. Two inputs may share a title.

| Language | Construct | Relation | Note |
| - | - | - | - |
| [MQL4](https://docs.mql4.com/basis/variables/inputvariables) | | Not in MQL4 | No grouping or inline placement; the only layout aid is a trailing // comment of up to 63 characters used as the label. |
| [MQL5](https://www.mql5.com/en/docs/basis/variables/inputvariables) | `input group` | Equivalent, with a caveat | Group headings exist, but the docs describe no option to place several inputs on one line. |
| [NinjaScript](https://ninjatrader.com/support/helpGuides/nt8/displayattribute.htm) | `[Display(GroupName=..., Order=...)]` | Equivalent, with a caveat | GroupName groups settings under a heading and Order sorts them; no way to place several settings on one line is documented. |
| [Pine Script](https://www.tradingview.com/pine-script-reference/v6/) | group, inline and tooltip arguments of the input.\* functions | Exact | |
| [thinkScript](https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input) | | Not in thinkScript | No groups or inline rows; inputs appear in source order and their names cannot contain spaces unless quoted. |


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