Index Of

All functions · nseries package

IndexOfHighest

func (s Series) IndexOfHighest(n int) int

IndexOfHighest returns the index (zero-based) of the highest value in last “n” values in a series. Where the highest value occurs more than once in the series, the index of the most recent (latest) one is returned. For example, the index returned for { 4, 6, 8, 10, 12, 10 } would be 4, since 12 is the fifth (i.e. index = 4) value in the series.

IndexOfHighestS

func (s Series) IndexOfHighestS(n int) Series

IndexOfHighestS returns a series of indices (zero-based) of the highest value in “n”-length windows in a series. Where the highest value occurs more than once in the series, the index of the most recent (latest) one is returned.

Bars 0 to n-2 are -1, a sentinel outside the valid range 0 to n-1.

IndexOfLowest

func (s Series) IndexOfLowest(n int) int

IndexOfLowest returns the index (zero-based) of the lowest value in last “n” values in a series. Where the lowest value occurs more than once in the series, the index of the most recent (latest) one is returned. For example, the index returned for { 12, 4, 6, 8, 10, 12 } would be 1, since 4 is the second (i.e. index = 1) value in the series.

IndexOfLowestS

func (s Series) IndexOfLowestS(n int) Series

IndexOfLowestS returns a series of indices (zero-based) of the lowest value in “n”-length windows in a series. Where the lowest value occurs more than once in the series, the index of the most recent (latest) one is returned.

Bars 0 to n-2 are -1, a sentinel outside the valid range 0 to n-1.