Skip to main content Keltner Channel Wedges - FREE, CUSTOM INDICATOR Skip to main content Skip to content
Master the TTM Squeeze with our comprehensive 19-module course Start Learning →
TOS Indicators
  • Tools

    Categories

    • Indicators
    • Backtesters
    • Scans
    • Dashboards
    • thinkScript
    • Member Resources
    Browse Full Library

    Featured Tutorials

    Heiken Ashi Trend Indicator
    Heiken Ashi Trend Indicator
    Indicators

    Download our Custom Heiken Ashi indicator for ThinkOrSwim. Full ThinkScript code, formula...

    Learn more →
    Commodities Tracker
    Commodities Tracker
    Indicators

    For acceleration signals: trend-following strategies and buying pullbacks. For deceleration signals: short...

    Learn more →
    Build an Election Backtester in 10 Minutes
    Build an Election Backtester in 10 Minutes
    Backtesters

    Learn how to create a Post-Election Backtester in ThinkOrSwim to analyze market...

    Learn more →

    Popular Posts

    Unusual Volume
    Unusual Volume
    Scans

    Build 4 scans to easily find stocks with greater than...

    Learn more →
    Upcoming Earnings with High Short Interest
    Upcoming Earnings with High Short Interest
    Scans

    Build a scan to find stocks that are likely to...

    Learn more →
    Unusual Volume Pro Scans
    Unusual Volume Pro Scans
    Scans

    4 additional scans to find unusual volume overlapping with key...

    Learn more →
  • Courses
    Squeeze Course
    Squeeze Course
    19 Modules

    Scan, backtest, and trade the TTM Squeeze setup with precision.

    Unlock Course →
    Earnings Course
    Earnings Course
    3 Modules

    Master earnings plays with free indicators and proven strategies for ThinkOrSwim.

    Unlock Course →
    V-Shaped Reversals
    V-Shaped Reversals
    7 Modules

    Identify and trade powerful V-shaped reversal patterns with confidence and precision.

    Unlock Course →
    Fibonacci Trading
    Fibonacci Trading
    4 Modules

    Learn to trade Fibonacci retracements and extensions in ThinkOrSwim effectively.

    Unlock Course →
  • Products
    Futures Volatility Box Premium
    Futures Volatility Box

    Volatility models for 10 major futures markets, including micros & SPX.

    Explore Futures VB →
    Stock Volatility Box Premium
    Stock Volatility Box

    Dynamic support & resistance for 595+ stocks/ETFs, with a live scanner.

    Explore Stock VB →
    Opening Range Breakouts Premium
    Opening Range Breakouts

    Powerful live scanner & backtester for ORB strategies on 595+ stocks.

    Explore ORB Setups →
My Account
Back to Tutorials
Beginner 8 minutes ThinkOrSwim

Keltner Channel Wedges

Easily find mean-reversion trades with powerful Keltner Channel Wedges that alert you when price closes outside of the bands.

Download Indicator
How to install in ThinkOrSwim →
Table of Contents
  • Demo of the Final Version of the Indicator
  • Understanding the Keltner Channels
  • Writing thinkScript Code

Introduction

Good afternoon, everyone and welcome to a five-minute thinkScript video.

In today’s video, we’re going to answer the question – “How do we build an indicator that lets us know whenever price action is too extended?”

If you’re new to thinkScripting, this is going to be a great introduction and is a beginner friendly tutorial (we’ll write less than 10 lines of code).

To give you an idea of how this a tutorial is broken down…

  • In the first minute, I’ll show you a preview of the final version of the indicator
  • We’ll spend the next three or so minutes writing thinkScript code. I’ll spend a little bit more time breaking down individual concepts, to help explain the code along the way.
  • Finally, I’ll spend the last minute to summarize what we’ve accomplished in this tutorial, along with ways that you can take the concepts that we discussed in today’s video, especially this idea of being overly extended, and turn that into something a little more powerful.

With that, let’s get started.

Demo of the Final Version of the Indicator

Here’s what the final version of the “Overly Extended” indicator looks like:

Extended Keltner Channels

You should notice the “Boolean Wedges” (that’s what ThinkOrSwim calls them), indicating that price action is too extended. Our definition of “extended” involves using the Keltner Channels, and specifically measuring price action’s relationship to the upper and lower Keltner Channel bands.

It will plot both long and short wedges, using a very simple boolean condition, which we will write in the thinkScript section of this tutorial.

 

Understanding the Keltner Channels

Before we start writing our “Overly Extended” indicator, we need to understand the Keltner Channels code.

Let’s start with the user inputs.

Keltner Channel ThinkOrSwim Inputs

While there are a few different inputs available, the one input that we care about is the “Factor” variable. The “Factor” variable is what determines how elastic the Keltner Channel upper and lower bands are (the higher the number, the “more extended”).

A 3.0 factor means we’re increasing the elasticity of the Keltner Channels. As you continue to increase the factor, and if the “Overly Extended” boolean wedges continue to plot, the further extended we are.

This “Factor” input is something we’d like the user to be able to control from the studies menu in our version of the final indicator. With the value that the user inputs, the upper and lower bands of the Keltner Channel will adjust accordingly (and thus, our wedges).

Using your newfound knowledge about the Keltner Channels, we are now ready to start writing some custom thinkScript code.

 

Writing thinkScript Code

Now, let’s start writing some thinkScript code. We can give our new indicator a name, calling it TI_ExtendedKeltnerChannels.

We can start by first defining our one input variable, which is the Keltner channel “Factor.” We make this an input variable, so the user can change the value directly from the study’s menu, instead of needing to edit code. We can define this variable as “KCfactor” and give the variable a default value of 3.0.

Next, I can define our extended variables, which is what will contain the logic behind what plots on our chart.

Let’s start defining the long-side extended variable, which we can call “extendedLong.” Our condition checks if the closing price of the current candle is greater than the Upper Band of the Keltner Channels. If it is, then “extendedLong” will return a 1, plotting true.

Now, we can copy paste this one more time, for our short side.

The reverse of the above condition is true for the short side. In this case, we are checking if the closing price of the current candle is less than the Lower Bands of the Keltner Channels, using the same “KCFactor” variable.

Finally, we can add in the appropriate formatting, by defining the painting strategy. We can set the painting strategy for extendedLong and extendedShort to wedges, using:

  • “PaintingStrategy.BOOLEAN_WEDGE_UP”
  • “PaintingStrategy.BOOLEAN_ARROW_DOWN”

And, finally, we can also define the color, with our overly extended on the long side wedges painting as pink, and the short wedges as light_green.

Here’s an example of what the final version of the indicator looks like, plotting on a chart of the S&P 500 ETF (SPY) on a daily time frame chart:

Extended Keltner Channels - SPY Screenshot

In terms of how you can continue to improve this indicator beyond what we currently have, you can start to make these conditions a bit more intricate. For example, you may also want to include an oversold/overbought indicator, such as the RSI (ie. RSI > 70).

You can layer on other indicators that you may prefer trading with, to continue to build out the “extendedLong” and “extendedShort” variables, and start to make these conditions a bit more complex.

The goal of the indicator is to not only help save you chart space, but also the mental bandwidth to automatically alert you when we are overly extended.

 

Keltner Channel Wedges.ts
input KCFactor = 3.0;

plot extendedLong = close > KeltnerChannels(factor = KCFactor).UpperBand;

plot extendedShort = close < KeltnerChannels(factor = KCFactor).LowerBand;

extendedLong.setPaintingStrategy(PaintingStrategy.Boolean_Wedge_Up);
extendedShort.setPaintingStrategy(PaintingStrategy.Boolean_Wedge_Down);
extendedLong.setDefaultColor(Color.pink);
extendedShort.setDefaultColor(Color.Light_green);

// ... 0 more lines ...

Unlock This Code

Create a free account to access the full source code and download files.

Create Free Account Login
Import the Keltner Channel Wedges indicator through Studies > Edit Studies > Import. Once loaded, the indicator automatically analyzes price action and generates signals. Key settings include period length, signal sensitivity, and display options. Most traders find the default settings work well, but you can customize based on your timeframe and trading style.
For day trading with Keltner Channel Wedges, I like to use a 20-period EMA with a 3.0 factor. These settings provide optimal sensitivity for intraday volatility changes. For swing trading, I like to use the same settings, but note that sometimes lowering to 2.0 factor will help to find more opportunities.
The Keltner Channel Wedges indicator is designed to not repaint once a candle closes. All calculations are based on confirmed price data, ensuring signals remain consistent for backtesting and live trading. However, always verify this behavior in OnDemand mode before using real capital.
Yes, the Keltner Channel Wedges works well for day trading when properly configured. Use it on 5-15 minute charts with tighter settings for more responsive signals. Combine with volume analysis and support/resistance levels for higher probability setups. Always use stop losses as intraday moves can be volatile.
Use ThinkOrSwim's OnDemand feature to backtest the Keltner Channel Wedges indicator. Load historical data, apply the indicator, and manually track signals and outcomes. For automated backtesting, combine with ThinkOrSwim's strategy functions. Document win rates, average gains/losses, and optimal market conditions for best results.
Keltner Channels use ATR (Average True Range) while Bollinger Bands use standard deviation, making Keltner Channels more responsive to actual price volatility. For wedge patterns, Keltner Channels provide cleaner signals because ATR directly measures volatility changes, while Bollinger Bands can give false wedge signals during trending markets. Keltner Channel wedges are more reliable for breakout trading, especially in trending markets where Bollinger Bands may stay expanded.
Combine the Keltner Channel wedges with a trigger indicator, that helps you pinpoint exactly when to enter the mean-reversion trade. My personal favorite is to use the Edge Signals indicator (think of it as RSI on steroids). This is detailed more in the V-Shaped Reversal setup.
You can use the Alert function to set up ThinkOrSwim alerts, directly inside of the Keltner Channel Wedges' indicator code. The alerts will notify you whenever a wedge prints, sending you a notification in your ThinkOrSwim platform, mobile app, and mobile device.

Here are some resources that you may find useful:

  • How to import an indicator into ThinkOrSwim (video tutorial)
Featured Tools:
Stock Volatility Box

Stock Volatility Box

Spot reversal zones across 600 stocks & ETFs.

  • Hourly & daily models
  • Powerful Live Scanner
  • Built for day traders
Futures Volatility Box

Futures Volatility Box

Pinpoint reversal zones in 10 major futures markets.

  • 5 models (incl. Scalper)
  • ThinkOrSwim & TradingView
  • SPX traders
ORB Setups

ORB Setups

Find the best Opening Range Breakout setups.

  • Powerful real-time scanner
  • Instant backtests
  • 2+ years data

Get Free Access

Create a free account for downloads and new tutorial alerts.

Create Free Account

More Tutorials Like This

Market Pulse

Market Pulse

Beginner-Friendly • 40 mins
Anchored VWAP

Anchored VWAP

Beginner • 8 minutes
Advanced Volume Zone Oscillator

Advanced Volume Zone Oscillator

Beginner-Friendly • 25 mins

Ready to Trade With an Edge?

Join 40,000+ traders using institutional-grade tools for ThinkOrSwim.

Get the Bundle
TOS Indicators

Premium thinkorswim indicators, scans, and trading tools to help you trade smarter.

ThinkOrSwim Tools

  • Indicators
  • Scans
  • Backtesters
  • Dashboards
  • thinkScript
  • Browse All

Courses

  • Squeeze Course
  • Earnings Course
  • V-Shaped Reversals
  • Fibonacci Trading

Products

  • Futures Volatility Box
  • Stock Volatility Box
  • ORB Setups
  • Shop All

Guides

  • TTM Squeeze
  • Automated Trading
  • Volatility Trading
  • Opening Range Breakouts
  • Trade Reports
  • Contact Us

© 2026 TOS Indicators. All rights reserved.

Privacy Policy Terms of Service Disclaimer

The information contained on this website is solely for educational purposes, and does not constitute investment advice. The risk of trading in securities markets can be substantial. You must review and agree to our Terms of Service prior to using this site.

U.S. Government Required Disclaimer - Commodity Futures Trading Commission. Futures and options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This website is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this website. The past performance of any trading system or methodology is not necessarily indicative of future results.

Individual results may vary, and testimonials are not claimed to represent typical results. All testimonials are by real people, and may not reflect the typical purchaser's experience, and are not intended to represent or guarantee that anyone will achieve the same or similar results.

TOS Indicator's Traders and employees will NEVER manage or offer to manage a customer or individual's options, stocks, currencies, futures, or any financial markets or securities account. If someone claiming to represent or be associated with TOS Indicator solicits you for money or offers to manage your trading account, do not provide any personal information and contact us immediately.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.