Skip to main content
Track ATR position sizing
1 / 36
Library

1988issue C041-8

Constructing unsigned true range for directional models

True range is assembled first as an unsigned volatility primitive that a later directional-index forecast and an ATR-bounded exposure filter can both reuse. A short wheat control series is used only to confirm that the three-way maximum matches the definition.

  • A directional-movement construction begins with two measurements: true range, and the portion of that movement that was directional.
  • True range is the largest of the current high-low span and the two unsigned close-to-extreme distances, stored as a positive quantity on the second data row.
  • A 14-session wheat control series returns a first true-range value of 3 when named ranges and the three-way maximum are assembled correctly.
  • Convert each evaluated cell to a stored value, stop when the next close is blank, and branch only after a drop routine returns so a longer series does not fail a short test.
Entries in this reading2 entries

Two measurements come first

A directional-movement construction begins with two measurements: the true range of price movement and the portion of that movement that was directional. True range is assembled first. The directional share is a later measurement and is left aside here.

The largest of three distances

True range is defined as the largest of three distances: today's high minus today's low, today's high minus yesterday's close, and today's low minus yesterday's close. That is the current high-low span together with the two unsigned distances from the prior close to today's high and today's low, keeping only the largest.

The first true-range cell belongs on the second data row because the comparison needs yesterday's close as well as today's high and low.

Keep the quantity unsigned

True range must be stored as a positive quantity. A gap can make a close-to-extreme difference large in magnitude but signed, and a signed value would distort the maximum if it were left unsigned.

Absolute-value conversion is applied to each close-to-extreme gap, not to the outer maximum. It is omitted from the high-low span because that span cannot be negative.

Check the first cell on a control series

A 14-session wheat sample is used as a control series. When named ranges and the three-way maximum are assembled correctly, the first computed true-range value is 3. The sample is used only to check that the programmed comparison matches the definition.

Editorial. Do not attach an average directional index forecast or an ATR position sizing filter until that first control value is in place.

Store the result before the named range moves

After a true-range formula is evaluated, converting that cell to a stored value prevents later movement of the named inputs from rewriting every earlier result to the newest calculation.

A range walk then moves the named input cells down one row after each true-range write so the same comparison can be reused on the next session.

End the loop without stacking calls

A processing loop can stop when the next close cell is blank. That blank-cell stop lets an actively updated price series run without a pre-counted number of rows.

A branch placed inside a called drop routine is treated as a new nested call on each loop. An environment that tracks 32 nested levels can fail near 30 rows even when a 14-row test succeeds.

The nesting failure is avoided by branching only after the drop routine returns, or by clearing the call stack with a restart before branching back to the true-range evaluation.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
1 of 36 in the ATR position sizing track
19891-6 pp.Next on ATR position sizingEvaluate an always-in ATR breakout as one procedureA fill at the precomputed target stays long or short until the opposite stop is hit, so the stance is always in a position and same-direction repeats do not start a new trade.
All readings on this track · 36 readings
  1. 1988Constructing unsigned true range for directional models
  2. 1989Evaluate an always-in ATR breakout as one procedure
  3. 1992Variable lookback and average true range as a trend-filter construction
  4. 1993A random-walk index that uses true range as its scale
  5. 1993A shared harness for trend-filter construction
  6. 1998Finish a trend with a volatility trail, wave permission, and a slower-frame veto
  7. 1999A trend filter that switches tactics and scales ATR targets
  8. 2001Filter higher lows with linear regression, then judge the exit
  9. 2003A Mechanical trading system is a maintained procedure, not only an entry trigger
  10. 2005Construction of a volatility-bounded long entry
  11. 2005Six-zone encoding of open, high, low, and close
  12. 2006Normalized average true range as a pre-entry volatility bound
  13. 2006Chandelier exits, ATR position sizing, and trailing stops
  14. 2007Constructing a rule-based entry with Relative Strength Index and ATR position sizing
  15. 2008Constructing a zero-lag TMA and heikin-ashi crossover as a complete rule set
  16. 2010Use the session-range percent stop as a pre-trade filter
  17. 2011OCA exit groups, trailing limits, and ATR stops
  18. 2011ATR bands around support and resistance for stops and targets
  19. 2013Algorithmic head-and-shoulders construction with bounded exits
  20. 2013Constructing ATR-scaled swing pivots and linear-regression divergence
  21. 2013Constructing volatility bands from typical price
  22. 2014Constructing true-range contraction filters before expansion
  23. 2015Constructing touch plans from modified true range
  24. 2015One checklist for breakout entry and ATR risk
  25. 2015Percentage true-range construction for cross-market volatility filters
  26. 2015Construct a percentage true range for cross-market volatility
  27. 2015Percentage true range as a pre-entry exposure filter
  28. 2016Constructing ATR-filtered breakout entries
  29. 2017A dividend date as a pairs-trading classroom
  30. 2018Range-based volatility as a true-range construction
  31. 2018Moving average support and volatility-band construction
  32. 2018Construct a lifecycle breakout from compression
  33. 2018Pair the book first and let volatility or range set the size
  34. 2019Trend systems need a no-trade rule
  35. 2020Average true range as a shared unit for size, pairs, and stops
  36. 2020Volatility sizing and target-risk leverage as a pre-trade gate
All 43 readings tagged ATR position sizing
Also on ATR position sizing5 readings