Aroon Up, Down, and Oscillator
Measure Extreme Recency
Install and import
npm install fintech-algorithmsimport { aroon } from "fintech-algorithms/technical-indicators/trend-systems/aroon";Signature
aroon(high, low, period)Measures how recently the highest high and lowest low occurred within the lookback, expressed as 0–100. Unlike most trend indicators it reads *elapsed time* rather than price distance.
Parameters
| Name | Type | Notes |
|---|---|---|
high | number[] | Per-bar high prices, chronological. |
low | number[] | Per-bar low prices, chronological. |
period | number | Lookback in bars for the extreme search. min: 1 · integer: true |
Returns
Record<string, (number | null)[]> · length same-as-input
Parallel series: aroon_up, aroon_down, and the oscillator difference between them.
Warm-up
The first period positions are null. A full lookback is required before an extreme can be located.
Errors
- When period < 1 or is not an integer — throws RangeError
- When the input series are not all the same length — throws RangeError
Complexity: time O(n × period),
space O(n).
Worked example
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input
[101.415, 102.06264, 102.772785, 103.494002, 104.181554, 104.803509]Showing 6 of 180 elements.
[99.3245, 99.468834, 99.976055, 100.625352, 101.389232, 102.216086]Showing 6 of 180 elements.
25Call
aroon(high, low, period)Returns
object with 3 fields: aroon_up, aroon_down, oscillator
{
"aroon_up": [null, null, null, null, null, null],
"aroon_down": [null, null, null, null, null, null],
"oscillator": [null, null, null, null, null, null]
}Diagrams
Calculation flow
Aroon calculation flow
flowchart LR
A["Validated finalized bar"] --> B["Causal window or recursive state"]
B --> C["Explicit seed and boundary rule"]
C --> D["Aligned Aroon output"]
D --> E["Diagnostics and audit evidence"]
How it works
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References
- Tushar Chande's 1995 Aroon article — Tushar Chande's 1995 Aroon article
- TA-Lib AROON — TA-Lib project or TradingView, as identified by the linked page
- Pinned TA-Lib ta_AROON.c implementation — TA-Lib project or TradingView
- Canonical synthetic fixture and independent arithmetic — The Fintech Builder
- R5 — TA-Lib AROONOSC function documentation — TA-Lib project or TradingView