Long Term Indicators: Big Hand and Coppock Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Just found two new indicators for ThinkorSwim that can be used for long-term option trading.

Big Hand with Weekly Aggregation_Waylock_AlphaInvestor

Big Hand should be run on SPY WEEKLY Chart.

thinkScript Code

Rich (BB 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

Coppock Indicator

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.

Copyright 2016 Scott J. Johnson (http://scottjjohnson.com)

thinkScript Code

Rich (BB code):
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);

How to Use Both Indicators

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). The Coppock indicator will let you know when to buy into an uptrend (indicated by a Buy label).



# Example 1: Amazon



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.



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:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
You can even buy LEAPs too if you want.

SPY went from 273 to 293.94 in 4 months.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Big Hand gave SPY a downtrend signal from 12/17. It opened at 259.4. Now SPY is at 237.13.



 
Last edited:
I

inpilna

New member
@BenTen

Ben, I think the sell arrow appeared after the weekly bar was built, therefore you would've only entered at the close of the bar, i.e. about $240 and missed the whole move.

Btw, how would you build the scan for Coppock, there's no function for buy signal=true. Thank you

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@inpilna I haven't been able to build a scanner on this one yet.

 
Last edited:
I

inpilna

New member
@BenTen Thank you for your reply, Ben.

 
Last edited:
R

ramblers926

New member
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:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@ramblers926 That's awesome! Thank you for sharing the scanner.

 
Last edited:
L

Lgh7vst

New member
VIP
Wow yeah works pretty good. Thank you much appreciated. Is there a way to use this to find candidates to sell or go short?
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Lgh7vst You can scan for new signals using the Scanner
 
L

Lgh7vst

New member
VIP
So your saying that it can find candidates with sell signals? I've only been about to use it to find buy signal opportunities
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Lgh7vst The original Coppock indicator only provides buy signals. I reversed the buy condition so that it can also generate sell signals but giving sell signals isn't the intended way of using this indicator.
 
markos

markos

Well-known member
VIP
Warehouse
So your saying that it can find candidates with sell signals? I've only been about to use it to find buy signal opportunities
Please remember also that these are long term indicators. The best signals may be on weekly charts and should be scanned with that in mind.
 
L

Lgh7vst

New member
VIP
@Lgh7vst The original Coppock indicator only provides buy signals. I reversed the buy condition so that it can also generate sell signals but giving sell signals isn't the intended way of using this indicator.
Thanks for your reply. Ok, now what about using that code ramblers put to scan for buy candidates? That's actually what I meant, can we scan for sell candidates. I've never coded but I want to contribute. I'll try to tinker myself this week with it but don't know where to start. In the meantime I just wanted to know if it's possible to scan for short candidates. This may start to become a viable option with current market conditions.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Lgh7vst Of course you can. In fact, the code for shorting was incorporated into this strategy. However, like I mentioned, Coppock was meant for bull market only. If you reverse the condition, it may not be a good idea. It might produce some good short signals but that wasn't the origingal purpose of the indicator.
 
H

Hariharan

New member
@Lgh7vst The original Coppock indicator only provides buy signals. I reversed the buy condition so that it can also generate sell signals but giving sell signals isn't the intended way of using this indicator.
Hi Ben
Very Nice indicator. I am new here. Also learning to trade. From the indicator above, I have two questions:
  • I don’t see any sell signal on the Cappock indicator. I only see Buy signals.
  • In the AMZN chart above, the Big Hand is on SPY and the Cappock is on AMZN. Am I correct to understand this? How do I get the Big Hand on the SPY on the AMZN chart for example?
  • Many thanks for clarifying.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Hariharan Coppock indicator was designed to produce Buy signals only. You can learn how to import the code into ToS by clicking here.
 
E

el_chartel

New member
Hey Guys, been lurking this site for a good week now. I really liked this indicator, it kind of does the same as the DMI crossover but less noise.

Anyway, I edited the original to make a scan version of the Coppock - also a "tick" version.

Tick Version - The Weekly Signal is shown on any time frame

Code:
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;

def 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();

def ZeroLine = 0;

plot data = (if Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2] then 1 else 0);
Scan Version - The scan will look 2 weeks back for a Buy signal and will color the box Green for a buy signal and gray if its past 2 weeks.

Code:
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;

def 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();

def ZeroLine = 0;

plot data = (if Coppock[1] < 0 and Coppock > Coppock[1] and Coppock[1] < Coppock[2] then 1 else 0);

assignBackgroundColor(if data[1] == 1 or data[2] == 1 then color.GREEN else color.Gray);
data.assignvaluecolor(if data[1] == 1 or data[2] == 1 then color.GREEN else color.Gray);
 
Last edited:

Top