ScriptingReferenceConstant index

Constant index

Lipi defines 24 named constants.

Values and literals

ConstantTypeDescription
falseconst bool
math.econst floatEuler’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.phiconst floatThe 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.piconst floatArchimedes’ 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.rphiconst floatThe 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.
naconst naTests 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.
trueconst 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.

ConstantType
color.aquaconst color
color.blackconst color
color.blueconst color
color.fuchsiaconst color
color.grayconst color
color.greenconst color
color.limeconst color
color.maroonconst color
color.navyconst color
color.oliveconst color
color.orangeconst color
color.purpleconst color
color.redconst color
color.silverconst color
color.tealconst color
color.whiteconst color
color.yellowconst 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.
Upgrade