ADX
The ADX measures the strength of a trend regardless of its direction.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the ADX direction or its level position. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers exits by the ADX direction or its level position. |
The ADX produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.
Logic rules
The indicator offers the standard oscillator rule set, evaluated on the ADX value:
| Rule | Signal is 1 when |
|---|---|
| ADX rises | ADX rose on the previous bar |
| ADX falls | ADX fell on the previous bar |
| ADX is higher than the Level line | ADX is above Level |
| ADX is lower than the Level line | ADX is below Level |
| ADX crosses the Level line upward | ADX crossed above Level from below |
| ADX crosses the Level line downward | ADX crossed below Level from above |
| ADX changes its direction upward | ADX formed a valley (down then up) |
| ADX changes its direction downward | ADX formed a peak (up then down) |
The ADX measures trend strength without a direction: the same signal is written for both the long and the short side (noDirectionOscillator). The indicator itself does not distinguish between bullish and bearish trends — pair it with a directional rule such as Directional Indicators when the strategy needs a direction.
Parameters
| Parameter | Type | Default | Range | Purpose |
|---|---|---|---|---|
| Period | number | 14 | 1 to 1000 | Bars of the directional calculation |
| Level | number | 0 | 0 to 100 | Threshold for the level rules |
Calculation
tech.ADX in engine/indicator-engine/tech.ts computes:
- DI+ and DI-: exponential averages of the positive and negative directional movement, normalized by the true range.
- DX =
100 × |DI+ − DI-| / (DI+ + DI-). - ADX = exponential average of the DX over the Period.
The ADX line is drawn in a separate chart pane; higher values mean a stronger trend.
Backtesting
- The rule is evaluated on the previous (closed) bar with the standard dead zone (
SIGMA = 0.000001). - The indicator contributes only a single signal array copied to both directions — it never changes the entry or exit order price.
- An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.