Aroon

All functions · nseries package

AroonDown

func (s Series) AroonDown(n int) Series

AroonDown returns Chande’s Aroon-Down over n bars, which measures how recently the lowest low occurred. The window at bar i is the current bar plus the n prior bars, s[i-n] to s[i] (n+1 bars in all), and the value is (n - b) / n * 100, evaluated in that order, where b is how many bars back the lowest value in the window lies. The range is 0 to 100 inclusive: 100 when the current bar is the lowest and 0 when the lowest is exactly n bars back. On ties the most recent lowest bar counts. A NaN never displaces a number as the lowest, and a NaN current bar gives 100. Indices 0 to n-1 are 50 (warm-up), and every value is 50 when n >= len(s); every value is 0 when n < 1. This matches TA-Lib, TradingView and Chande’s stated definition; releases before this change, like Chande’s printed SuperCharts code and TradeStation, used an n-bar window whose minimum was 100/n. Note: The input series should always be the lows for this calculation.

The first valid index is n and the minimum length is n+1. A flat window gives 100, because on ties the most recent lowest bar counts (b = 0), so the warm-up (50) and the flat value differ. 50 reads as neither a strong down-trend (above 70) nor a weak one (below 30), and an AroonUp/AroonDown crossover rule compares 50 with 50 on warm-up bars, so trim (Window(-n)) or mask (SetN(n, math.NaN())) the first n bars. This warm-up was reviewed in GLE-254 (3 October 2026) and kept.

AroonUp

func (s Series) AroonUp(n int) Series

AroonUp returns Chande’s Aroon-Up over n bars, which measures how recently the highest high occurred. The window at bar i is the current bar plus the n prior bars, s[i-n] to s[i] (n+1 bars in all), and the value is (n - b) / n * 100, evaluated in that order, where b is how many bars back the highest value in the window lies. The range is 0 to 100 inclusive: 100 when the current bar is the highest and 0 when the highest is exactly n bars back. On ties the most recent highest bar counts. A NaN never displaces a number as the highest, and a NaN current bar gives 100. Indices 0 to n-1 are 50 (warm-up), and every value is 50 when n >= len(s); every value is 0 when n < 1. This matches TA-Lib, TradingView and Chande’s stated definition; releases before this change, like Chande’s printed SuperCharts code and TradeStation, used an n-bar window whose minimum was 100/n. Note: The input series should always be the highs for this calculation.

The first valid index is n and the minimum length is n+1. A flat window gives 100, because on ties the most recent highest bar counts (b = 0), so the warm-up (50) and the flat value differ. 50 reads as neither a strong up-trend (above 70) nor a weak one (below 30), and an AroonUp/AroonDown crossover rule compares 50 with 50 on warm-up bars, so trim (Window(-n)) or mask (SetN(n, math.NaN())) the first n bars. This warm-up was reviewed in GLE-254 (3 October 2026) and kept.