When I first designed the pullback detection logic for the signal system, I set a fixed threshold: if a stock drops 3% from its recent high, that counts as a meaningful pullback. It seemed reasonable. Three percent felt like a real move — not just noise, but enough of a decline to represent genuine selling pressure followed by a potential re-entry opportunity.
It didn't take long to find the problem. The same 3% threshold behaved completely differently depending on which stock triggered it.
The Problem With Fixed Percentage Thresholds
Some stocks are naturally stable. Their daily price ranges are tight, and a 3% intraday move is genuinely significant — it means something unusual happened. For these stocks, a 3% pullback is a real signal worth paying attention to.
Other stocks are naturally volatile. They swing 5%, 8%, even 10% in normal trading without any particular news catalyst. For these stocks, a 3% dip is nothing more than routine noise — the kind of movement that happens several times a day and reverses without any significance. Treating it as a meaningful pullback leads to false signals and poorly timed entries.
The deeper problem is that the same fixed threshold can't do both jobs. Set it at 3% and you're over-sensitive for volatile stocks and appropriately calibrated for stable ones. Set it higher to filter out volatile stock noise and you stop detecting real opportunities in stable stocks altogether. The threshold that works for one stock systematically fails for another.
What ATR Measures
ATR stands for Average True Range. It measures the average size of a stock's price moves over a defined recent period, expressed in price units. The "true range" of a single period is the largest of three values: the distance from that period's high to its low, the distance from the previous period's close to the current high, or the distance from the previous period's close to the current low. Using all three ensures that gaps — sharp moves between one period's close and the next period's open — are captured in the measurement rather than ignored.
Averaging these true range values across a set number of recent periods gives you ATR: a number that tells you, in concrete price terms, how much this particular stock typically moves. A high ATR means the stock is normally volatile. A low ATR means it normally trades in a narrow range.
Crucially, ATR doesn't predict direction. It doesn't tell you whether the stock is going up or down. It only tells you how much movement to expect as a baseline. That's exactly the information needed to calibrate a pullback threshold.
How ATR Was Applied to the Pullback Detection Logic
The implementation works in two steps. First, calculate ATR from the recent tick candle data for each stock being tracked. Convert that ATR value into a percentage of the current reference price — this gives you the typical move size expressed as a percentage rather than an absolute price. Second, multiply that percentage by a scaling factor, and use the result as the pullback threshold for that specific stock.
The scaling factor determines how deep a pullback needs to be, relative to the stock's normal volatility, to qualify as meaningful. A larger factor requires a more substantial pullback relative to the stock's typical range; a smaller factor makes the system more sensitive.
To prevent extreme values in either direction, the calculated threshold is capped at a minimum and maximum. If the formula produces a threshold below the minimum, the minimum applies. If it exceeds the maximum, the maximum applies. This keeps the system behaving sensibly even when ATR is temporarily distorted — for example, right after an unusually large move that inflates the ATR reading.
The result is that every stock in the system gets its own pullback threshold, recalculated continuously as new candle data comes in. A stable stock might require only a 1.5% pullback to qualify. A volatile stock might require 6% or more. Both thresholds are meaningful in context, because both are calibrated to what's normal for that specific stock.
Why This Matters Beyond Just Better Signals
Adapting the threshold to each stock's volatility does more than reduce false signals. It changes the fundamental character of what the system is measuring.
A fixed-threshold system is asking: "Has the price dropped by X%?" A volatility-adjusted system is asking: "Has the price dropped by more than is typical for this stock?" The second question is more informative because it filters for moves that stand out relative to the stock's own behavior — moves that are more likely to reflect genuine supply-demand dynamics rather than routine fluctuation.
This is the same principle that underlies many professional risk management frameworks. Position sizing based on ATR, for example, ensures that trades in volatile stocks use smaller positions than trades in stable stocks, keeping the risk per trade roughly equal regardless of which instrument is being traded.
Today's Investing Insight — Volatility and Beta
ATR measures a stock's absolute price movement — how many points or dollars it typically moves in a given period. Beta measures something different: how much a stock moves relative to the overall market. A beta of 1.0 means the stock tends to move in line with the market index. A beta above 1.0 means it tends to amplify market moves. A beta below 1.0 means it tends to move less than the market. The two measures are related but distinct. A high-ATR stock might have a low beta if its large moves are idiosyncratic rather than correlated with broad market direction. For short-term pattern trading like the strategy described in this series, ATR is generally more relevant because the focus is on the stock's own price behavior rather than its relationship to the broader market. For portfolio construction and risk management across multiple positions, beta becomes the more useful tool.
---
This post documents a personal journey of building an algorithmic trading system and is not a recommendation of any specific stock or strategy. All investment decisions and their outcomes are the sole responsibility of the investor.
Comments
Post a Comment