Aroon
Aroon Up and Aroon Down: how recently price made its highest high and its lowest low, from 0 to 100.
- Aroon
- Built into Spectral
- Updates every tick
- aroon
- aroon up
- aroon down
- trend age
- chande
- new highs
MIT-0: free to use, change and share, no attribution needed. What you build from it is yours.
Already in Spectral: add it from the Indicators toolbox. The file here is the same indicator written as a custom indicator, to change or learn from. Installed, it appears next to the built-in one, marked Custom.

Overview
Aroon by Tushar Chande measures time, not price: Aroon Up is 100 when the current bar makes the highest high of the window and falls to 0 as that high ages; Aroon Down does the same for the lowest low. Each is 100 times (Length minus the bars since the extreme) divided by Length.
How to read it
Aroon Up near 100 with Aroon Down near 0 shows a fresh uptrend: new highs keep coming and no new lows. The reverse shows a downtrend. A cross of the two lines marks a possible change of trend, and both lines low (below 30) show a market without new extremes, often a range.
The 70 and 30 lines are common guides; a line staying above 70 marks a persistent trend in its direction.
Settings and limitations
Length 14 is TradingView's default; Chande's original 25 is available as a preset. Values appear once Length plus one bars are loaded. A longer length gives slower, steadier lines.
Notes
Like TradingView's Aroon, the window holds Length plus one bars, so a high made exactly Length bars ago still counts and gives 0. When the window holds the same high or low twice, the most recent one counts.
Settings
Each setting appears in the indicator's settings panel in Spectral, next to a color setting for every output.
| Setting | Type | Default | Range or options | What it does |
|---|---|---|---|---|
| Length | Whole number | 14 | 1 – 500 | Number of bars looked back for the highest high and the lowest low (the window includes the current bar plus Length bars). |
Presets
Each preset is its own entry in the Indicators toolbox, with these settings changed.
| Toolbox entry | Short name | Settings |
|---|---|---|
| Aroon (25) | Aroon 25 | Length: 25 |
What it draws
Lines
- Aroon Upsolid · 1.5 px · primary
#3FB950 - Aroon Downsolid · 1.5 px
#E5534B
Levels
- 70dotted · 1 px
#788493 - 30dotted · 1 px
#788493
Source
Save it as aroon.js and add it with Indicators → Custom indicators → Add file…. The format is explained in the custom indicators guide.
// Copyright (c) 2026 Spectral
// SPDX-License-Identifier: MIT-0
// Free to use, copy, modify and share: https://spectral.trade/docs/custom-indicators/LICENSE.txt
/** @type {import('./spectral-indicator').IndicatorV2} */
export default {
schemaVersion: 2,
id: 'aroon',
name: 'Aroon',
shortName: 'Aroon',
version: '1.0.0',
author: 'Spectral',
description: 'Aroon Up and Aroon Down: how recently price made its highest high and its lowest low, from 0 to 100.',
pane: 'oscillator',
live: { lookback: 'length' },
inputs: {
length: { type: 'integer', label: 'Length', default: 14, min: 1, max: 500, description: 'Number of bars looked back for the highest high and the lowest low (the window includes the current bar plus Length bars).' },
},
plots: {
up: { label: 'Aroon Up', color: '#3FB950', lineWidth: 1.5, primary: true },
down: { label: 'Aroon Down', color: '#E5534B', lineWidth: 1.5 },
},
levels: {
upper: { label: '70', color: '#788493', lineStyle: 'dotted' },
lower: { label: '30', color: '#788493', lineStyle: 'dotted' },
},
presets: [
{ id: 'classic', name: 'Aroon (25)', shortName: 'Aroon 25', inputs: { length: 25 } },
],
docs: {
overview: 'Aroon by Tushar Chande measures time, not price: Aroon Up is 100 when the current bar makes the highest high of the window and falls to 0 as that high ages; Aroon Down does the same for the lowest low. Each is 100 times (Length minus the bars since the extreme) divided by Length.',
howToRead: 'Aroon Up near 100 with Aroon Down near 0 shows a fresh uptrend: new highs keep coming and no new lows. The reverse shows a downtrend. A cross of the two lines marks a possible change of trend, and both lines low (below 30) show a market without new extremes, often a range.\n\nThe 70 and 30 lines are common guides; a line staying above 70 marks a persistent trend in its direction.',
settings: 'Length 14 is TradingView\'s default; Chande\'s original 25 is available as a preset. Values appear once Length plus one bars are loaded. A longer length gives slower, steadier lines.',
notes: 'Like TradingView\'s Aroon, the window holds Length plus one bars, so a high made exactly Length bars ago still counts and gives 0. When the window holds the same high or low twice, the most recent one counts.',
},
calculate(ctx) {
const { bars, inputs } = ctx;
const length = inputs.length;
const up = new Array(bars.length).fill(null);
const down = new Array(bars.length).fill(null);
// Monotonic queues of bar indexes: the front is the most recent highest high and lowest low of the window. They
// only ever hold bars of the last Length + 1, so each value depends on those bars alone (live lookback: Length).
const highs = [];
const lows = [];
let highHead = 0;
let lowHead = 0;
for (let index = 0; index < bars.length; index += 1) {
while (highs.length > highHead && bars[highs[highs.length - 1]].high <= bars[index].high) highs.pop();
highs.push(index);
while (lows.length > lowHead && bars[lows[lows.length - 1]].low >= bars[index].low) lows.pop();
lows.push(index);
if (highs[highHead] < index - length) highHead += 1;
if (lows[lowHead] < index - length) lowHead += 1;
if (index < length) continue;
up[index] = (100 * (length - (index - highs[highHead]))) / length;
down[index] = (100 * (length - (index - lows[lowHead]))) / length;
}
return { plots: { up, down }, levels: { upper: 70, lower: 30 } };
},
};Adapt it with an LLM
Paste this into your assistant and replace the second-to-last line with the change you want.
Start from this Spectral custom indicator: https://spectral.trade/indicators/aroon.js Format reference: https://spectral.trade/docs/custom-indicators.llm.md Keep the file format and every rule of the reference; give the result a new id, name, shortName and version, and update docs and input descriptions to match. Keep its live updates exact and fast (section "Fast live updates" of the reference): carry values from bar to bar only through ctx.ta, and raise live.lookback if the change reads further back; Spectral rejects a file whose live updates differ from a full recalculation or are too slow. Change I want: <describe the change> Answer with the complete file in one code block, ready to save as <id>.js.


