Keltner Channel

Introduction

The Keltner Channel is a volatility-based envelope indicator that is used to identify potential overbought and oversold conditions in an asset. Created by Chester Keltner in the 1960s, this indicator consists of three lines: a central line (the Exponential Moving Average, or EMA) and two outer lines constructed based on the Average True Range (ATR) of the asset. The Keltner Channel helps traders visualize price movements and potential reversal areas.

Calculation of Keltner Channel

The Keltner Channel is calculated using the following steps:

  1. Calculate the Exponential Moving Average (EMA): Typically, a 20-period EMA is used for the channel’s centerline.

  2. Calculate the Average True Range (ATR): The ATR over a defined period (usually 14 periods) is calculated to gauge volatility.

  3. Calculate the Upper and Lower Bands:

    • Upper Band:
mathematical expression or equation
  • Lower Band:
mathematical expression or equation

Where:

  • ( n ) is the number of periods used for the EMA and ATR (e.g., 20 for EMA, 14 for ATR).
  • ( k ) is typically set to 2.

Example Calculation

Let’s assume we have the following closing prices for a stock over 10 days and we want to calculate a 20-day Keltner Channel using a 14-day ATR.

DayClosing Price
1$20
2$21
3$22
4$21
5$23
6$24
7$23
8$25
9$26
10$27

Assuming:

  • 14-Day ATR: $1.50
  • 20-Day EMA: $24 (calculated from prior days)

Calculation of Bands

  1. Upper Band:
mathematical expression or equation
  1. Lower Band:
mathematical expression or equation

Results

  • Keltner Channel:
    • Upper Band: $27
    • Lower Band: $21
    • Central Line (EMA): $24

Python Code

import pandas as pd

def calculate_atr(data, window=14):
    """Calculate Average True Range (ATR)."""
    data['previous_close'] = data['Close'].shift(1)
    data['high_low'] = data['High'] - data['Low']
    data['high_prev_close'] = (data['High'] - data['previous_close']).abs()
    data['low_prev_close'] = (data['Low'] - data['previous_close']).abs()
    
    # Calculate True Range
    data['True Range'] = data[['high_low', 'high_prev_close', 'low_prev_close']].max(axis=1)
    
    # Calculate ATR
    data['ATR'] = data['True Range'].rolling(window=window).mean()
    return data

def calculate_keltner_channel(data, window=20, num_of_atr=2):
    """Calculate the Keltner Channel."""
    data = calculate_atr(data)
    
    # Calculate the EMA (central line of Keltner Channel)
    data['EMA'] = data['Close'].ewm(span=window, adjust=False).mean()
    
    # Calculate Upper and Lower Bands
    data['Upper Band'] = data['EMA'] + (data['ATR'] * num_of_atr)
    data['Lower Band'] = data['EMA'] - (data['ATR'] * num_of_atr)
    
    return data

Interpretation of Keltner Channel

  1. Overbought and Oversold Conditions:

    • When the price touches or exceeds the upper band, it may indicate that the asset is overbought and could potentially reverse.
    • When the price touches or dips below the lower band, it may suggest that the asset is oversold and could potentially bounce back.
  2. Trend Confirmation:

    • If the price consistently touches the upper band, it signifies a strong bullish trend.
    • If the price consistently touches the lower band, it indicates a strong bearish trend.
  3. Breakouts:

    • A breakout above the upper band can signal a continuation of the bullish trend, while a breakout below the lower band can indicate a continuation of the bearish trend.

Analogy

Think of the Keltner Channel as a safety net around a tightrope walker. The central line represents the tightrope (the EMA) where the walker is trying to maintain balance. The upper and lower bands act as the nets, providing a guide for extreme movements (overbought or oversold conditions). If the tightrope walker veers too far above the net (upper band), there is a risk of falling (pullback). Conversely, if they dip too far below (lower band), they may be able to regain balance (recovery).

Conclusion

The Keltner Channel is an effective tool for traders looking to evaluate market conditions and identify potential entry or exit points. By analyzing price movements relative to the Keltner Bands, traders can make more informed trading decisions.


References