What this ADX reading describes
ADX summarizes directional movement in price history. A high reading can accompany a falling market. The accompanying DI values compare upward and downward movements; they do not measure buy orders, sell orders or future returns. This calculator displays only the final observation from the pasted sample.
The calculation runs in this page from your entered numbers. It does not fetch prices, infer missing bars, detect a symbol, adjust splits or choose a trading session. Keep the same interval and price adjustment method across every row. Dates are not accepted, so you must check chronological order yourself.
Calculation and starting values
- For each row after the first, compute U = current high − prior high and D = prior low − current low. Set +DM to U only if U is positive and greater than D; otherwise use zero. Set −DM to D only if D is positive and greater than U. An equal move sets both to zero.
- True range is the largest of high − low, |high − prior close|, and |low − prior close|. Thus an opening gap can affect the result even though an open column is not needed.
- Seed each smoothed DM and TR with the sum of its first n changes. For each later row, update S = prior S − prior S / n + current value.
- Compute +DI = 100 × smoothed +DM / smoothed TR, and similarly for −DI. A zero smoothed TR produces zero for both DI values here.
- DX = 100 × |+DI − (−DI)| / (+DI + (−DI)). If the denominator is zero, this tool uses DX zero.
- The first ADX is the mean of n DX readings. Later values use ADX = (prior ADX × (n − 1) + current DX) / n.
With n = 14, row 15 gives the first DX because row 1 provides the previous price. Rows 15 through 28 supply the first 14 DX values. That makes 28 input rows the minimum, not 15. The minimum permits an initial value; it does not make the result independent of the sample start.
A four-row calculation you can verify
Set the period to 2 and paste these hypothetical rows. They are arithmetic examples, not observations of a security.
10, 8, 9
11, 9, 10
10, 8, 9
12, 9, 11The three changes produce +DM of 1, 0, 2; −DM of 0, 1, 0; and TR of 2, 2, 3. The initial two-change sums are 1, 1 and 4, giving +DI = 25, −DI = 25 and DX = 0. After the final row, those smoothed sums become 2.5, 0.5 and 5. The output is +DI 50, −DI 10, DX 66.67 and ADX 33.33.
The 28-row button example instead raises high, low and close by one on every row, maintaining a high-low range of two. It returns +DI 50, −DI 0 and ADX 100 at period 14. That extreme result is deliberately constructed to show the formula; it is not evidence of a profitable strategy.
Comparing the result with a chart
Match the exact high, low and close values, bar interval, session, price adjustments and starting history before comparing outputs. TradingView DMI has separate DI length and ADX smoothing settings; this calculator uses one number for both. Extra history changes the recursive starting values, so a short pasted sample need not match a chart with many earlier bars.
A threshold such as ADX 25 can be a hypothesis for a strategy test. It is not proof that trend trades work, nor does falling ADX by itself identify a reversal. A test also needs entries, exits, position sizing, fees, slippage and data outside the period used to choose the rule. This page does not perform that backtest.
Frequently asked questions
How many rows does this ADX calculator need?
This implementation needs at least twice the selected period: 28 rows for period 14. The first row supplies a previous close; directional movement is seeded from the next 14 changes, and ADX needs 14 DX observations. Additional history can change the final reading.
What data format is accepted?
Paste exactly three numeric columns per nonblank line: high, low, close. Use commas or whitespace, oldest row first, with one consistent bar interval. Remove headers, dates, open and volume columns. High must be at least low, and close must lie within that range. Blank lines are ignored; malformed rows produce an error.
Why can the result differ from a chart platform?
This tool seeds calculations from only the pasted rows and uses the same period for DI and ADX smoothing. A chart may use more history, separate smoothing lengths, different sessions or adjusted prices. Match those choices before comparing readings.
Does a high ADX tell me to buy?
No. ADX describes directional strength in the supplied history, not a future return or a buy instruction. The DI comparison describes the relative upward and downward movements used in the calculation. Thresholds such as 20 and 25 are conventions, not universal trading rules.
What happens with flat prices?
When smoothed true range is zero, this calculator sets both DI values to zero. When their sum is zero, it sets DX to zero. A sufficiently long completely flat sample therefore returns ADX zero rather than dividing by zero.
Method references
Formula and indicator context: TradingView ADX documentation and TradingView DMI documentation. The sample calculations and input limits above describe this page's implementation.