Skip to main content
Any Framework

CCI Divergence Strategy (C#)

Published
Aug 7, 2025
1y ago
Total Downloads
1.8K
1,841

Install

dotnet add package StockSharp.Strategies.0068_CCI_Divergence --version 5.0.2

No framework information available.

README

CCI Divergence Strategy (C# Version)

Commodity Channel Index divergences can foreshadow trend reversals when price moves in the opposite direction of the indicator. This strategy compares swing highs and lows in price to those of the CCI to identify hidden strength or weakness.

Testing indicates an average annual return of about 91%. It performs best in the stocks market.

On each candle the system updates recent price and CCI values, flagging bullish divergence when price makes a new low while CCI forms a higher low. Bearish divergence is the opposite. When a divergence aligns with oversold or overbought levels, a trade is opened with a volatility stop.

Exits occur when the CCI crosses back through the zero line, signaling the impulse has played out. Because divergences can persist, the rules also reset after a fixed number of bars to avoid stale signals.

Details

  • Entry Criteria: Price/CCI divergence with CCI below -100 for longs or above +100 for shorts.
  • Long/Short: Both.
  • Exit Criteria: CCI crossing zero or stop-loss.
  • Stops: Yes, percentage based.
  • Default Values:
    • CciPeriod = 20
    • DivergencePeriod = 5
    • OverboughtLevel = 100
    • OversoldLevel = -100
    • CandleType = 15 minute
    • StopLossPercent = 2
  • Filters:
    • Category: Divergence
    • Direction: Both
    • Indicators: CCI
    • Stops: Yes
    • Complexity: Advanced
    • Timeframe: Intraday
    • Seasonality: No
    • Neural networks: No
    • Divergence: Yes
    • Risk level: Medium

Changes from Previous Version

No structural changes between v5.0.1 and v5.0.2.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.