Skip to content

BarIndex Function

By Optuma Team · Updated 2020-08-13

The BarIndex() function is a progressive count of the number of bars on a chart, with the first bar having a Bar Index value of 0. It can be used in a scan to filter out new listings, e.g. to ignore codes with less than 100 days of data:

BARINDEX() > 100

Here’s how the BarIndex() displays in a Show View:

BARINDEX

To show the last X number of bars in a different colour use the following under Custom Bar Colours (showing last 12 weeks, or 60 bars on a daily chart):

//Get last BarIndex value;
B1 = LAST(BARINDEX());
//Subtract number of trading days;
BARINDEX() >= (B1-60)

BARINDEX

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.