Lipi Reference
Lipi

Functions

math.log()

The natural logarithm of `number`: its logarithm to base e. It is defined for a number greater than zero. This is the only logarithm in the namespace. There is no base-10 logarithm, and a script that calls one fails.

Syntax · 1 of 8

                math.log(const float number) → const float
              

Arguments

number required const float The number to use in the calculation.

Return Type

const float

Syntax · 2 of 8

                math.log(input float number) → input float
              

Arguments

number required input float The number to use in the calculation.

Return Type

input float

Syntax · 3 of 8

                math.log(simple float number) → simple float
              

Arguments

number required simple float The number to use in the calculation.

Return Type

simple float

Syntax · 4 of 8

                math.log(series float number) → series float
              

Arguments

number required series float The number to use in the calculation.

Return Type

series float

Syntax · 5 of 8

                math.log(const float number) → const float
              

Arguments

number required const float The number to use in the calculation.

Return Type

const float

Syntax · 6 of 8

                math.log(input float number) → input float
              

Arguments

number required input float The number to use in the calculation.

Return Type

input float

Syntax · 7 of 8

                math.log(simple float number) → simple float
              

Arguments

number required simple float The number to use in the calculation.

Return Type

simple float

Syntax · 8 of 8

                math.log(series float number) → series float
              

Arguments

number required series float The number to use in the calculation.

Return Type

series float

Example


          //@lipi=2
indicator("math.log Example", overlay=false)
// Log return from the previous bar
logReturn = math.log(close / close[1])
plot(logReturn, title="Log Return", color=color.blue)