Coppock Curve (COPPOCK)
Summary
Coppock Curve: Edwin S. "Sedge" Coppock's long-term momentum oscillator (Barron's, originally published as the "Trendex Model"), computed as a weighted moving average of the sum of two rates of change.
Unbounded; positive turns from below zero are the signal the indicator was designed for (long-term buying opportunities on monthly index data).
Chart
Chart metadata i
Outputs
outReal:line·zero·positive·negative
Formula
COPPOCK = WMA(ROC(optInROC1Period) + ROC(optInROC2Period), optInWMAPeriod)
Each ROC carries ROC's own zero guard — a zero price optInROC*Period bars back yields 0.0 for that term, never an infinity. The two ROCs are summed, not averaged: every published definition sums them. (Tulip's copp averages, so it reads at exactly half this amplitude — a clean 2.0x ratio against Tulip is Tulip's variant, not a defect.)
The formula is symmetric in the two ROC periods and the lookback keys off their max, so optInROC1Period > optInROC2Period is accepted rather than rejected.
The classic defaults are 11/14/10 on monthly data. Wikipedia's daily-scale variant (231/294-bar ROC, 210-bar WMA) is a parameter choice reachable through this API, not a competing formula.
Inputs
inReal— Source price/value series (canonically a monthly close)
Outputs
outReal— Coppock Curve value
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInWMAPeriod | integer | 10 | 1–100000 | Smoothing period for the ROC sum |
optInROC1Period | integer | 11 | 1–100000 | Short rate-of-change period |
optInROC2Period | integer | 14 | 1–100000 | Long rate-of-change period |
Notes
- The input is assumed positive. The price each rate of change looks back to is its divisor. Near zero the divisor is small and the output very large; no error is returned. A series that reaches or crosses zero, such as an oscillator or a spread, has no meaningful result here.
- The single fused pass is bit-identical to running
ROC + ROCintoWMA. - First output at
max(optInROC1Period, optInROC2Period) + optInWMAPeriod - 1. Not start-dependent: each output depends only on its finite trailing window.
Properties
Numerical Stability: Start-Independent
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Display Shift |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
| ☐ Uses Transcendental |
| ✅ Input Must Be Positive i |
Example
#include <stdio.h>
#include <ta_libc.h>
int n = 252;
double series[252]; /* your data, oldest first */
double out[252];
int outBegIdx, outNBElement;
TA_Initialize();
TA_COPPOCK( 0, n - 1, series, 10, 11, 14, &outBegIdx, &outNBElement, out );
printf( "%d values from bar %d: [%.4f, ..., %.4f]\n", outNBElement, outBegIdx, out[0], out[outNBElement - 1] );use ta_lib::Core;
let series = vec![0.0; 252]; // your data, oldest first
let mut out = vec![0.0; 252];
let core = Core::new();
let range = core.coppock(0, series.len() - 1, &series, 10, 11, 14, &mut out)?;
println!("{} values from bar {}: [{:.4}, ..., {:.4}]", range.count, range.beg_idx, out[0], out[range.count - 1]);import io.github.talib.Core;
import io.github.talib.OutRange;
import java.util.Locale;
double[] series = new double[252]; // your data, oldest first
double[] out = new double[252];
Core core = Core.DEFAULT;
OutRange r = core.coppock(0, series.length - 1, series, 10, 11, 14, out);
System.out.printf(Locale.ROOT, "%d values from bar %d: [%.4f, ..., %.4f]%n", r.count(), r.begIdx(), out[0], out[r.count() - 1]);using System;
using TALib;
var series = new double[252]; // your data, oldest first
var outReal = new double[252];
var core = Core.Default;
OutRange r = core.Coppock(0, series.Length - 1, series, 10, 11, 14, outReal);
Console.WriteLine(FormattableString.Invariant($"{r.Count} values from bar {r.BegIdx}: [{outReal[0]:F4}, ..., {outReal[r.Count - 1]:F4}]"));import { coppock } from 'ta-lib';
const series = new Float64Array(252); // your data, oldest first
const { begIdx, values } = coppock(series, {
wmaPeriod: 10,
roc1Period: 11,
roc2Period: 14,
});
console.log(values.length + ' values from bar ' + begIdx + ': [' + values[0].toFixed(4) + ', ..., ' + values[values.length - 1].toFixed(4) + ']');import (
"fmt"
"log"
talib "ta-lib.github.io/go"
)
series := make([]float64, 252) // your data, oldest first
out := make([]float64, 252)
core := talib.NewCore()
r, err := core.COPPOCK(0, len(series)-1, series, 10, 11, 14, out)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%d values from bar %d: [%.4f, ..., %.4f]\n", r.NBElement, r.BegIdx, out[0], out[r.NBElement-1])Implementation
Added in 0.8.1 (ta-lib-python 0.8.1).
TA-Lib Definition: coppock.c · coppock.yaml
| Native | File |
|---|---|
| C | ta_COPPOCK.c |
| Rust | coppock.rs |
| Java | Core_COPPOCK.java |
| C# | Core_COPPOCK.cs |
| TypeScript | coppock.ts |
| Go | coppock.go |
Python: talib.COPPOCK (ta-lib-python 0.8.1 or later), see ta-lib-python.
TA-Lib is also available for R and more using a wrapper.