Stock Timing Using Pairs Logic - Amazon Web...

26
Stock Timing Using Pairs Logic Perry Kaufman

Transcript of Stock Timing Using Pairs Logic - Amazon Web...

Page 1: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Stock Timing Using Pairs Logic

Perry Kaufman

Page 2: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Introducing KaufmanSignals.com

• The strategy shown here is one of three available on

KaufmanSignals.com

• The strategies are fully disclosed.

• Two of the strategies apply to stocks, ETFs, and futures.

This one applies only to stocks and ETFs.

• Today’s presentation is a slightly simplified version of the

full program, but is excellent as is.

• You will receive a working (not protected) TradeStation

program which you can modify or run as is. The program

is described at the end of this presentation.

• The website takes this strategy further, creating dynamic

portfolios and processing a large list of stocks and ETFs.

Page 3: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Arbitrage

• Arbitrage is one of the great strategies of all time.

• It finds two similar markets that are moving apart and buys the cheaper and sells the more expensive, exiting when the come back together.

• It can be done with U.S. – London – Hong Kong gold, or Ford – GM – Toyota – Honda, or Pulte and KB Homes, or even U.S. 10-year notes and the Eurobund.

• It’s been done for centuries but now it’s faster.

Page 4: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Traditional Approach

To identify trading opportunities, we can

1. Use the ratio (or difference) of two prices

2. Find two stocks (or ETFs or Futures markets) with correlations between 0.30 and 0.80 (not too strong or too weak)

3. Use cointegeration (the real method) to decide if these two stocks move in generally the same direction.

But we won’t. It’s unnecessarily complicated.

We’ll use the Stress Indicator that I introduced in “Alpha Trading”

Page 5: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Example: Ford(top) v GM(middle) using the ratio (bottom)

• Buy Ford and sell GM when ratio is low

• But what is high and what is low? And what is “normal?”

• Each pair has a different ratio

Page 6: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Using the Stress Indicator

• The Stress Indicator is made up of 3 simple stochastic

calculations (“raw stochastic”), over a 60-day period

• The stochastic is important because it doesn’t lag

• Stochastic 1 (F) = (C(today) – L(60))/(H(60) – L(60))

• Stochastic 2 (GM) = (C(today) – L(60))/(H(60) – L(60))

• Stochastic difference (D)

D = Stochastic1 – Stochastic2

• Stress = (D(today) – L(60)) / (H(60) – L(60))

• Ford is oversold relative to GM when the Stress Indicator

is below 10.

• It is neutral at 50.

Page 7: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

F v GM using the Stress Indicator

Page 8: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Good, but not good enough

The Stress Indicator gives good buy and sell points, but

buying one stock and selling another has problems:

1. Profits are frequent but very small (a lot of

competition and similarity of price movement)

2. It may be difficult to execute the short sale

3. Short sales aren’t allowed in IRAs.

The solution for some is to sell the SP (or buy SH or SDS),

but then profits are even smaller because the index

does not move as far (not as volatile) as an individual

stock.

Page 9: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

If you look hard enough…

• If you study the performance of the pairs, the long

position is the one that always makes money

• The stock market has a very strong bias to the upside

• Even when the market declines, it is fast, and the

upward climb occurs most of the time, to different

degrees.

• Then we really want to buy the stock but not go short

against it. Our profits per share would be much bigger.

• What if we have another 2008 and be sitting with a long

portfolio while the market tanks. But that’s easily solved…

Page 10: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Results of AMZN-WMT pairs trade using Stress Indicator

-1000

-500

0

500

1000

1500

2000

3/1/2005 3/1/2006 3/1/2007 3/1/2008 3/1/2009 3/1/2010 3/1/2011 3/1/2012 3/1/2013

$P/L AMZN-WMT Pairs trade

AMZN

WMT

cumPL

Page 11: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Separate the longs and shorts – better pattern and larger returns/share

-600

-400

-200

0

200

400

600

800

1000

1200

1400

Taking only the long trades for

AMZN-WMT

Long AMZN Long WMT Total Long

-800

-600

-400

-200

0

200

400

600

800

Taking only the short trades for

AMZN-WMT

Short AMZN Short WMT Total Short

Page 12: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Apple v SPY ($PL) – the early loss in AAPL is easier to take than the loss in SPY

-200

-100

0

100

200

300

400

500

600

7003/

1/20

05

7/1/

2005

11/1

/200

5

3/1/

2006

7/1/

2006

11/1

/200

6

3/1/

2007

7/1/

2007

11/1

/200

7

3/1/

2008

7/1/

2008

11/1

/200

8

3/1/

2009

7/1/

2009

11/1

/200

9

3/1/

2010

7/1/

2010

11/1

/201

0

3/1/

2011

7/1/

2011

11/1

/201

1

3/1/

2012

7/1/

2012

11/1

/201

2

AAPL

SPY

Total

Page 13: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Overview of results

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

Sy

mb

ol

OX

Y

CA

M

GIS

TL

M

MT

SL

B

NE

EO

G

BA

X

WM

B

AP

D

HA

L

BID

U

NE

M RS

CL

F

SN

Y

BH

I

DV

N SE

TS

MR

O

CV

X

MO

N

AD

I

HE

S

CS

X K

TS

M VE

UN

P

QC

OM DE

HU

M

CP

B

CA

T

GT

AT

LE

N M

MT

U

PK

X

NO

C

HS

Y

NE

E

AL

K

TG

T

AE

P

PC

G

JNJ

KM

B

ET

R

CC

C

ITW

MO

AL

XN

SB

UX

NS

C

YU

M

LC

C

WM

NV

S

SP

WR

GM VZ

KO

BR

CM

KE

Y

GE

PA

YX

SE

E

JBL

U

WF

C

Return ratio of 218 long stock positions (65% profitable after $8 cost)

-4

-3

-2

-1

0

1

2

3

4

5

AA

PL

TM

IBM

AP

C

BID

U

AM

GN

EO

G

AP

D C

DV

N

AT

I

ES

V

CC

L

BA

X

PE

P

MT

SR

CL

NF

LX

MS

I

HE

S

AB

C

XL

NX

HD

AB

X

MO

N RS

DE

GIS

GG

B K

GIL

D

AA

PK

X

TO

L

FT

I

DA

R

DU

K

AR

MH

TJX

NO

C

GP

C

BM

Y

TG

T

UN

H

ET

R

CL

X

CV

S

AE

P

TX

N

KM

B

SY

MC

GP

S

MC

D

RA

I

RS

G

CN

P

AA

MR

Q

CA

G

UA

L

ED

WM

PS

A

SP

WR

NV

S

AF

L

KE

Y

HA

SC

HW

DD

SE

E

PA

YX

BA

C

MR

K

Ret

urn

s p

er s

har

e in

$

Profits per share 218 long stock positions (FB is on the right), $0.30 median return

Page 14: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Protecting the downturn

• Unfortunately, it’s not safe to always be long

• We can protect our long stock positions by selling SPY (or buying SH or SDS) when the trend of the index turns down (or selling QQQ or buying QID)

• In our simple version we use a 60-day moving average and hedge 50% of the risk when that trend turns down.

• In the full version we use 3 trends, 30, 60, and 120 and hedge 1/3 of our 50% hedge on each one.

• The amount of the hedge is:

Stock size x (20-day ATR of the stock price divided by the 20-day ATR of the SPY price)

• The total hedge size is the sum of the hedge amounts for all the open stock trades

• Add and remove hedges as your positions change

Page 15: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Stop-loss

• I hate stop-loss orders, but they are necessary in this

strategy

• If we are long and we’ve picked an Enron, the price can

keep falling while the SPY is still in an uptrend

• We would never exit the trade because it is always

oversold compared to the SPY

• We never hedge because the overall market is still in an

uptrend

• Therefore, we use a 15% price stop from the point of

entry, just for an emergency

• In the long run, no stop is best, but in the short run, an

Enron can end your trading career

Page 16: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

The TradeStation program “KaufmanSignals Stock Timing”

• Input o “momper(60),” the Stress Indicator momentum calculation period

o “entrylevel(10),” the oversold (buy) level for the stock

o “exitlevel(50),” the exit level (sell to close) for the stock

o “minprice(3.00),” the minimum price for a stock to be bought

o “stoploss(0.15),” the percentage stop-loss from entry

o “hedgeper(60),” the calculation period for the index hedge

o “hedgeratio(0.50),” the maximum amount of risk to be hedged

o “investment(5000),” the investment amount for each stock

o “stockcost(8),” the cost per trade (needed for both the stock and hedge

• Output o Files are output to “c:\TradeStation\”

o There is one file for each pair, e.g.

“KaufmanSignals Stock Timing AMZN.csv”

o A “csv” file is loaded using Excel. It is unformatted.

o There is a summary file that collects the most recent day of each run

“KaufmanSignals Timing Summary.csv”

o You must erase this file manually if you want to start fresh

Page 17: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

: Sample Screen Setup: (Top) Ford, (Center) SPY with 60-day MA,

(bottom) Stress Indicator

Page 18: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Sample output for each market “KaufmanSignals Stock Timing AMZN.csv”

Date StockPL IndexPL CombPL Long AMZN Short QQQ

8/31/2004 4005 -95 3911 0 0

9/1/2004 4005 -95 3911 0 0

9/2/2004 4005 -95 3911 127.62 -146.36

9/3/2004 3941 -9 3932 127.62 -146.36

9/7/2004 3912 -52 3860 127.62 -146.36

9/8/2004 3848 -33 3816 127.62 -146.36

9/9/2004 3856 -75 3781 127.62 -146.36

9/10/2004 3920 -153 3767 127.62 -146.36

9/13/2004 4103 -220 3883 127.62 -146.36

Page 19: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Sample good results

-2000

0

2000

4000

6000

8000

10000

12000

AMZN v QQQ

Total $P/L

StockPL IndexPL CombPL

-400

-300

-200

-100

0

100

200

300

400

AMZN v QQQ

Number of Shares Traded

Long AMZN Short QQQ

Page 20: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

More good results

-3000

-2000

-1000

0

1000

2000

3000

4000

5000

6000

HES v SPY Total $P/L

StockPL IndexPL CombPL

-400

-300

-200

-100

0

100

200

300

400

HES v SPY Number of Shares Traded

Long HES Short SPY

Page 21: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Other results

-1500

-1000

-500

0

500

1000

1500

2000

2500

AFL v SPY Total $P/L

StockPL IndexPL CombPL

-4000

-2000

0

2000

4000

6000

8000

10000

12000

AET (Aetna) v SPY

StockPL IndexPL CombPL

Page 22: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Summary report

Date Market Action Size Index Action Size Stock

PL Index

PL Comb

PL

11/1/2013 ABC Long 78.28 SPY Short 0 1693 3320 5013

11/1/2013 ABX Long 277.62 SPY Short 0 5614 -1525 4088

11/1/2013 AET Long 77.91 SPY Short 0 2215 6012 8227

11/1/2013 AFL Long 0 SPY Short 0 1461 -904 557

11/1/2013 AIG Long 96.53 SPY Short 0 3550 2691 6241

11/1/2013 APC Long 52.43 SPY Short 0 6700 -1206 5494

11/1/2013 HES Long 59.84 SPY Short 0 4173 -1317 2856

11/1/2013 IBM Long 28.6 SPY Short 0 -500 109 -390

11/1/2013 XOM Long 0 SPY Short 0 2000 -1290 710

11/1/2013 AMZN Long 0 QQQ Short 0 9519 -867 8652

11/1/2013 AAPL Long 0 QQQ Short 0 7699 1172 8871

Page 23: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Summary of trading rules

• Decide on a pair to trade: AAPL v QQQ

• Calculate the Stress Indicator (SI) for that pair

• Buy the stock when SI < 10

• Exit the long stock position when SI > 50

• Calculate the 60-day moving average of QQQ

• If the trend of QQQ is down, hedge the stock

position with QQQ equal to the risk of the stock

using the 20-day ATR of each

• Exit the hedge when the stock position exits, or exit

the hedge when the trend of QQQ turns up

• Do not trade stocks under $3

Page 24: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

A fast way to build a portfolio of trades

• The objective is to keep the portfolio filled with the most volatile and (potentially) profitable markets

• Assume we scan 200+ pairs and want to choose the most likely to succeed. Then, for each pair o Calculate the return ratio over the past year (250 days)

o Calculate the recent 20-day return or the recent 20-day price volatility o Identify whether this pair has an active trade

• Sort the information in order of the highest ratio and largest recent profits

• Discard any market with a negative ratio

• Discard any market with no current position

• Start from the top and add markets until the portfolio is filled or until you run out of stocks that quality

• Using a strategy with a high chance of success, and eliminating those markets that do nothing, will allow you to beat the index even in an up market.

Page 25: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

KaufmanSignals.com

• Provides three robust strategies, applied to

220 stocks, 60 ETFs, and 60 futures: o Timing (pairs logic) for stocks, sector rotation

o Divergence for 220 stocks, 60 ETFs, and 60 futures

o Trend for stocks, ETFs, and futures

• Provides a variety of dynamic and fixed portfolios of different investment sizes for stocks, ETFs, and futures

• Provides all signals in all markets each day before the markets open (8 am New York)

• Tracks performance

• Provides value-added analysis monthly

• Available on a monthly/yearly subscription, but there is lots to read if you register for free

Page 26: Stock Timing Using Pairs Logic - Amazon Web Servicesptasite.s3.amazonaws.com/videos/StockTimingUsingPairs... · 2014-01-22 · Summary of trading rules • Decide on a pair to trade:

Any questions or comments?

Contact me at

[email protected]