QStick

All functions · nseries package

QStick

func (s Series) QStick(o, c Series, length int) Series

QStick implements Tushar Chande’s Qstick momentum indicator: the length-bar average of the close c less the length-bar average of the open o. The receiver is not used and the result has the length of c. Each average is taken over its own series, and the two are paired by Sub, so they are right-aligned at the most recent bar: when o is shorter than c, the leading len(c)-len(o) values are zero, and an empty o gives zeros.

For equal input lengths, bars 0 to length-2 equal c[i] - o[i] because both averages pass their inputs through. The first full averaged difference is at length-1, requiring length bars.