ChandeKrollStopDown
ChandeKrollStopDown in ProBuilder returns the upper Chande Kroll Stop line, an ATR-based trailing stop level used to protect long positions. Syntax, examples.
Syntax
ChandeKrollStopDown[Pp, Qq, X]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Pp | integer | 20 | Period used to compute the Average True Range and the extreme-price lookback. |
Qq | integer | 10 | Period over which the preliminary stop is smoothed by taking its extreme value. |
X | integer | 3 | Multiplier applied to the ATR when offsetting the stop from the price extreme. |
Formula
firstLowStop = Lowest[Pp](low) + X * AverageTrueRange[Pp]
ChandeKrollStopDown = Lowest[Qq](firstLowStop)The preliminary stop anchors to the lowest low of the last Pp bars and offsets it upward by X times the ATR. Taking the extreme of that preliminary line over Qq further bars stabilises the level so it does not jump on every bar.
How it works
The Chande Kroll Stop is a volatility-scaled trailing stop system built from two lines. Each line starts from a recent price extreme and offsets it by a multiple of the Average True Range, so the stop automatically sits further from price when the market is volatile and closer when it is quiet. The second smoothing pass over Qq bars prevents the level from flickering with each new extreme.
ChandeKrollStopDown produces one of the pair and ChandeKrollStopUp the other. Together they bracket price: one line trails below the market as an exit reference for longs, the other trails above it for shorts. When price crosses through a line decisively, the position it protects is considered stopped out, and some traders read the same cross as an entry trigger in the new direction.
Because the offset is ATR-based, the indicator adapts to changing conditions without manual retuning. A volatility expansion widens the buffer, reducing premature stop-outs from noise; a contraction tightens it, locking in more of an accrued move.
Examples
Example 1, Plotting the stop line with price (Indicator)
// Chande Kroll stop level with default-style parameters
stopLine = ChandeKrollStopDown[20, 10, 3]
RETURN stopLine coloured(200,50,50) AS "CK Stop Down"Overlaid on the price chart, the line trails the market at a distance of roughly three ATRs from the relevant price extreme. Bars closing beyond the line mark potential stop events.
Example 2, Short entry when price breaks the stop line (ProBacktest)
// Chande Kroll stop level for the long side
i1 = ChandeKrollStopDown[10, 20, 3]
// Open a short when the bar opens above the line but closes below it
IF (Open > i1 AND Close < i1) THEN
SELLSHORT 1 SHARE AT MARKET
ENDIFA single bar that opens above the stop level and closes below it signals a decisive break. The rule treats the failure of the long-side stop as a short entry.
Example 3, Trailing exit for a long position (ProOrder)
// Trend entry with a Chande Kroll trailing exit
ck = ChandeKrollStopDown[20, 10, 3]
IF NOT LongOnMarket AND close CROSSES OVER Highest[20](high)[1] THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND close CROSSES UNDER ck THEN
SELL AT MARKET
ENDIFThe breakout entry is managed entirely by the stop line: the position stays open while price holds above it and closes on the first cross below, letting the exit distance breathe with volatility.
Interpretation
| Observation | Reading |
|---|---|
| Price above the line | The long side remains intact, the line serves as the trailing exit level. |
| Price crosses below the line | Long-side stop event. Trend followers read it as a bearish shift. |
| Line rising steadily | The market is making higher lows faster than volatility expands. |
| Gap between price and line widening | Volatility is contracting relative to the trend, the stop is locking in progress slowly. |
The two Chande Kroll lines are usually plotted together. The zone between them acts as a neutral band; sustained trading outside the band in either direction defines the active trend.
Common errors and gotchas
- Verify which line is which by plotting. The names StopDown and StopUp are a recurring source of confusion, and written descriptions of the pair sometimes disagree about which line sits above price. Plot both
ChandeKrollStopDownandChandeKrollStopUpon a chart once before wiring either into exit logic. - No price argument. All three parameters go in square brackets, there is no parenthesised price source.
ChandeKrollStopDown[20, 10, 3](close)does not compile. - Parameter order is easy to scramble.
Pp(ATR period),Qq(smoothing lookback), thenX(multiplier). Note that published examples circulate with the first two values swapped, such as[10, 20, 3]versus[20, 10, 3], and the two configurations produce different lines. Confirm against the intended reference settings. - Whipsaws in ranges. Like every trailing-stop indicator, the line gets crossed repeatedly when the market moves sideways inside a few ATRs. A trend or volatility filter in front of the stop logic reduces churn.
Related instructions
ChandeKrollStopUp, the companion line on the other side of price.AverageTrueRange, the volatility measure that sets the stop offset.TR, the raw True Range underlying the ATR.Supertrend, alternative ATR-based trailing stop and trend line.SAR, parabolic stop and reverse system.Lowest, lowest value over a lookback, used in the formula.Highest, highest value over a lookback window.KeltnerBandDown, lower line of the average-range channel.
