math.max
The largest of the numbers you pass. It compares the arguments in the one call. It does not look back over bars, and it takes no length argument.
math.max(const float number0, number1, ...) → const floatmath.max(const int number0, number1, ...) → const intmath.max(input float number0, number1, ...) → input floatmath.max(input int number0, number1, ...) → input intmath.max(series float number0, number1, ...) → series floatmath.max(series int number0, number1, ...) → series intmath.max(simple float number0, number1, ...) → simple floatmath.max(simple int number0, number1, ...) → simple int| Parameter | Type | Required | Description |
|---|---|---|---|
number0, number1, ... | const float | yes | The numbers to compare, passed as a list. There is an int form and a float form. |
Returns const float or const int or input float or input int or series float or series int or simple float or simple int — The largest argument. Int arguments give an int and float arguments give a float, in the arguments’ form.
indicator("Larger of the open and the close")
plot(math.max(close, open))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.