Donchian Channel Calculator
Donchian channel calculator for upper, lower and middle bands, channel width and width percentage. Enter your period high and low; see the worked example.
This Donchian channel calculator turns a high and low you supply into the upper band, lower band, midpoint, channel width and width percentage. It does not search a price history for those extremes. First choose the chart interval and lookback window (the bars being measured), then enter their highest and lowest prices. Changing Channel Period alone leaves these five outputs unchanged when the supplied extremes stay the same.
The channel comes from price extremes
A Donchian channel uses the highest high and lowest low in a selected window. The upper band is the high, the lower band is the low, and the middle is their arithmetic midpoint. Unlike a moving average of closing prices, that midpoint uses only the two extremes. A single unusually high or low bar can therefore affect the channel until it leaves the window.
The period counts chart bars. A 20-period channel on a daily chart refers to daily bars; on an intraday chart it refers to that many intraday bars. It is not automatically a calendar month. TradingView documents 20 as its default length, but this is a setting rather than a setting suitable for every market.
This page performs a numerical calculation. It does not draw a rolling channel chart, fetch quotes, choose a market or send a price notification. The same arithmetic can be applied to consistent price figures from different instruments, but that does not give the calculator access to those instruments’ market data.
What each input can change
- Period High: the highest traded high across your chosen window, rather than the highest close or average high.
- Period Low: the lowest traded low across the same bars.
- Current Price: a manually entered price. It does not change the five visible band-and-width results.
- Channel Period: the intended number of bars. Because the form receives no bar-by-bar history, it cannot recalculate the supplied extremes when this number changes.
Choose the window before copying the extremes. For example, if you move from a shorter chart window to a longer one, obtain the high and low for the new window and enter both again. Merely changing the period field while retaining old extremes describes the old range under a new period label.
Take the prices from the same symbol, chart interval and data basis. If you compare a chart with adjusted past prices against an unadjusted high or low, the mismatch can change the range. This form cannot detect that inconsistency, identify the source bars or confirm when either extreme occurred.
Worked example: a fictional rupee channel
Suppose your chosen 20-bar window has a made-up high of ₹2,600 and low of ₹2,400. Enter those figures along with an assumed Current Price of ₹2,540 and Channel Period 20. This is a fictional example, with no real stock or index implied.
| Visible output | Calculation | Example result |
|---|---|---|
| Upper | Higher of entered extremes | 2,600 |
| Lower | Lower of entered extremes | 2,400 |
| Middle | (2,600 + 2,400) / 2 | 2,500 |
| Channel Width | 2,600 - 2,400 | 200 |
| Width Percent | 200 / 2,500, expressed as a percentage | 8% |
The midpoint is halfway between the bounds. The width is the distance between them, expressed in the same price units. Width Percent divides that distance by the midpoint, rather than by Current Price or the lower band. The 8% result therefore describes a relative range width, not a return earned on a trade.
The assumed ₹2,540 current price does not enter any of these five calculations. A different current price with the same high and low leaves them unchanged. This also explains why a price moving beyond an entered boundary does not automatically move the band in this form: you must update the underlying window’s extreme yourself.
Does the current bar belong in the channel?
That choice matters when comparing a potential breakout. StockCharts’ Price Channels documentation excludes the current bar and uses the prior window. TA-Lib’s Donchian documentation includes the current bar in the band calculation, then compares the current bar with the previous band for a breakout rule. These are different timing conventions that must be kept distinct.
If today’s high is included in the upper band, today’s high cannot be greater than that same band. A test for a fresh high instead needs a boundary that was known before the new high occurred. Write down whether you are comparing a current price, a completed close or a bar’s high against a prior boundary.
For a concrete continuation of the fictional example, assume ₹2,600 was the high of the window ending before the bar being assessed. A later invented price of ₹2,620 is above that previous boundary. This describes a price comparison only. It does not prove that the move will continue, that an order would fill there or that the trade would finish profitably.
A touch is also different from moving beyond a boundary. A price equal to the upper band has reached the level; a rule requiring a higher price has not yet been met. The five outputs here do not evaluate a complete trading rule or identify whether a breakout later failed. See the false breakout explanation for that distinction.
Trading breakouts with the Donchian channel
A Donchian breakout rule treats a move beyond the prior channel as the entry condition. The best-known version is the Turtle system, which several sources describe as a 20-bar breakout for entry with a 10-bar counter-breakout for exit, and a slower version with a 55-bar entry and a 20-bar exit. Those are rule sets that traders have written down, not forecasts. See the Turtle trading strategy page for the wider picture.
- Mark the channel before the bar: take the highest high and lowest low of the prior bars, not including the bar being tested.
- Entry condition: a long needs price beyond the upper band, a short needs price beyond the lower band. Decide if you use the high of the bar or a completed close.
- Exit condition: use a shorter channel, so a long exits on a move below the lower band of the shorter window.
- Size from the stop: work out the distance between your entry and the exit level, then size the position from your loss budget.
Using the fictional channel above (high ₹2,600, low ₹2,400), a long entry would need price above ₹2,600. If the shorter exit channel has a low of ₹2,470, the planned stop sits there. The distance is ₹2,600 − ₹2,470 = ₹130 per share. This assumes a fill at the entry level and the stop, which a gap or a fast market can break. Many breakouts fail, and the false breakout entry explains why a close back inside the channel matters.
The display rounds the price levels
Upper, Middle, Lower and Channel Width are displayed as whole numbers. Width Percent is calculated from the original input precision and rounded separately. With decimal-priced inputs, a manual calculation using only the rounded cards may therefore give a slightly different percentage.
Keep the original input precision if you need to reconcile an exact chart value. For a low-priced instrument or a narrow range, whole-number rounding can hide a meaningful fraction of the width. The calculator also silently swaps reversed high and low entries, which can conceal a copying error. Check the fields rather than treating an orderly result as proof that the data was entered correctly.
A flat window has no high-low distance, so its width is zero. That does not establish a safe position or zero future risk. The range describes supplied past observations; future prices can move outside it. Missing inputs can trigger stored defaults, so complete the fields instead of assuming an empty value will be rejected.
Reading width without inventing a forecast
A larger distance between the extremes describes a wider observed range. To compare windows sensibly, keep the bar interval and number of bars consistent. A wide daily range and a narrow intraday range are measurements of different spans, so their raw widths are not interchangeable.
The channel does not reveal whether the high came before the low, how many times either level was tested or how much volume traded there. Those details require the underlying chart or price history. This form cannot supply a probability of a future breakout, a stop-loss distance suited to your account or a price target.
For related context, read price channels and the breakout strategy explanation. The Bollinger Bands calculator uses a different band calculation. Do not expect different channel methods to produce identical levels.
Using the channel as a trailing stop
Because the lower band rises when old lows drop out of the window, it can trail a long position upward. A short position can use the upper band in the same way, which falls as old highs leave the window. The stop only moves in your favour, never back.
Continuing the fictional long: the exit channel's low is ₹2,470 at entry. Some bars later, the oldest low drops out and the lowest low of the window becomes ₹2,520, so the stop moves up to ₹2,520. If the low then falls back to ₹2,500, the stop stays at ₹2,520. Keep the rule written before you enter.
A Donchian stop follows a price extreme, so it can sit far from the entry after a big move, and a gap can make the exit worse than the band. The ATR trailing stop uses volatility distance instead. Neither is better in every market. Compare them in your own journal.
Choosing the period
The period counts chart bars, so the same number means a different span on a daily chart than on a five-minute chart. A shorter period reacts faster and produces more breakouts, including more false ones. A longer period produces fewer, later signals and a wider channel. TradingView's default length is 20, and the Turtle rules above use 20 and 55 for entries. There is no single best setting.
- Shorter windows: more signals, narrower channels, more noise.
- Longer windows: fewer signals, wider channels, slower exits.
- Timeframe: intraday and swing traders choose differently because a bar means a different span of time.
- How to decide: log trades made with each setting and compare the results across enough trades to mean something.
If you test settings on past charts, remember that a setting fitted to history may not repeat. Use the Width Percent output to compare how wide the channel was across windows of the same bar count.
Using the middle line to read trend
The middle band is the midpoint of the highest high and lowest low. Price above the middle line shows that price sits in the upper half of the observed range, and price below it shows the lower half. That is a description of position inside the range. It is not a trend signal by itself, and a slowly sloping middle line can mean a sideways market.
Donchian versus Bollinger versus Keltner
All three draw bands around price, but they build them differently.
| Feature | Donchian channel | Bollinger Bands | Keltner channel |
|---|---|---|---|
| Middle line | Midpoint of highest high and lowest low | A moving average of closes, commonly a 20-period simple average | A moving average, commonly exponential |
| Band distance | Set by the highest high and lowest low | A multiple of standard deviation of closes | A multiple of average true range |
| Shape | Steps and flat stretches | Widens and narrows smoothly | Smooth and steadier |
| Inputs | Highs and lows only | Closes | Highs, lows and closes |
The practical difference is what moves the bands. A single extreme bar moves a Donchian band and keeps it there until it leaves the window. Standard deviation and average true range respond to how much price has moved overall. Read the Bollinger Bands guide or try the Bollinger Bands calculator for the other approach, and use the ATR calculator for the volatility input behind Keltner bands.
Questions about Donchian channel calculations
Sources
- TradingView: Donchian bands and length setting, checked 15 Oct 2026.
- StockCharts: price channels and prior-bar convention, checked 15 Oct 2026.
- TA-Lib: midpoint and current-bar versus prior-band distinction, checked 15 Oct 2026.
Related Topics
Related Articles
Absolute Returns Calculator: Total Gain or Loss
Absolute return calculator with formula, worked rupee examples and a comparison with CAGR and XIRR. Learn when absolute return misleads, such as for SIPs.
Options Rollover Calculator
Work out the debit or credit of rolling an option from premiums and lots. Learn roll up, down and out, charges, STT, and futures rollover cost and percentage.
Options Probability Calculator: Model Inputs and Limits
Estimate an option's expected move and price range from price, volatility and days to expiry, with a worked example and why the probability cards need care.
Trading Expectancy Calculator: Formula and Example
Trading expectancy calculator (EV per trade) from win rate, average win and average loss. See R-multiples, profit factor, sample size and low win-rate examples.
Trading Emotion Tracker: Review Feelings and Plan Discipline
Free trading emotion tracker. Log the mood, intensity and plan discipline behind a trade, get a simple rule-based score, and keep a record to review later.
MACD Calculator: Line, Signal and Histogram
Calculate the MACD line, signal line and histogram from your moving averages, with the formula, a worked example and how to read crossovers.
The trading journal for Nifty, Bank Nifty and Indian F&O. Track your trades, spot patterns, build discipline.
- Log one trade a day by hand, on purpose
- AI mentor finds your repeat mistakes
- Behavioural analytics catch tilt early
- Trading calendar with P&L heatmap
- Pre-trade checklist flags risks
Yearly ₹3,499 · No broker credentials