Skip to content

Maximum

Math · Arithmetic

Maximum node on the canvas

Element-wise maximum of two series — the larger of A and B at each bar. Use for 'the wider stop', 'floor a level'. NaN if either input is NaN.

Maximum takes two series and, bar by bar, returns whichever is larger. It's the element-wise "the bigger of A and B" — the block you use to floor a level, pick the wider of two stops, or keep the stronger of two readings.

How it works

Each bar it outputs max(A, B). Both inputs are series, so either can be price, an indicator, or a constant. If either input is NaN on a bar, the result is NaN. There are no parameters — the behaviour is entirely determined by what you wire in. Lookahead-free.

When to use it

Use it whenever "never less than X" is the rule: floor a trailing stop at breakeven so it can only ratchet the safe way, take the wider of an ATR stop and a structure stop so you're never too tight, or keep the higher of two momentum scores. Paired with Minimum it's how you hand-build a Clamp or bound a level.

Example

Breakeven floor on a trailing stop: feed your computed trailing-stop level and the entry price into Maximum so the stop can rise with price but never drop below entry. Wire the result into the Tester's stop input.

Tips & gotchas

  • Element-wise, per bar — not the running maximum over time (that's Running Max Since).
  • NaN in either input → NaN out.
  • Pair with Minimum to bound a value on both sides, or just use Clamp.

Inputs

Socket Type What to wire in
A series / bars First operand. BARS input uses close.
B series / bars Second operand. BARS input uses close.

Outputs

Output Type Plots as Description
max(A,B) series Line · sub-pane Per-bar element-wise maximum.

Reference auto-generated from the block catalog · category Math.