Indicator Reference

Coppock Curve

Introduction

A momentum indicator developed by Edwin “Sedge” Coppock in October 1965. The goal of this indicator is to identify long-term buying opportunities in the S&P500 and Dow Industrials. source

Create Manual Indicators

You can manually create a CoppockCurve indicator, so it doesn’t automatically update. Manual indicators let you update their values with any data you choose. The following reference table describes the CoppockCurve constructor.

CoppockCurve()1/3

            CoppockCurve QuantConnect.Indicators.CoppockCurve (
   )
        

Initializes a new instance of the CoppockCurve indicator with its default values.

CoppockCurve()2/3

            CoppockCurve QuantConnect.Indicators.CoppockCurve (
     int  lwmaPeriod
   )
        

Initializes a new instance of the CoppockCurve indicator.

CoppockCurve()3/3

            CoppockCurve QuantConnect.Indicators.CoppockCurve (
     string  name,
     int     lwmaPeriod
   )
        

Initializes a new instance of the CoppockCurve indicator.

Update Manual Indicators

You can update the indicator automatically or manually.

Automatic Update

To register a manual indicator for automatic updates with the security data, call the RegisterIndicator method.


private CoppockCurve _cc;

// In Initialize()
_cc = new CoppockCurve(name, shortRocPeriod, longRocPeriod, lwmaPeriod);
_cc.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _cc, Resolution.Daily);

// In IndicatorUpdateMethod()
if (_cc.IsReady)
{
    var indicatorValue = _cc.Current.Value;
}
    
# In Initialize()
self.cc = CoppockCurve(name, shortRocPeriod, longRocPeriod, lwmaPeriod)
self.cc.Updated += self.IndicatorUpdateMethod

self.RegisterIndicator(symbol, self.cc, Resolution.Daily)

# In IndicatorUpdateMethod()
if self.cc.IsReady:
    indicator_value = self.cc.Current.Value

To customize the data that automatically updates the indicator, see Custom Indicator Periods and Custom Indicator Values.

Manual Update

Updating your indicator manually enables you to control when the indicator is updated and what data you use to update it. To manually update the indicator, call the Update method with time/decimal pair. The indicator will only be ready after you prime it with enough data.

    
private CoppockCurve _cc;
private Symbol symbol;

// In Initialize()
_cc = new CoppockCurve(shortRocPeriod, longRocPeriod, lwmaPeriod);
symbol = AddEquity("SPY").Symbol;

// In OnData()
if (data.ContainsKey(_symbol))
{
    _cc.Update(data[symbol].EndTime, data[symbol].High);
}
if (_cc.IsReady)
{
    var indicatorValue = _cc.Current.Value;
}
    
# In Initialize()
self.cc = CoppockCurve(shortRocPeriod, longRocPeriod, lwmaPeriod)
self.symbol = self.AddEquity("SPY").Symbol

# In OnData()
if data.ContainsKey(self.symbol):
    self.cc.Update(data[self.symbol].EndTime, data[self.symbol].High)
if self.cc.IsReady:
    indicator_value = self.cc.Current.Value

Create Automatic Indicators

The CC method creates an CoppockCurve indicator, sets up a consolidator to update the indicator, and then returns the indicator so you can use it in your algorithm.

The following reference table describes the CC method:

CC()1/1

            CoppockCurve QuantConnect.Algorithm.QCAlgorithm.CC (
    Symbol                           symbol,
    *Int32                           shortRocPeriod,
    *Int32                           longRocPeriod,
    *Int32                           lwmaPeriod,
    *Nullable<Resolution>      resolution,
    *Func<IBaseData, Decimal>  selector
   )
        

Initializes a new instance of the CoppockCurve" indicator


If you don't provide a resolution, it defauls to the security resolution. If you provide a resolution, it must be greater than or equal to the resolution of the security. For instance, if you subscribe to hourly data for a security, you should update its indicator with data that spans 1 hour or longer.

For more information about the selector argument, see Alternative Price Fields.

Get Indicator Values

To get the value of the indicator, use its Current.Value attribute.

private CoppockCurve _cc;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_cc = CC(symbol);

// In OnData()
if (_cc.IsReady)
{
    var current = _cc.Current.Value;
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.cc = self.CC(symbol)

# In OnData()
if self.cc.IsReady:
    current = self.cc.Current.Value

Visualization

To plot indicator values, in the OnData event handler, call the Plot method.

private CoppockCurve _cc;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_cc = CC(symbol);

// In OnData()
if (_cc.IsReady)
{
    Plot("My Indicators", "coppockcurve", _cc.Current);
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.cc = self.CC(symbol)

# In OnData()
if self.cc.IsReady:
    self.Plot("My Indicators", "coppockcurve", self.cc.Current)

For more information about plotting indicators, see Plotting Indicators.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: