Type index
Lipi defines 8 types and 5 enums.
Five names appear in the contract as both a type and an enum. They are enums: the generator that emits the contract names each enum after its value type, so the same object is written into both collections. They are listed once here, under enums.
Types
bool
A true-or-false value. The two constants true and false are the literals for it.
Comparisons produce one, and the marker functions take one as their condition. No fields.
chartPoint
A single position on the chart, described by three fields: time carries when, index carries which bar, and price carries where on the price scale. All three fields are series, so a point built on one bar need not hold the same coordinates as one built on the next.
| Field | Type |
|---|---|
time | series int |
index | series int |
price | series float |
color
A colour. You can write one directly as a hex literal — six digits for the colour, eight to carry alpha as well.
Seventeen named constants and six functions in the color namespace give you the other ways to get one. No fields.
float
A number with a fractional part, written 1.5. It has no fields.
Most market data is float: the bar’s prices, its volume and the averaged prices are all float series.
hline
The value hline gives back once it has drawn a horizontal level.
It plays the same part as a plot value in the other fill form: two hline values shade the band between two levels. Mixing one with a plot is not accepted — the two forms of fill are separate. No fields.
int
A whole number. One of the five data types the grammar names directly.
Written as a bare number: 14. It has no fields.
plot
The value plot gives back once it has drawn a series.
Its use is to be passed on: hold it in a variable and hand two of them to fill to shade the band between the two plots. It exposes no fields of its own.
string
A piece of text, written between double quotes: "length".
Titles, messages and instrument details are strings. The str namespace holds the functions that work on them. No fields.
Enums
hlineStyle
Three line styles for a horizontal level: solid, dashed and dotted.
The smallest of the five sets, and the only one used by hline. It is not interchangeable with plotStyle.
| Member | Shown as |
|---|---|
hlineStyle.solid | Solid |
hlineStyle.dashed | Dashed |
hlineStyle.dotted | Dotted |
location
Five places a marker can sit: abovebar, belowbar, top, bottom and absolute.
The first two are relative to the bar; top and bottom are relative to the pane; absolute places the mark at a price. It is the location parameter of plotshape and plotchar, and plotarrow has no such parameter at all.
| Member | Shown as |
|---|---|
location.abovebar | Above Bar |
location.belowbar | Below Bar |
location.top | Top |
location.bottom | Bottom |
location.absolute | Absolute |
plotStyle
The fourteen ways plot can draw a series: line, linebr, area, areabr, smoothedArea, stepLine, stepLinebr, stepArea, stepAreabr, bar, histogram, scatter, triangular and cross.
Name a member with the set in front of it, as in plotStyle.histogram. The br endings are published as members of their own, distinct from the plain forms.
| Member | Shown as |
|---|---|
plotStyle.line | Line |
plotStyle.linebr | Line Break |
plotStyle.area | Area |
plotStyle.areabr | Area Break |
plotStyle.smoothedArea | Smoothed Area |
plotStyle.stepLine | Step Line |
plotStyle.stepLinebr | Step Line Break |
plotStyle.stepArea | Step Area |
plotStyle.stepAreabr | Step Area Break |
plotStyle.bar | Bar |
plotStyle.histogram | Histogram |
plotStyle.scatter | Scatter |
plotStyle.triangular | Triangular |
plotStyle.cross | Cross |
shape
The twelve markers plotshape can draw: xcross, cross, triangleup, triangledown, flag, circle, arrowup, arrowdown, labelup, labeldown, square and diamond.
Written shape.triangleup and so on. The interpreter records which member you named and leaves the drawing to the chart.
| Member | Shown as |
|---|---|
shape.xcross | XCross |
shape.cross | Cross |
shape.triangleup | Triangle Up |
shape.triangledown | Triangle Down |
shape.flag | Flag |
shape.circle | Circle |
shape.arrowup | Arrow Up |
shape.arrowdown | Arrow Down |
shape.labelup | Label Up |
shape.labeldown | Label Down |
shape.square | Square |
shape.diamond | Diamond |
size
Six sizes for a marker: auto, tiny, small, normal, large and huge.
Used by the size parameter of plotshape and plotchar. auto is a member like the rest, not the absence of a choice.
| Member | Shown as |
|---|---|
size.auto | Auto |
size.tiny | Tiny |
size.small | Small |
size.normal | Normal |
size.large | Large |
size.huge | Huge |