Skip to content
StatePath
Tool Atlasmath.last

Tool

Last (BUFFER → SCALAR)

math.last

MathPositional

Inputs

aBuffer (time series)

The number line to read the latest value from — for example a moving average or an oscillator.

Outputs

Scalar

A single number: the value of the input series at the most-recent bar.

Last pulls the most-recent value off a number line and hands it back as a single number. It’s how you collapse a whole series down to ‘the value right now’.

Last (BUFFER → SCALAR) overview diagramserieslastscalar

How it works

A series carries one value per bar; Last simply reads the value at the current (most recent) bar of input a and returns that one number. It has no settings — it always takes the latest point, which is exactly what tools that want a single scalar expect.

Connects to

Reads from
Feeds into

Examples

  • Take the latest value of a moving average with Last, then Broadcast it into a flat reference line for comparison.
  • Read the most-recent reading of an oscillator with Last to feed a tool that needs a single scalar input.

Common mistakes

  • Expecting Last to give an older bar’s value — it always returns the current bar; use math.arithmetic in shift mode first if you need an earlier point.
  • Using Last on a series and then trying to compare it bar-by-bar — the result is one fixed number, so Broadcast it back to a line first.

See also