Skip to content

LAST() Function

By Optuma Team · Updated 2020-06-10

Every bar on a chart has a Close price which is the last price of that bar, but only the final, current bar on the right hand edge has the Last price. That is, the close price of the last bar is LAST. The reason to use this function is that sometimes you want to know the very last price and Last() is an easy way to get that. The LAST() function will return the current value of a price bar (closing value by default) or indicator (see also FIRST() function).

If you apply a Show Plot with just LAST() as the formula by default it will plot a horizontal line at the last closing price. Change the formula to LAST(HIGH()) to plot at the last high value.

This example compares Show Plot with LAST(HIGH()) in blue vs HIGH() in green. Similarly, if LAST() Show Plot is applied to an indicator, eg the Relative Index Comparison tool it will draw the last value across the screen:

LAST() Function

For more examples using LAST() with BARDATE() see this forum post.

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.