Coppock Curve
A weighted average of the sum of a long and a short rate of change, around a zero line.
- Coppock
- Built into Spectral
- Updates every tick
- coppock curve
- rate of change
- long term
- monthly
- momentum
- oscillator
MIT-0: free to use, change and share, no attribution needed. What you build from it is yours.
Already in Spectral: add it from the Indicators toolbox. The file here is the same indicator written as a custom indicator, to change or learn from. Installed, it appears next to the built-in one, marked Custom.

Overview
The Coppock Curve (Edwin Coppock) adds the 14-bar and the 11-bar percent rate of change and smooths the sum with a 10-bar weighted average. Coppock designed it on monthly bars of a stock index to find the turns after a large decline.
How to read it
The classic signal is the curve turning up while it is below zero, after a decline: momentum is still negative but no longer worsening. A turn down above zero shows an advance losing speed, though Coppock did not use it as a sell signal.
On monthly and weekly bars it marks major turns; on intraday bars it behaves like a smoothed momentum line and turns far more often.
Settings and limitations
Defaults are 10, 14 and 11, the original monthly settings and TradingView's defaults; keep them on monthly bars. The first value appears on bar Long ROC length + Average length (bar 24 with the defaults).
Notes
Matches the Coppock Curve on TradingView and most platforms.
Settings
Each setting appears in the indicator's settings panel in Spectral, next to a color setting for every output.
| Setting | Type | Default | Range or options | What it does |
|---|---|---|---|---|
| Average length | Whole number | 10 | 1 – 500 | Bars in the weighted average of the summed rates of change. |
| Long ROC length | Whole number | 14 | 1 – 500 | Bars in the longer rate of change. |
| Short ROC length | Whole number | 11 | 1 – 500 | Bars in the shorter rate of change. |
| Source | Price source | close | open, high, low, close, hlc3 | Price the rates of change are calculated from. |
What it draws
Lines
- Coppocksolid · 1.5 px · primary
#7FB5A0
Levels
- Zero linedotted · 1 px
#788493
Source
Save it as coppock-curve.js and add it with Indicators → Custom indicators → Add file…. The format is explained in the custom indicators guide.
// Copyright (c) 2026 Spectral
// SPDX-License-Identifier: MIT-0
// Free to use, copy, modify and share: https://spectral.trade/docs/custom-indicators/LICENSE.txt
/** Percent change over `length` bars; null until `length` earlier bars exist or when the earlier price is 0. */
function rateOfChange(values, length) {
return values.map((value, index) => {
const earlier = index >= length ? values[index - length] : null;
return earlier === null || earlier === 0 ? null : (100 * (value - earlier)) / earlier;
});
}
/** @type {import('./spectral-indicator').IndicatorV2} */
export default {
schemaVersion: 2,
id: 'coppock-curve',
name: 'Coppock Curve',
shortName: 'Coppock',
version: '1.0.0',
author: 'Spectral',
description: 'A weighted average of the sum of a long and a short rate of change, around a zero line.',
pane: 'oscillator',
live: { lookback: 'wmaLength + longRocLength + shortRocLength' },
inputs: {
wmaLength: { type: 'integer', label: 'Average length', default: 10, min: 1, max: 500, description: 'Bars in the weighted average of the summed rates of change.' },
longRocLength: { type: 'integer', label: 'Long ROC length', default: 14, min: 1, max: 500, description: 'Bars in the longer rate of change.' },
shortRocLength: { type: 'integer', label: 'Short ROC length', default: 11, min: 1, max: 500, description: 'Bars in the shorter rate of change.' },
source: { type: 'source', label: 'Source', default: 'close', description: 'Price the rates of change are calculated from.' },
},
plots: {
coppock: { label: 'Coppock', color: '#7FB5A0', lineWidth: 1.5, primary: true },
},
levels: {
zero: { label: 'Zero line', color: '#788493', lineStyle: 'dotted' },
},
docs: {
overview: 'The Coppock Curve (Edwin Coppock) adds the 14-bar and the 11-bar percent rate of change and smooths the sum with a 10-bar weighted average. Coppock designed it on monthly bars of a stock index to find the turns after a large decline.',
howToRead: 'The classic signal is the curve turning up while it is below zero, after a decline: momentum is still negative but no longer worsening. A turn down above zero shows an advance losing speed, though Coppock did not use it as a sell signal.\n\nOn monthly and weekly bars it marks major turns; on intraday bars it behaves like a smoothed momentum line and turns far more often.',
settings: 'Defaults are 10, 14 and 11, the original monthly settings and TradingView\'s defaults; keep them on monthly bars. The first value appears on bar Long ROC length + Average length (bar 24 with the defaults).',
notes: 'Matches the Coppock Curve on TradingView and most platforms.',
},
calculate(ctx) {
const { bars, inputs, ta } = ctx;
const source = ta.source(bars, inputs.source);
const longRoc = rateOfChange(source, inputs.longRocLength);
const shortRoc = rateOfChange(source, inputs.shortRocLength);
const sum = longRoc.map((value, index) => (value === null || shortRoc[index] === null ? null : value + shortRoc[index]));
return { plots: { coppock: ta.wma(sum, inputs.wmaLength) }, levels: { zero: 0 } };
},
};Adapt it with an LLM
Paste this into your assistant and replace the second-to-last line with the change you want.
Start from this Spectral custom indicator: https://spectral.trade/indicators/coppock-curve.js Format reference: https://spectral.trade/docs/custom-indicators.llm.md Keep the file format and every rule of the reference; give the result a new id, name, shortName and version, and update docs and input descriptions to match. Keep its live updates exact and fast (section "Fast live updates" of the reference): carry values from bar to bar only through ctx.ta, and raise live.lookback if the change reads further back; Spectral rejects a file whose live updates differ from a full recalculation or are too slow. Change I want: <describe the change> Answer with the complete file in one code block, ready to save as <id>.js.


