ATR, DMI, ADX, Supertrend and SAR: range, direction and state
Teaching tables and diagrams with explicit inputs, formulas, seeds, local conditions and limits when checking Elliott wave hypotheses.
Published: (UTC+3)
Русский · English · Deutsch · Español · Français · Italiano · 繁體中文 · 日本語 · 한국어
This lab connects indicators to a wave hypothesis through explicit calculations. Every example price, volume and parameter is invented. A positive indicator condition describes a local state; it does not establish an entire Elliott count or measure a probability of profit.
Invented inputs and calculation rules
The table contains completed bars. t is an ordinal index; O/H/L/C mean open/high/low/close and V is invented volume from one source, not an entire-market total. Dataset A has a preceding bar t=−1 with C=99, H=100, L=98. Windows include the current bar unless explicitly stated otherwise.
SMA_n is the mean of the latest n values. EMA_n uses α=2/(n+1) and RMA_n uses α=1/n; both recursions y_t=αx_t+(1−α)y_(t−1) start with the mean of the first n available values. Intermediate values are not rounded; tables display up to six decimals. “—” means insufficient history or an undefined value, not zero. Missing inputs are not replaced with zero. Short teaching periods are not recommended settings; the seeds and zero policies are declared here, without a claim of parity with every platform.
| Dataset | t | O | H | L | C | V |
|---|---|---|---|---|---|---|
| A | 0 | 99.5 | 101 | 99 | 100 | 10 |
| A | 1 | 101.5 | 103 | 101 | 102 | 12 |
| A | 2 | 100.5 | 102 | 100 | 101 | 8 |
| A | 3 | 103.5 | 105 | 103 | 104 | 15 |
| A | 4 | 102.5 | 104 | 102 | 103 | 9 |
| A | 5 | 105.5 | 107 | 105 | 106 | 20 |
| A | 6 | 103.5 | 105 | 103 | 104 | 11 |
| A | 7 | 106.5 | 108 | 106 | 107 | 18 |
| A | 8 | 104.5 | 106 | 104 | 105 | 14 |
| A | 9 | 107.5 | 109 | 107 | 108 | 22 |
| A | 10 | 103.5 | 105 | 103 | 104 | 16 |
Can an early undefined indicator value be replaced by zero and counted as a negative signal?
No. A missing full window and a calculated zero are different states; freeze the warm-up policy in advance.
ATR: range including gaps
TR compares the bar range with distances from the previous close; ATR3 smooths TR using RMA. Formula and worked calculation: TR_t=max(H_t−L_t,|H_t−C_(t−1)|,|L_t−C_(t−1)|); ATR3=RMA3(TR). ATR3_2=(2+3+2)/3=7/3; t7: TR=max(2,4,2)=4; ATR3=3.360768.
Initialization uses C_(−1)=99; the first ATR is mean TR0–2. Then ATR_t=(TR_t+2ATR_(t−1))/3. Zero TR is valid; fewer than three observations gives no value.
Local research predicate: t7: ATR3_t>ATR3_(t−1). ATR rises from t6 to t7, but it is not a direction measure. The same TR can accompany a decline. An ATR multiple alone specifies neither an account risk budget nor a guaranteed stop fill.
| t | C | TR | ATR3 |
|---|---|---|---|
| 0 | 100 | 2 | — |
| 1 | 102 | 3 | — |
| 2 | 101 | 2 | 2.333333 |
| 3 | 104 | 4 | 2.888889 |
| 4 | 103 | 2 | 2.592593 |
| 5 | 106 | 4 | 3.061728 |
| 6 | 104 | 3 | 3.041152 |
| 7 | 107 | 4 | 3.360768 |
| 8 | 105 | 3 | 3.240512 |
| 9 | 108 | 4 | 3.493675 |
| 10 | 104 | 5 | 3.995783 |
Reproduce the highlighted calculation and evaluate the local predicate. Does the result establish the entire wave count?
3.360768175583>3.041152263374. No. It is the result of the stated calculation on invented data, not proof of a wave structure or profit.
DMI: directional movement and normalization
Compare the increase in H with the decrease in L; only the strictly larger positive component receives DM. Formula and worked calculation: u=H_t−H_(t−1); d=L_(t−1)−L_t; +DM={u:u>max(d,0); 0:u≤max(d,0)}; −DM={d:d>max(u,0); 0:d≤max(u,0)}; ±DI=100RMA3(±DM)/ATR3. t7: +DI=52.775510; −DI=17.469388.
When u=d both DM values are zero. DM and TR use the same seed window t0–2; ATR=0 makes DI undefined. Prior H/L are supplied in the inputs.
Local research predicate: t7: +DI>−DI. +DI>−DI at t7 describes dominance of smoothed positive movement. It is not a measured buyer/seller balance: DMI uses H/L/C without classifying trades.
| t | C | +DM | −DM | RMA3(+DM) | RMA3(−DM) | +DI | −DI |
|---|---|---|---|---|---|---|---|
| 0 | 100 | 1 | 0 | — | — | — | — |
| 1 | 102 | 2 | 0 | — | — | — | — |
| 2 | 101 | 0 | 1 | 1 | 0.333333 | 42.857143 | 14.285714 |
| 3 | 104 | 3 | 0 | 1.666667 | 0.222222 | 57.692308 | 7.692308 |
| 4 | 103 | 0 | 1 | 1.111111 | 0.481481 | 42.857143 | 18.571429 |
| 5 | 106 | 3 | 0 | 1.740741 | 0.320988 | 56.854839 | 10.483871 |
| 6 | 104 | 0 | 2 | 1.160494 | 0.880658 | 38.159675 | 28.958051 |
| 7 | 107 | 3 | 0 | 1.773663 | 0.587106 | 52.77551 | 17.469388 |
| 8 | 105 | 0 | 2 | 1.182442 | 1.05807 | 36.489347 | 32.651333 |
| 9 | 108 | 3 | 0 | 1.788294 | 0.70538 | 51.186633 | 20.19021 |
| 10 | 104 | 0 | 4 | 1.192196 | 1.803587 | 29.836362 | 45.137255 |
Reproduce the highlighted calculation and evaluate the local predicate. Does the result establish the entire wave count?
52.775510>17.469388. No. It is the result of the stated calculation on invented data, not proof of a wave structure or profit.
ADX: the magnitude of separation, not direction
DX normalizes the absolute DI difference; ADX3 smooths it without retaining direction. Formula and worked calculation: DX=100|+DI−−DI|/(+DI+−DI); ADX3=RMA3(DX). DX7=50.261476; ADX3_7=46.397841.
DX starts at t2 after DI; ADX is seeded with mean DX2–4 at t4. A zero DI sum gives undefined DX, not an artificial strength signal.
Local research predicate: t7: ADX3>25. The teaching threshold ADX>25 holds at t7. Swapping +DI and −DI leaves DX unchanged: a high ADX can also describe a decline. The threshold does not identify a wave number.
| t | C | +DI | −DI | DX | ADX3 |
|---|---|---|---|---|---|
| 0 | 100 | — | — | — | — |
| 1 | 102 | — | — | — | — |
| 2 | 101 | 42.857143 | 14.285714 | 50 | — |
| 3 | 104 | 57.692308 | 7.692308 | 76.470588 | — |
| 4 | 103 | 42.857143 | 18.571429 | 39.534884 | 55.335157 |
| 5 | 106 | 56.854839 | 10.483871 | 68.862275 | 59.844197 |
| 6 | 104 | 38.159675 | 28.958051 | 13.709677 | 44.466024 |
| 7 | 107 | 52.77551 | 17.469388 | 50.261476 | 46.397841 |
| 8 | 105 | 36.489347 | 32.651333 | 5.55102 | 32.782234 |
| 9 | 108 | 51.186633 | 20.19021 | 43.426441 | 36.330303 |
| 10 | 104 | 29.836362 | 45.137255 | 20.408371 | 31.022992 |
Reproduce the highlighted calculation and evaluate the local predicate. Does the result establish the entire wave count?
46.397841>25; |a−b|=|b−a|. No. It is the result of the stated calculation on invented data, not proof of a wave structure or profit.
Supertrend: bands and persistent state
The chosen settings are ATR3 and multiplier 1. Final bands retain history; they are not merely the current bar’s HL2±ATR. Formula and worked calculation: bU=HL2+ATR3; bL=HL2−ATR3; a=(bU_t<U_(t−1) ∨ C_(t−1)>U_(t−1)); b=(bL_t>L_(t−1) ∨ C_(t−1)<L_(t−1)); U_t={bU_t:a; U_(t−1):¬a}; L_t={bL_t:b; L_(t−1):¬b}. t7: U=107.041152; L=103.639232; ST=L.
Seed t2 as down (−1), ST=U. From down, C>U flips up (+1); from up, C<L flips down. Equality does not flip. Up selects L and down selects U; state is undefined before ATR.
Local research predicate: t7: s=+1. State +1 at t7 does not mean a fresh flip occurred at t7. It changes to −1 at t10. The declared recursion can whipsaw; line color does not check wave structure.
| t | C | ATR3 | U | L | s | ST |
|---|---|---|---|---|---|---|
| 0 | 100 | — | — | — | — | — |
| 1 | 102 | — | — | — | — | — |
| 2 | 101 | 2.333333 | 103.333333 | 98.666667 | -1 | 103.333333 |
| 3 | 104 | 2.888889 | 103.333333 | 101.111111 | 1 | 101.111111 |
| 4 | 103 | 2.592593 | 105.592593 | 101.111111 | 1 | 101.111111 |
| 5 | 106 | 3.061728 | 105.592593 | 102.938272 | 1 | 102.938272 |
| 6 | 104 | 3.041152 | 107.041152 | 102.938272 | 1 | 102.938272 |
| 7 | 107 | 3.360768 | 107.041152 | 103.639232 | 1 | 103.639232 |
| 8 | 105 | 3.240512 | 107.041152 | 103.639232 | 1 | 103.639232 |
| 9 | 108 | 3.493675 | 107.041152 | 104.506325 | 1 | 104.506325 |
| 10 | 104 | 3.995783 | 107.995783 | 104.506325 | -1 | 107.995783 |
Reproduce the highlighted calculation and evaluate the local predicate. Does the result establish the entire wave count?
ST7=L7=103.639232; s7=+1; s10=−1. No. It is the result of the stated calculation on invented data, not proof of a wave structure or profit.
Parabolic SAR: extreme, acceleration and reversal
EP is the current state’s extreme and AF its acceleration factor; direction and seed are explicit. Formula and worked calculation: q_t=SAR_(t−1)+AF_(t−1)(EP_(t−1)−SAR_(t−1)); AF0=0.02; ΔAF=0.02; AFmax=0.20. t7: SAR=100.939586; EP=108; AF=0.10; s=+1.
Seed t0 up with SAR=L0=99 and EP=H0=101. An up candidate is capped at the prior two lows, a down candidate floored at the prior two highs (only one exists at t1). A strict current-low/down or current-high/up breach reverses: SAR=prior EP, AF=0.02, EP=current opposite extreme. Without reversal a new EP raises AF to its cap; equality does not reverse.
Local research predicate: t7: C>SAR ∧ s=+1. This is a declared teaching seed, not guaranteed parity with every SAR. Reversal at t10 gives SAR=109: a state point is not a promised stop fill or proof that a wave ended.
| t | C | SAR | EP | AF | s |
|---|---|---|---|---|---|
| 0 | 100 | 99 | 101 | 0.02 | 1 |
| 1 | 102 | 99 | 103 | 0.04 | 1 |
| 2 | 101 | 99 | 103 | 0.04 | 1 |
| 3 | 104 | 99.16 | 105 | 0.06 | 1 |
| 4 | 103 | 99.5104 | 105 | 0.06 | 1 |
| 5 | 106 | 99.839776 | 107 | 0.08 | 1 |
| 6 | 104 | 100.412594 | 107 | 0.08 | 1 |
| 7 | 107 | 100.939586 | 108 | 0.1 | 1 |
| 8 | 105 | 101.645628 | 108 | 0.1 | 1 |
| 9 | 108 | 102.281065 | 109 | 0.12 | 1 |
| 10 | 104 | 109 | 103 | 0.02 | -1 |
Reproduce the highlighted calculation and evaluate the local predicate. Does the result establish the entire wave count?
107>100.939586; s7=+1; SAR10=109. No. It is the result of the stated calculation on invented data, not proof of a wave structure or profit.
A testable condition and a wave strategy
For a study, freeze the source, timeframe, parameters, formula, availability time and alternative wave count first. Each section gives a local predicate with a threshold chosen for arithmetic practice. Record both positive and negative outcomes at bar close without selecting settings after seeing the result. Check a structural wave-rule violation from price separately.
RSI, averages, MACD and other price transforms share overlapping inputs. Several agreeing lines are not independent votes and do not supply probabilities that can be multiplied. A strategy test needs a separate sample and a predeclared outcome; simulated trades also need execution and cost assumptions. This lab supplies no trading performance, accuracy rate or product features.
| Value | Local research predicate |
|---|---|
| ATR: range including gaps | t7: ATR3_t>ATR3_(t−1) |
| DMI: directional movement and normalization | t7: +DI>−DI |
| ADX: the magnitude of separation, not direction | t7: ADX3>25 |
| Supertrend: bands and persistent state | t7: s=+1 |
| Parabolic SAR: extreme, acceleration and reversal | t7: C>SAR ∧ s=+1 |
Three price transforms agree. Does that provide three independent confirmations and establish the count?
No. Shared inputs create dependence; local filters are checked separately from price rules, and usefulness needs another sample.