Aroon (aroon)
Aroon measures how recently the selected high and low occurred within a window, not the size of the movements that produced them. It exposes two series ranging from 0 to 100. Aroon Up is 100 when the occurrence used for the window high is on the current candle, then falls as that occurrence ages; Aroon Down applies the same reading to the low. If the same extreme occurs more than once, the block keeps the oldest occurrence still present in the window.
An Aroon Up above Aroon Down means that the selected high is more recent than the selected low; the reverse means that the low is more recent. Two high values indicate that both extremes are recent, while two low values indicate that both are old within the window. length defines that window as the current candle and the preceding length candles, and therefore controls how quickly the lines return toward zero when no new extreme appears.
Block declaration
A strategy can declare multiple [[aroon]] blocks. Each block produces two numeric series, Aroon Up and Aroon Down, identified by up_id and down_id, respectively.
No source parameter is needed because the indicator always uses candle high and low prices.
Examples
Minimal setup
This block computes Aroon Up and Aroon Down with the default length 14.
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"Custom fixed setup
This block uses a custom length value.
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"
length = 21Finding the optimal length
This block declares several possible values for length.
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"
length.start = 7
length.stop = 28Filtering long entries during an uptrend
This example places Aroon before a long entry as a filter. The strategy moves to the next block when the market has made a recent high without also making a recent low: Aroon Up must reach its minimum threshold while Aroon Down stays below its maximum threshold.
The grid search compares 75 versions of this filter by varying its lookback (length) and both thresholds. A shorter length focuses on recent market structure; raising aroon_up_min or lowering aroon_down_max makes the entry more selective.
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"
length.start = 14
length.stop = 28
length.step = 7
[[constant]]
id = "aroon_up_min"
start = 70
stop = 90
step = 5
[[constant]]
id = "aroon_down_max"
start = 10
stop = 30
step = 5
[[condition]]
id = "long_trend_filter"
condition = "aroon_up >= aroon_up_min and aroon_down <= aroon_down_max"
next_block_id = "..."Dedicated symbol and timeframe
This Aroon block uses the daily candles from BINANCE:ETHUSDT. The high and low prices come from this symbol and timeframe, independently of the primary symbol and timeframe defined in [backtest]. See Exchanges, Symbols and Timeframes for alignment rules.
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"
symbol = "BINANCE:ETHUSDT"
timeframe = "D"Parameters
| Parameter | Description |
|---|---|
up_idString Required | Identifier for the Aroon Up series. |
down_idString Required | Identifier for the Aroon Down series. |
lengthInteger Optional | Aroon length used to measure the position of recent highs and lows; must be ≥ 1 when specified. If length is omitted, the default value is 14.Usage: • Fixed: length = value• Grid search: – length.start = min_value– length.stop = max_value– length.step = value (optional, default 1) |
symbolString or Array Optional | Market symbol(s) from which this block reads its candles (high, low). If omitted, the block inherits the [backtest] symbol. For symbol format, arrays, and alignment rules, see Exchanges, Symbols and Timeframes. |
timeframeString or Array Optional | Timeframe on which this indicator is computed. If timeframe is omitted, the computation uses the grid’s main timeframe defined in [backtest].For accepted formats and timeframe alignment rules, see Exchanges, Symbols and Timeframes. |
The source key is not accepted in [[aroon]]. The indicator always uses the high and low price series from the selected market and timeframe.
Available variables
The identifiers below are available directly in expressions. The Aroon block exposes two numeric series, the length used for the calculation, and its symbol and timeframe.
Assume the block is configured as follows:
[[aroon]]
up_id = "aroon_up"
down_id = "aroon_down"Then:
| Variable | Description |
|---|---|
aroon_up oraroon_up[0]Decimal | Current Aroon Up value. |
aroon_up[n]Decimal | Aroon Up value from n candles ago. |
aroon_down oraroon_down[0]Decimal | Current Aroon Down value. |
aroon_down[n]Decimal | Aroon Down value from n candles ago. |
aroon_up.lengthDecimal | Aroon length used, exposed on the Aroon Up identifier. |
aroon_up.high_sourcearoon_up.low_sourcearoon_down.high_sourcearoon_down.low_sourceString | Names of the input sources used (high and low) on each output. |
aroon_up.symbolaroon_down.symbolString | Symbol used. |
aroon_up.timeframearoon_down.timeframeString | Timeframe used. |
Notes
- Numeric variables support arithmetic, comparisons, and logical operators.
- Text variables are strings intended for equality and inequality checks.