math.pow
base raised to the power of exponent.
The language has no exponentiation operator: a token for one exists in the lexer but no rule reaches it, so source containing ^ does not parse. This function is how you raise a number to a power.
math.pow(const float base, const float exponent) → const floatmath.pow(input float base, input float exponent) → input floatmath.pow(series float base, series float exponent) → series floatmath.pow(simple float base, simple float exponent) → simple float| Parameter | Type | Required | Description |
|---|---|---|---|
base | const float | yes | The number to raise. |
exponent | const float | yes | The power to raise it to. |
Returns const float or input float or series float or simple float — The result, as a float in the arguments’ form.
indicator("Close squared")
plot(math.pow(close, 2))See also math.abs · math.acos · math.asin
Part of the function index.
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.