TradeReign
Back to HomeEducation HubCompatibilityAboutDisclosures
thinkorswim Desktop

Choppiness Index for thinkorswim Add the Study and Verify the Reading

CHOP describes how much price traveled relative to the range it covered. Use price to read direction. The 38.2 and 61.8 lines are conventional references you can use in a practice review.

Quick Answer

In thinkorswim Desktop, open Charts → Studies → Edit Studies → Create and add the thinkScript below. The study sums each bar’s true range, divides by the window’s high-to-low range, and plots the logarithmic ratio in a lower pane.

Start 7-Day TrialOpen the thinkScriptCheck the five-bar example

Create a Choppiness Index chart study

Use a time-based chart. In Edit Studies and Strategies, select Create, name the study ChoppinessIndexCheck, and replace the starter text with the code below. Save the study, add it to the active chart and apply it. The default lookback is 14 bars. The chart version plots CHOP and two separate reference lines.

declare lower;
input length = 14;
Assert(length >= 2, "Length must be at least 2.");

def totalTR = Sum(TrueRange(high, close, low), length);
def windowRange = Highest(high, length) - Lowest(low, length);

plot CHOP = if windowRange > 0 and totalTR > 0
    then 100 * Log(totalTR / windowRange) / Log(length)
    else Double.NaN;
plot UpperBand = 61.8;
plot LowerBand = 38.2;

CHOP.SetDefaultColor(Color.CYAN);
UpperBand.SetDefaultColor(Color.GRAY);
LowerBand.SetDefaultColor(Color.GRAY);

Verify the five-bar reading with a previous-close gap

Use the fictional five-minute MES example below to check the calculation by hand. Use length five for this example. Before A, the 9:35 bar closes at 5,999.50. A’s high is 6,002.00 and its low is 6,001.00. Its true range is 2.50 points because the previous close is below that low.

From A through B, the true ranges are 2.50, 1.50, 2.00, 1.25 and 1.25 points. They add to 8.50. The highest high is 6,002.25 and the lowest low is 6,000.00, for a 2.25-point denominator. The study’s formula gives 100 × ln(8.50 ÷ 2.25) ÷ ln(5), or 82.58.

If you substitute each candle’s high minus low for true range, the sum drops to 7.00 and the reading becomes 70.52. With a real chart, compare your own completed bar and the preceding close. The sample’s prices are invented.

32 synthetic MES candles and the five-bar CHOP

Synthetic MES 5-minute candles. Times are bar closes in ET.

Marked bars · 9:40 A / 10:00 B

The five-bar check starts at A and ends at B. The lower panel shows the five-bar CHOP. The 9:35 close helps compute A’s true range even though 9:35 is outside the five-bar high–low window.

Check settings when another plot gives a different value

Match the dated contract, chart aggregation, session and lookback. Then check the candle’s close time and whether it has completed. Different sessions can change which previous close the formula uses. A forming bar can still change its high and low.

Compare the sum of one-bar true ranges, as used here, with the other study’s numerator. TradingView’s documented formula sums one-bar ATR values, which are true ranges. A smoothed 14-bar ATR used inside the sum produces a different calculation. The natural logarithm and base-10 logarithm give the same ratio when you use the same base on top and bottom.

If the highest high equals the lowest low, the window’s range is zero. This study leaves CHOP blank for that window because the formula would require division by zero. Check the chart’s data and lookback before interpreting the blank.

Sources

Official References

Platform details on this page were checked against these official resources.

Schwab’s thinkScript editor instructionsFind the custom study editor on the Charts tab.Schwab thinkScript TrueRangeVerify the argument order and previous-close treatment.Schwab thinkScript LogCheck the natural logarithm used in the study.TradingView’s Choppiness Index formulaCompare the one-bar true ranges, lookback range and reference levels.
Related Guides

Keep Building the Rule System

Compare a steady move with a rotating market

Use two 14-bar examples with the same range and different total true ranges.

Match thinkorswim bars to your intended session

Check the first bar’s timestamp before comparing a completed reading.

Compare ATR with ADX

Distinguish range size from a trend-strength measure.

FAQ

Common Questions

Why can the same lookback produce different CHOP values in two apps?

Check the dated symbol, aggregation, session, completed bar and preceding close. Then compare the numerator and how both studies treat a zero-range window.

Does CHOP show which direction a trend is moving?

CHOP measures how much price traveled relative to the full range of the window. Read the direction from price or a separately defined rule.

Risk Disclosure

Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.

TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.

Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.