Skip to content
All library documents

Testing ADX Calculations with Trend and Oscillating Price Series

Article Quant Q&A · Author: user18394

Summary

This post asks whether a proposed Average Directional Index calculator produces plausible values across several example price sequences. The examples include steadily rising and falling prices, an accelerating rise, a constant series, and a repeating rise-and-fall pattern. The author reports expected ADX readings for each and seeks feedback because they cannot compare their implementation with an online calculator.

The examples frame useful edge cases for checking how a technical indicator behaves: directional movement, flat prices, and oscillation. However, the post gives no calculation steps, ADX lookback period, implementation details, or replies confirming the proposed outputs. ADX measures trend strength rather than direction, so a high reading alone does not indicate whether a market is rising or falling. The listed values should therefore be treated as hypotheses to validate against a specified ADX convention, not as established results.

Key ideas

  • The author tests an ADX implementation using directional, flat, accelerating, and oscillating price sequences.
  • The post supplies proposed readings but does not show how they were calculated.
  • ADX indicates trend strength rather than whether the trend points up or down.
  • The examples cannot validate the calculator without a stated lookback period and calculation convention.

Tags

Full text
# Testing out ADX calculator


# Testing out ADX calculator












I'm trying to program an ADX calculator in python, however I don't know if it is correct since I'm still a bit shaky on the financial side of things. I haven't found an ADX calculator online (surprisingly) so I can't compare it.

Should the following datasets generate the following ADX-values?

[1,2,3,4,5,6,7,8,9,10] --> 100

[10,9,8,7,6,5,4,3,2,1] --> 100

[2,4,8,16,32,64,128,256,512] --> 100

[5,5,5,5,5,5,5,5,5,5,5,5,5,5] --> 0

[1,2,3,3,2,1,1,2,3,3,2,1,1,2,3,3,2,1,1,2,3] --> 94.50548937857359

Could anyone with sufficient knowledge tell me if something seems off?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.