Adaptive Price Zone Indicator for ThinkorSwim


The adaptive price zone ( APZ ) is a volatility-based technical indicator that helps investors identify possible market turning points, which can be especially useful in a sideways-moving market. It was created by technical analyst Lee Leibfarth in the article “Identify the Turning Point: Trading With An Adaptive Price Zone,” which appeared in the September 2006 issue of the journal Technical Analysis of Stocks and Commodities .

This indicator attempts to signal significant price movements by using a set of bands based on short-term, double-smoothed exponential moving averages that lag only slightly behind price changes. It can help short-term investors and day traders profit in volatile markets by signaling price reversal points, which can indicate potentially lucrative times to buy or sell. The APZ can be implemented as part of an automated trading system and can be applied to the charts of all tradeable assets.

thinkScript Code

# Adaptive Price Zone
# Assembled by BenTen at
# Converted from

input nPeriods = 20;
input nBandPct = 2;
def xHL = high - low;
def nP = ceil(sqrt(nPeriods));
def xVal1 = expAverage(expAverage(close, nP), nP);
def xVal2 = expAverage(expAverage(xHL, nP), nP);
def UpBand = nBandPct * xVal2 + xVal1;
def DnBand = xVal1 - nBandPct * xVal2;

plot ub = UpBand;
plot db = DnBand;



Well-known member
2019 Donor
The author has some nice work! Not in front of my computer, at the moment, would we use/trade this study similar to a bollinger band?

Thanks Ben for bring this out as a port!


Active member
2019 Donor
Most indicators work because most people use them, they work by consensus. So unless APZ gets the same or wider adoption than get where I'm going with this. But the funny thing is, just today I came across it by chance online and searched to see if there is TOS code for it.


While the bands stay the same length on range chart, detracting from some of its value It still makes good as a target area as price almost always tends to reverse when there is weakness into the area. Thanks again!

Similar threads