| Concept | Lipi | MQL4 | MQL5 | NinjaScript | Pine Script | thinkScript |
|---|---|---|---|---|---|---|
| Highest value | ta.highest | Differs | Differs | Caveat | Caveat | Caveat |
| Offset of the highest value | ta.highestbars | Caveat | Caveat | Caveat | Caveat | Caveat |
| Lowest value | ta.lowest | Differs | Differs | Caveat | Caveat | Caveat |
| Offset of the lowest value | ta.lowestbars | Caveat | Caveat | Caveat | Caveat | Caveat |
| Pivot high | ta.pivothigh | Caveat | Caveat | Caveat | Differs | Absent |
| Pivot low | ta.pivotlow | Caveat | Caveat | Caveat | Differs | Absent |
| Range of values | ta.range | Absent | Caveat | Differs | Caveat | Absent |
| Median | ta.median | Absent | Caveat | Caveat | Caveat | Caveat |
| Mode | ta.mode | Absent | Absent | Absent | Caveat | Absent |
| Percentile by linear interpolation | ta.percentile_linear_interpolation | Absent | Caveat | Absent | Caveat | Absent |
| Percentile by nearest rank | ta.percentile_nearest_rank | Absent | Absent | Absent | Caveat | Absent |
| Percent rank | ta.percentrank | Absent | Absent | Absent | Caveat | Absent |
| Correlation coefficient | ta.correlation | Absent | Caveat | Caveat | Caveat | Caveat |
Highest value
The highest valuesource reached in the last length bars.
In Lipi: ta.highest. At this build its first valid bars can miss the true maximum.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iHighest | Looks alike, behaves differently | Returns the bar offset of the maximum, not its value; read the searched MODE_* series at that offset, e.g. iHigh for MODE_HIGH. History indexing: result is a shift counted back from the current bar, reusable as the shift in iHigh. |
| MQL5 | iHighest | Looks alike, behaves differently | Returns the bar shift of the highest value, not the value; read the price at that shift. The series comes from a mode enum. History indexing: Shift 0 is the current bar and counts toward older bars; -1 signals an error. |
| NinjaScript | MAX | Equivalent, with a caveat | At this build Lipi’s ta.highest can be wrong on its first valid bars and is na until bar length-1; values match after warm-up. |
| Pine Script | ta.highest | Equivalent, with a caveat | Pine also has a one-argument form that reads high; Lipi always needs the source, so expand ta.highest(n) to ta.highest(high, n). |
| thinkScript | Highest | Equivalent, with a caveat | Highest’s length defaults to 12, Lipi requires it; Lipi’s first valid bars can also be wrong, and it is na until bar length-1. |
Offset of the highest value
Locates the highest value ofsource within the last length bars and returns its position rather than its value.
In Lipi: ta.highestbars.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iHighest | Equivalent, with a caveat | Same offset-style result. Source is a MODE_* series id, with count and start arguments; returns -1 on error. History indexing: shift counts bars back from the current bar; shift 0 is the still-forming bar, and any shift can be read in one call. |
| MQL5 | iHighest | Equivalent, with a caveat | Returns the shift of the highest bar, 0 at the current bar, as Lipi’s ta.highestbars does; -1 on error. Series come from the mode enum. History indexing: Shift 0 is the current bar and counts toward older bars. |
| NinjaScript | HighestBar | Equivalent, with a caveat | Returns an int count of bars ago (0 = current bar); the page documents no value for a not-found case. |
| Pine Script | ta.highestbars | Equivalent, with a caveat | Pine returns 0 or a negative offset (-3 is three bars back). Lipi’s docs do not state the sign. Pine’s one-argument form reads high. History indexing: Pine offsets are zero or negative; confirm the sign Lipi returns before comparing with positive values. |
| thinkScript | GetMaxValueOffset | Equivalent, with a caveat | Counts bars back with 0 at the current bar, as Lipi’s ta.highestbars does. The length defaults to 25. |
Lowest value
The lowest valuesource reached in the last length bars.
In Lipi: ta.lowest. At this build it returns 0 on the first length bars after it first has a value.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iLowest | Looks alike, behaves differently | Returns the bar offset of the minimum, not its value; read the value with iLow at that offset. Source is a MODE_* series id. History indexing: result is a shift counted back from the current bar, reusable as the shift in iLow. |
| MQL5 | iLowest | Looks alike, behaves differently | Returns the bar shift of the lowest value, not the value; read the price at that shift. The series comes from a mode enum. History indexing: Shift 0 is the current bar and counts toward older bars; -1 signals an error. |
| NinjaScript | MIN | Equivalent, with a caveat | At this build Lipi’s ta.lowest returns 0 on its first length valid bars and is na before that; values match after warm-up. |
| Pine Script | ta.lowest | Equivalent, with a caveat | Pine also has a one-argument form that reads low; Lipi always needs the source, so expand ta.lowest(n) to ta.lowest(low, n). |
| thinkScript | Lowest | Equivalent, with a caveat | Lowest’s length defaults to 12, Lipi requires it; Lipi also returns 0 for its first length valid bars and is na before that. |
Offset of the lowest value
Gives the position of the lowest value ofsource within the last length bars, not the value itself.
In Lipi: ta.lowestbars.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iLowest | Equivalent, with a caveat | Same offset-style result. Source is a MODE_* series id, with count and start arguments; returns -1 on error. History indexing: shift counts bars back from the current bar; shift 0 is the still-forming bar, and any shift can be read in one call. |
| MQL5 | iLowest | Equivalent, with a caveat | Returns the shift of the lowest bar, 0 at the current bar, as Lipi’s ta.lowestbars does; -1 on error. Series come from the mode enum. History indexing: Shift 0 is the current bar and counts toward older bars. |
| NinjaScript | LowestBar | Equivalent, with a caveat | Returns an int count of bars ago (0 = current bar); the page documents no value for a not-found case. |
| Pine Script | ta.lowestbars | Equivalent, with a caveat | Reference states no sign for the offset; the docs’ highestbars example negates it, implying zero or negative values. Lipi’s sign is undocumented. History indexing: Pine offsets are probably zero or negative; confirm the sign Lipi returns before comparing with positive values. |
| thinkScript | GetMinValueOffset | Equivalent, with a caveat | Counts bars back with 0 at the current bar, as Lipi’s ta.lowestbars does, which returns -1 during warm-up. The length defaults to 25. |
Pivot high
Looks for a pivot high insource, as this build implements it.
In Lipi: ta.pivothigh.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iFractals | Equivalent, with a caveat | Closest built-in: no leftBars or rightBars arguments, mode picks upper or lower, value read at a shift. History indexing: shift counts bars back from the current bar; shift 0 is the still-forming bar, and any shift can be read in one call. Other timeframes: symbol and timeframe arguments read another symbol or period directly; Lipi ta calls use the chart’s own bars. |
| MQL5 | iFractals | Equivalent, with a caveat | Buffers are 0 upper and 1 lower. The page shows no left or right bar-count arguments and gives no window definition. State and side effects: Returns a handle; values are read later with CopyBuffer and are not ready right after creation. History indexing: CopyBuffer start_pos 0 is the current bar and counts toward the past; copied data lands oldest-first. |
| NinjaScript | Swing | Equivalent, with a caveat | One strength covers both sides. SwingHigh gives 0, not na, when no swing exists; SwingHighBar returns bars ago, or -1. Warm-up and missing values: Zero is returned until the bar count exceeds strength or a pivot is found. Bar timing: A swing is only definite after strength further bars, so earlier values are updated later. |
| Pine Script | ta.pivothigh | Looks alike, behaves differently | Pine returns the price of the pivot bar itself, or na. Lipi returns the current bar’s source when the window high sits leftBars back. Bar timing: Pine reports the pivot bar’s own price; Lipi’s value is the current bar’s source, not the pivot bar’s. |
| thinkScript | Not in thinkScript | No left/right-bar pivot function; the ZigZagHighLow study marks swing points filtered by a reversal threshold, and PivotPoints gives previous-period levels. |
Pivot low
Looks for a pivot low insource, as this build implements it.
In Lipi: ta.pivotlow.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | iFractals | Equivalent, with a caveat | Closest built-in: no leftBars or rightBars arguments, mode picks upper or lower, value read at a shift. History indexing: shift counts bars back from the current bar; shift 0 is the still-forming bar, and any shift can be read in one call. Other timeframes: symbol and timeframe arguments read another symbol or period directly; Lipi ta calls use the chart’s own bars. |
| MQL5 | iFractals | Equivalent, with a caveat | Lower buffer (1) holds the low fractals. The page shows no left or right bar-count arguments and gives no window definition. State and side effects: Returns a handle; values are read later with CopyBuffer and are not ready right after creation. History indexing: CopyBuffer start_pos 0 is the current bar and counts toward the past; copied data lands oldest-first. |
| NinjaScript | Swing | Equivalent, with a caveat | One strength covers both sides. SwingLow gives 0, not na, when no swing exists; SwingLowBar returns bars ago, or -1. Warm-up and missing values: Zero is returned until the bar count exceeds strength or a pivot is found. Bar timing: A swing is only definite after strength further bars, so earlier values are updated later. |
| Pine Script | ta.pivotlow | Looks alike, behaves differently | Pine returns the price of the pivot bar itself, or na. Lipi returns the current bar’s source when the window low sits leftBars back. Bar timing: Pine reports the pivot bar’s own price; Lipi’s value is the current bar’s source, not the pivot bar’s. |
| thinkScript | Not in thinkScript | No left/right-bar pivot function; the ZigZagHighLow study marks swing points filtered by a reversal threshold, and PivotPoints gives previous-period levels. |
Range of values
How much groundsource covered over the last length bars, expressed as one figure.
In Lipi: ta.range.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No range function; use iHigh/iHighest and iLow/iLowest over the window. | |
| MQL5 | vector::Ptp | Equivalent, with a caveat | Range of values of a whole vector; fill it with the window first. Lipi’s range is a per-bar windowed figure. |
| NinjaScript | Range | Looks alike, behaves differently | Range() is the current bar’s own range with no window length; Lipi’s takes a source and length. Use MAX minus MIN for a window. |
| Pine Script | ta.range | Equivalent, with a caveat | Equal after warm-up; Lipi’s first length valid bars are wrong because its lowest returns 0 there, so the range is overstated. |
| thinkScript | Not in thinkScript | No range function; subtract Lowest from Highest over the same length. |
Median
The middle value of the lastlength values of source.
In Lipi: ta.median.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No median function; copy to an array, ArraySort it and read the middle element. | |
| MQL5 | MathMedian, vector::Median | Equivalent, with a caveat | Takes an array you fill with the window first; it returns NaN on error. A Median method also exists on vectors. |
| NinjaScript | GetMedian | Equivalent, with a caveat | A plain method returning one double, not an indicator series. For an even look-back it averages the two middle values. |
| Pine Script | ta.median | Equivalent, with a caveat | Pine’s reference says na source values are ignored; Lipi’s ta.median returns na on a bar whose source is na. |
| thinkScript | Median | Equivalent, with a caveat | Median’s length defaults to 12, Lipi requires it; the middle-or-average-of-two rule matches. |
Mode
Of the lastlength values of source, this reports the one that recurs most often.
In Lipi: ta.mode.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No mode function; sort a copy and count runs in a loop. | |
| MQL5 | Not in MQL5 | No mode function among the array statistics (mean, variance, skewness, kurtosis, median, deviation). | |
| NinjaScript | Not in NinjaScript | No statistical-mode indicator or method in the system list; compute it by hand. | |
| Pine Script | ta.mode | Equivalent, with a caveat | Pine ignores na source values; Lipi’s ta.mode returns na on a bar whose source is na, and float even for int sources. |
| thinkScript | Not in thinkScript | No mode function; Median is the nearest windowed statistic offered. |
Percentile by linear interpolation
The requestedpercentile of source over length bars, interpolating between the two values that straddle the rank.
In Lipi: ta.percentile_linear_interpolation.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No percentile function; sort a copy with ArraySort and interpolate by hand. | |
| MQL5 | vector::Percentile | Equivalent, with a caveat | A vector method; percent runs 0 to 100 and a linear algorithm is used. The page asks for sorted input. Fill the vector first. |
| NinjaScript | Not in NinjaScript | No percentile method in the system indicator or Analytical lists; compute it by hand. | |
| Pine Script | ta.percentile_linear_interpolation | Equivalent, with a caveat | Same calculation; the third parameter is named percentage in Pine and percentile in Lipi, which matters for named arguments. |
| thinkScript | Not in thinkScript | No percentile function in the functions list or study library. |
Percentile by nearest rank
Takes the requestedpercentile of source over length bars at the nearest rank, without interpolating.
In Lipi: ta.percentile_nearest_rank.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No percentile function; sort a copy with ArraySort and pick the rank by hand. | |
| MQL5 | Not in MQL5 | The documented Percentile method uses a linear algorithm only; no nearest-rank variant is described. | |
| NinjaScript | Not in NinjaScript | No percentile method in the system indicator or Analytical lists; compute it by hand. | |
| Pine Script | ta.percentile_nearest_rank | Equivalent, with a caveat | Same calculation; the third parameter is named percentage in Pine and percentile in Lipi, which matters for named arguments. |
| thinkScript | Not in thinkScript | No percentile function in the functions list or study library. |
Percent rank
Ranks wheresource now stands against the last length bars of itself.
In Lipi: ta.percentrank.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No percent-rank function among the indicator functions. | |
| MQL5 | Not in MQL5 | No percent-rank method in the matrix and vector statistics list; count the values below the current one yourself. | |
| NinjaScript | Not in NinjaScript | No percent-rank method in the system indicator or Analytical lists; compute it by hand. | |
| Pine Script | ta.percentrank | Equivalent, with a caveat | Same ranking on clean data; Pine yields na when an na is in the window, Lipi keeps computing after the na bar. |
| thinkScript | Not in thinkScript | No percent-rank function in the functions list or study library. |
Correlation coefficient
Correlation between two series,source1 and source2, measured over length bars.
In Lipi: ta.correlation.
| Language | Construct | Relation | Note |
|---|---|---|---|
| MQL4 | Not in MQL4 | No correlation function among the indicator functions or math group. | |
| MQL5 | vector::CorrCoef | Equivalent, with a caveat | A method on two vectors you fill first; it returns the Pearson coefficient. The bar window is whatever you copy into the vectors. |
| NinjaScript | Correlation | Equivalent, with a caveat | Correlates the chart series with another instrument given by name, not any two series. |
| Pine Script | ta.correlation | Equivalent, with a caveat | Pine’s reference says na source values are ignored; Lipi’s ta.correlation returns na on a bar whose source is na. |
| thinkScript | Correlation | Equivalent, with a caveat | Length defaults to 10. thinkScript can feed another symbol’s close as data2; Lipi reads only the chart symbol. Other timeframes: data2 may come from a secondary symbol, which Lipi cannot read. |