Option Alpha Docs
  • Intro to Option Alpha
  • TOOLS
    • Bots
      • Creating a Bot
      • Safeguards
      • Automation Basics
      • Using Loops
      • Decisions
      • Automated Trades
      • SmartPricing
      • Exit Options
      • Using Tags
      • Using Inputs
      • Automation Scheduling
      • Bot Logs
      • Templates and Cloning
      • Managing Positions
      • Autotrading Best Practices
    • Trade Ideas
      • Manual Trading
    • 0DTE Oracle
    • Earnings Edge
    • Settings
      • Webhooks
      • Live Trading
        • Connecting to Tradier
        • Connecting to tastytrade
        • Connecting to TradeStation
        • Connecting to Schwab
  • PLATFORM
    • Infrastructure & Security
    • Automations
      • Automation Behavior
    • Data Feeds
    • Order Handling
    • Bot Limitations
    • Supported Ticker Symbols
      • Supported Browsers
      • Supported Countries
    • Ex Dividend & Earnings Dates
    • Troubleshooting
      • Testing Automations
      • Broker Rejection Errors
        • Invalid Authorization
        • Overlapping Strikes Failsafe
        • Duplicate Orders Error
      • Capital Warnings
      • Position Limit Warnings
      • Trade Enforcements
      • Pricing Anomaly Warning
      • Missing or Invalid Input
      • Daily Symbol Limit Error
      • Excessive Errors Failsafe
      • Bot Event Loops
      • Option & Expiration Availability
  • Calculations
    • Profit and Loss
    • Decision Properties
    • Decision Calculations
    • Parameter Selection
    • Probability
      • Probability Theory
      • Understanding Alpha and Expected Value
    • Indicators
      • ADX
      • ATR
      • BOLLINGER BANDS
      • BOP
      • CCI
      • CMO
      • DX
      • EMA
      • KAMA
      • MACD
      • MFI
      • MOM
      • ROC
      • RSI
      • SMA
      • STOCH
      • Stoch RSI
      • TRIMA
      • ULTIMATE OSCILLATOR
      • WILLIAMS %R
  • Resources
    • 'Fast Track' Video Series
    • Live & On-Demand Events
    • Videos
    • Education
    • Blog
    • Podcast
Powered by GitBook
On this page

Was this helpful?

  1. Calculations
  2. Indicators

CCI

Overview of the Commodity Channel Index calculation.

PreviousBOPNextCMO

Last updated 6 months ago

Was this helpful?

The Commodity Channel Index​ (CCI) is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. This technical indicator measures the difference between the current price and the historical average. It assesses trend direction and strength, allowing traders to determine if they want to enter, exit, or avoid placing a trade.

The source code for the CCI function is available .

/* Return CCI (Commodity Chanel Index) for n bars close price.
 *​
 * CCI = (Typical Price − MA) / 0.015 * Mean Deviation
 *
 * where:
 *     Typical Price = ∑P((H + L + C) / 3))
 *     P = number of bars (period)
 *     MA = Moving Average = (∑P Typical Price) / P
 *     Mean Deviation=(∑P | Typical Price - MA |) / P
 */
here