Coppock Curve Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
Coppock Curve is a momentum indicator designed for long term trend trading. By default, it will show buy signals only on the weekly charts.

Code:
#
# Copyright 2016 Scott J. Johnson (https://scottjjohnson.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# CoppockIndicator
#
# Charts the Coppock Indicator described here:
#             https://en.wikipedia.org/wiki/Coppock_curve
#
# The Coppock can be used (along with other indicators like the Eureka Signal
# and IBD6000 %Es) to identify points where the stock market trend changes
# from down to up. The Coppock does not identify the beginning of downtrends.
#
# This study is designed to be applied to a major market index (e.g., SPX or
# COMP) with an aggregation period of weeks or months.
#
declare lower;

input RateOfChangeSlowPeriod = 14;
input RateOfChangeFastPeriod = 11;
input WeightedMAPeriod = 10;

def AggregationPeriod = if (getAggregationPeriod() < AggregationPeriod.WEEK) then AggregationPeriod.WEEK else getAggregationPeriod();

def price = close(period = AggregationPeriod);

def ROC1 = if price[RateOfChangeSlowPeriod]!=0 then (price/price[RateOfChangeSlowPeriod]-1)*100 else 0;
def ROC2 = if price[RateOfChangeFastPeriod]!=0 then (price/price[RateOfChangeFastPeriod]-1)*100 else 0;

plot Coppock = WMA(ROC1 + ROC2, WeightedMAPeriod);

Coppock.assignValueColor(if Coppock>Coppock[1] then color.green else color.red);
Coppock.SetDefaultColor(GetColor(1));
Coppock.setLineWeight(2);
Coppock.HideBubble();

plot ZeroLine = 0;

ZeroLine.SetDefaultColor(color.white);
ZeroLine.HideBubble();

AddChartBubble(Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2], Coppock, "Buy", Color.CYAN, no);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Here is another long term trading indicator called Big Hand. The Big Hand indicator will let you know the beginning of a downtrend and also the beginning of an uptrend (indicated by arrow up and arrow down). It should should be run on SPY WEEKLY Chart.

Code:
#  Big_Hand_Arrows_On_Study_w_Agg
#  Use on Weekly Chart
#  Script by Waylock
# AlphaInvestor - 05/12/2017 - force to weekly aggregation

declare lower;

input agg = AggregationPeriod.WEEK;
# Hide Study Name and Inputs
# Add this to hide the text on the title bar
plot Scriptlabel = Double.NaN;
Scriptlabel.SetDefaultColor(CreateColor ( 6, 0, 48 ));
input fastLength = 19;
input slowLength = 39;
def c = close(period = agg);
plot Value = ExpAverage(c, fastLength) - ExpAverage(c, slowLength);
def Value_color = if Value > 0 then yes else no;
Value.DefineColor( "ValueUp", Color.GREEN );
Value.DefineColor( "ValueDn", Color.RED );
Value.AssignValueColor( if Value_color then Value.Color( "ValueUp" ) else Value.Color( "ValueDn" ) );
plot ZeroLine = 0;
Value.SetDefaultColor(Color.CYAN);
ZeroLine.SetDefaultColor(Color.YELLOW);
ZeroLine.HideTitle();
ZeroLine.HideBubble();
def xUndr = Value[1] < 0 and Value > 0;
def xOver = Value[1] > 0 and Value < 0;
plot ArrowUp = if xUndr then xOver else Double.NaN;
ArrowUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
ArrowUp.SetDefaultColor(Color.YELLOW);
ArrowUp.SetLineWeight(5);
ArrowUp.HideTitle();
ArrowUp.HideBubble();
plot ArrowDn = if xOver then xUndr else Double.NaN;
ArrowDn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
ArrowDn.SetDefaultColor(Color.YELLOW);
ArrowDn.SetLineWeight(5);
ArrowDn.HideTitle();
ArrowDn.HideBubble();
# Make Label on Study panel to show the value of the Big Hand
def data = Value;
AddLabel(yes, "Big Hand   " + Round(data, 2), if data > 0 then Color.GREEN else Color.RED);
AddLabel(yes, "Big Hand should be run on SPY WEEKLY Chart", Color.GRAY);
# End Study

dEoQUuN.png


# Example 1: Amazon

6e3HkVV.png


Let's use Amazon as an example. The last time we got a Buy signal from the Coppock indicator was October 9th, 2017. Closing price was $1002.94. Fast forward to October 23rd, we saw a $98 jump in price (in less than a month).

# Example 2: SPY

With SPY, the last time we got a Buy signal from the Coppock indicator was May 7th of this year. Closing price was $272.85. Shortly a month after, we saw a $5 jump in price.

I'll be taking a look at some of the signals given by the Big Hand indicator on SPY as well. In late September 2015 and early 2016, we saw a few uptrend and downtrend signals.

SPY opened at $195ish. Less than a month later, its lowest was 186ish. We can also see how the Coppock and Big Hand indicators correlate with each other at some events.

w6i6amQ.png


It's important to note that there is currently a downtrend signal on SPY, given by the Big Hand indicator.

Give these 2 indicators some backtesting and you should see a clear picture. Looking at historical data, we should see a Buy signal from the Coppock and an uptrend signal from the Big Hand indicator pretty soon. How I'm going to approach this strategy is fairly simple. Look through some historical data, see how much a stock usually jump after they were given a Buy signal and how long it took them. I'd say usually 1-2 months.
 
Last edited:
I have just hacked together a version of the Coppock scan based on the indicator code from Ben. It appears to be working, feel free to check it out and let me know if you come across issues. Note: Please make sure the aggregation period is set to Weekly or higher.

Thinkscript Code

Rich (BB code):
input RateOfChangeSlowPeriod = 14;
input RateOfChangeFastPeriod = 11;
input WeightedMAPeriod = 10;

def price = close;

def ROC1 = if price[RateOfChangeSlowPeriod]!=0 then (price/price[RateOfChangeSlowPeriod]-1)*100 else 0;
def ROC2 = if price[RateOfChangeFastPeriod]!=0 then (price/price[RateOfChangeFastPeriod]-1)*100 else 0;

def Coppock = WMA(ROC1 + ROC2, WeightedMAPeriod);

plot result = Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2];
 
Last edited by a moderator:
What you have created with a "monthly" type indicator is really cool. I may be able to adapt that to my time frames.

Thanks!

 
Last edited:
Can you help to create a watch list indicating buy signal generated by Coppock curve indicator (counting days after the signal)?

declare lower;

input RateOfChangeSlowPeriod = 14;
input RateOfChangeFastPeriod = 11;
input WeightedMAPeriod = 10;

def AggregationPeriod = if (getAggregationPeriod() < AggregationPeriod.FIFTEEN_MIN) then AggregationPeriod.FIFTEEN_MIN else getAggregationPeriod();

def price = close(period = AggregationPeriod);

def ROC1 = if price[RateOfChangeSlowPeriod]!=0 then (price/price[RateOfChangeSlowPeriod]-1)*100 else 0;
def ROC2 = if price[RateOfChangeFastPeriod]!=0 then (price/price[RateOfChangeFastPeriod]-1)*100 else 0;

plot Coppock = WMA(ROC1 + ROC2, WeightedMAPeriod);

Coppock.assignValueColor(if Coppock>Coppock[1] then color.green else color.red);
Coppock.SetDefaultColor(GetColor(1));
Coppock.setLineWeight(2);
Coppock.HideBubble();

plot ZeroLine = 0;

ZeroLine.SetDefaultColor(color.white);
ZeroLine.HideBubble();

AddChartBubble(Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2], Coppock, "Buy", Color.CYAN, no);
 
Coppock Watch List
Please refer any questions on how to trade this indicator to: @samiranadhikari
Shared Link: http://tos.mx/BQQf7lM
Click here for --> Easiest way to load shared links
Ruby:
input RateOfChangeSlowPeriod = 14;
input RateOfChangeFastPeriod = 11;
input WeightedMAPeriod = 10;
def price = close ;
def ROC1 = if price[RateOfChangeSlowPeriod]!=0 then (price/price[RateOfChangeSlowPeriod]-1)*100 else 0;
def ROC2 = if price[RateOfChangeFastPeriod]!=0 then (price/price[RateOfChangeFastPeriod]-1)*100 else 0;

plot Coppock = WMA(ROC1 + ROC2, WeightedMAPeriod);

AssignBackgroundColor(
if Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2] then color.cyan else color.violet);
4QImhrX.png

8kIlRvi.png
 
Coppock Curve is a momentum indicator designed for long term trend trading. By default, it will show buy signals only on the weekly charts.

Code:
#
# Copyright 2016 Scott J. Johnson (https://scottjjohnson.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# CoppockIndicator
#
# Charts the Coppock Indicator described here:
#             https://en.wikipedia.org/wiki/Coppock_curve
#
# The Coppock can be used (along with other indicators like the Eureka Signal
# and IBD6000 %Es) to identify points where the stock market trend changes
# from down to up. The Coppock does not identify the beginning of downtrends.
#
# This study is designed to be applied to a major market index (e.g., SPX or
# COMP) with an aggregation period of weeks or months.
#
declare lower;

input RateOfChangeSlowPeriod = 14;
input RateOfChangeFastPeriod = 11;
input WeightedMAPeriod = 10;

def AggregationPeriod = if (getAggregationPeriod() < AggregationPeriod.WEEK) then AggregationPeriod.WEEK else getAggregationPeriod();

def price = close(period = AggregationPeriod);

def ROC1 = if price[RateOfChangeSlowPeriod]!=0 then (price/price[RateOfChangeSlowPeriod]-1)*100 else 0;
def ROC2 = if price[RateOfChangeFastPeriod]!=0 then (price/price[RateOfChangeFastPeriod]-1)*100 else 0;

plot Coppock = WMA(ROC1 + ROC2, WeightedMAPeriod);

Coppock.assignValueColor(if Coppock>Coppock[1] then color.green else color.red);
Coppock.SetDefaultColor(GetColor(1));
Coppock.setLineWeight(2);
Coppock.HideBubble();

plot ZeroLine = 0;

ZeroLine.SetDefaultColor(color.white);
ZeroLine.HideBubble();

AddChartBubble(Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2], Coppock, "Buy", Color.CYAN, no);
Hi @BenTen , Is there a way to add this to an indicator of a similar scale (such as a GACD) without having it flattening the GACD indicator?
https://usethinkscript.com/threads/...convergence-divergence-for-thinkorswim.11300/
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
312 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top