Constant index
Lipi defines 24 named constants.
Values and literals
| Constant | Type | Description |
|---|---|---|
false | const bool | |
math.e | const float | Euler’s number: the base of the natural logarithm. The contract records this constant’s name and type only, so this edition does not print its value. |
math.phi | const float | The golden ratio: the positive number whose square is one greater than itself. The contract records this constant’s name and type only, so this edition does not print its value. |
math.pi | const float | Archimedes’ constant: the ratio of a circle’s circumference to its diameter. The contract records this constant’s name and type only, so this edition does not print its value. |
math.rphi | const float | The golden ratio conjugate: the reciprocal of the golden ratio. The contract records this constant’s name and type only, so this edition does not print its value. |
na | const na | Tests whether a value is absent. It takes any type and gives back a bool. This is the test a script needs often, because so much reads na when there is nothing behind it: an instrument property that is unknown, an orderflow figure on a bar with no footprint data, a colour function handed an na. |
true | const bool |
Colours
Each of these names a colour the platform ships. They are listed by name rather than by value: the value a name resolves to is a product decision that can change between releases, and a script that names the colour keeps working when it does.
| Constant | Type |
|---|---|
color.aqua | const color |
color.black | const color |
color.blue | const color |
color.fuchsia | const color |
color.gray | const color |
color.green | const color |
color.lime | const color |
color.maroon | const color |
color.navy | const color |
color.olive | const color |
color.orange | const color |
color.purple | const color |
color.red | const color |
color.silver | const color |
color.teal | const color |
color.white | const color |
color.yellow | const color |
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.