Skip to main content
This page is the order of work for moving a script from MQL4, MQL5, NinjaScript, Pine Script and thinkScript to Lipi with the language map, and the corrections a conversion most often needs.
1

Check what Lipi does not have

Read What Lipi does not have and find the concepts the script relies on. A script that reads another symbol or timeframe, for example, cannot be converted as it is.
2

Map each construct

For each construct in the script, find its concept in the map and read its row. Where the relation is Exact, use the Lipi construct as it is. Where it is Caveat or Differs, apply the note. Where it is Composite, use the Lipi constructs the section names.
3

Write the Lipi script

Start with //@lipi=2 and an indicator() or strategy() call, then write the body in Lipi. Keep the names of inputs and plots the chart user already knows.
4

Check and compare

Run a check in the Lipi editor. A clean check proves the script compiles, not that it gives the same values: add it to the same chart and compare its plots with the original on the same bars, starting with every row whose relation is Differs.

Corrections most often needed

  • A transparency from 0 to 100 is not Lipi. Use an opacity from 0 to 1: opacity = 1 - transparency / 100. See the row.
  • A history function called only inside a condition is computed over its own calls, not over bars. Call it on every bar and use the result inside the condition. See the row.
  • A lookback over 500 bars compiles but stops the script when it runs. Keep every length and offset at 500 or less. See the row.
  • There is no columns plot style. The nearest is plotStyle.bar. See the row.
  • Text alignment takes the strings behind the text.align_* constants: "left", "center", "right", "top", "bottom". Any other value stops the script. See the row.
  • A request for another symbol or timeframe does not compile. Build the script on the chart’s own data, or leave that part out. See the row.
  • Integer division does not truncate: int a = 4 / 2 is a compile error. Use int(), which truncates toward zero, where the source language truncated; math.floor rounds negative values down. See the row.
  • ta.supertrend takes the multiplier first, then the ATR length, and returns the line and the direction. See the row.

Next

Lipi language map

the overview, the relations and the versions checked.

The GoCharting Lipi skill

convert with an AI assistant that reads the map for the source language.