10
05-IB16-981CH963 DOWNLOAD OUR FREE DEMO ibkr.com/sc101 Member - NYSE, FINRA, SIPC – Supporting documentation for any claims and statistical information will be provided upon request. *According to Barron’s best online broker review on March 9, 2015, How Secure Is Your Securities Portfolio. Lowest cost of any broker and Best Trading Experience & Technology in Barron’s survey. For more info see ibkr.com/awards. Barron’s is a registered trademark of Dow Jones & Company, Inc. † Based on DARTs of US ebrokers in Q4 2015. Why does IBKR do more trades than any other broker? Because it is the least expensive.* Why is IBKR the least expensive broker? Because it does more trades. How did we get here? In a free economy the best technology wins!* Economics 101 Interactive Brokers

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

  • Upload
    others

  • View
    7

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

05-IB16-981CH963

DOWNLOAD OUR FREE DEMOibkr.com/sc101

Member - NYSE, FINRA, SIPC – Supporting documentation for any claims and statistical information will be provided upon request. *According to Barron’s best online broker review on March 9, 2015, How Secure Is Your Securities Portfolio. Lowest cost of any broker and Best Trading Experience & Technology in Barron’s survey. For more info see ibkr.com/awards. Barron’s is a registered trademark of Dow Jones & Company, Inc. † Based on DARTs of US ebrokers in Q4 2015.

Why does IBKR do more trades than any other broker?

Because it is the least expensive.*

Why is IBKR the least expensive broker?

Because it does more trades.†

How did we get here?

In a free economy the best technology wins!*

Economics 101

Interactive Brokers

Page 2: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Lng 10.52

Download software at TC2000.comor call 1.800.776.4940

Page 3: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John F. Ehlers

Stay InPhase

TRADING TECHNIQUES

A

This cycles software specialist discusses anindicator based on cyclical analysis.

by John F. Ehlers

cycle is one market characteris-tic that can be scientificallymeasured. Although they can bemeasured, they are still mad-dening because they are in es-

sence ephemeral; they come and they go. Ourrecent research, however, indicates there is afundamental cycle parameter that leads us tothe correct trading strategy for any currentmarket mode. To find out more, we must startby defining two possible market modes, thetrend mode and the cycle mode. In the trendmode, the correct strategy is to buy (or sell, fordowntrends) and hold. In the cycle mode, thecorrect strategy is to buy and sell on the cyclicvalleys and peaks.

The parameter we use is the phase of thecycle. The measured phase tells us with greatsensitivity when we are in the trend mode,enabling the capture of a large fraction of thetrend movement. Typically, this capture rangeis far larger than can be obtained with acrossing moving average or other usual trendidentification techniques. In the cycle mode,the measured phase pinpoints the cyclic turnsin advance, with the further advantage that thefalse whipsaw signals of typical oscillatorsignals are avoided.

THE NATURE OF PHASETo use phase, we must first understand what itis. Simply, it is a description of where we arein the cycle. Are we at the beginning, middleor end of the cycle? Phase is a quantitativedescription of that location. Each cycle passesthrough 360 degrees to complete the cycle.One basic definition of a cycle is that it con-sists of an action having a uniform rate changeof phase. For example, a 10-day cycle passesthrough 360 degrees every 10 days. There-fore, a perfect cycle must change phase at the

BRU

CE

MAR

TIN

Page 4: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John F. Ehlers

rate of 36 degrees per day each day throughout the cycle.How does this help us see a trend mode? By reverse logic.

In a trend mode, there is no cycle, or at most a very weak one,and therefore, there is no rate change of phase. If we comparethe rate change of measured phase to the theoretical ratechange of phase of the weak dominant cycle in the trendmode, we get a correlation failure. This failure to correlate thetwo cases of the rate change of phase enables us to define thepresence of a trend. By knowing we have a trend, it is easy toset our strategy to a simple buy-and-hold method until thetrend disappears.

Θ

360˚

term averages to zero, with theresult that the correlation has anamplitude of π. The horizontalcomponent is Sin(θ)*Cos(θ) =0.5*Sin(2 θ). This term averagesto zero over the full cycle, withthe result that there is no horizon-tal component. The ratio of thetwo components goes to infinitybecause we are dividing by zero,and the arctangent is therefore 90degrees. This means the arrow ispointing straight up, right at thepeak of the sinewave.

One additional step in our cal-culations is required to clear the ambiguity of the tangentfunction. In the first quadrant, both the sine and cosine havepositive polarity. In the second quadrant, the sine is positiveand the cosine is negative. In the third quadrant, both arenegative. Finally, in the fourth quadrant, the sine is negativeand the cosine is positive. The phase angle is obtainedregardless of the amplitude of the cycle. For more informa-tion on the calculation, see sidebars, “BASIC code for phasecalculation” and “TradeStation code for phase calculation.”

PUTTING THE PHASETO WORKWe can make an outstanding cyclic indicator simply byplotting the sine of the measured phase angle. When we arein a cycle mode, this indicator looks very much like asinewave, but when we are in a trend mode, the sine of the

FIGURE 1: PHASE. Consider acycle to be one trip around a circle,or a 360-degree movement. Phasedescribes the location within acycle in degrees.

FIGURE 2: ADDING TIME. A sinewave in the time domain can be generated byplacing a pen on the arrowhead and drawing the paper along at a uniform rate, justlike a seismograph.

FIGURE 3: CYCLE BEGINNING. Phase varies uniformly throughout the cycle, andis drawn as reset to show the beginning of a new cycle.

PICTURE THISOne easy way to picture a cycleis as an indicator arrow bolted toa rotating shaft, as can be seen inthe phasor diagram of Figure 1.Each time the arrowhead sweepsthrough one complete rotation,a cycle is completed. The phase

increases uniformly throughout the cycle, as shown in Figure2. The phase continues for the next cycle but is usually drawnas reset to zero to start the next cycle.

If we also place a pen on the arrowhead and draw on a sheetof paper below the arrowhead at a uniform rate, much in theway like a seismograph, the pen draws a theoretical sinewave.The relationship between the phasor diagram and the theo-retical sinewave is shown in Figure 3. The sinewave is thetypical cycle waveform we recognize in the time domain onour charts. The phase angle of the arrow uniquely describeswhere we are in the time domain waveform.

BUT FIRST, SOME TRIGThe position of the tip of the arrow in Figure 1 can bedescribed in terms of the length of the arrow, L, and the phaseangle, θ. If we let the arrow be the hypotenuse of a righttriangle, we can convert the description of the arrow fromlength and angle to two orthogonal components — the othertwo legs of the right triangle. The vertical component isL*Sin(θ) and the horizontal component is L*Cos(θ). Theratio of these two components is the tangent of the phaseangle. So if we know the two components, all we have to doto find the phase angle is to take the arctangent of their ratio.This is something that may not be easy for you to do by hand,but it’s a breeze for your computer.

We measure the phase of the dominant cycle by establish-ing the average lengths of the two orthogonal components.This is done by correlating the data over one full cycle periodagainst the sine and cosine functions. Once the two orthogo-nal components are measured, the phase angle is establishedby taking the tangent of their ratio.

A simple test is to assume the price function is a perfectsinewave, or Sin(θ). The vertical component would be Sin2(θ)= 0.5*(1-Cos(2 θ)) taken over the full cycle. The Cos(2 θ)

Page 5: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John F. Ehlers

measured phase angle tends to wander slowly because thereis only an incidental rate change of phase. A clear, unequivo-cal indicator can be generated by plotting the sine of themeasured phase angle advanced by 45 degrees.

Such a case is depicted for the phasor diagram and the time

REAL WORLD EXAMPLESWhile theory is nice — it’s alwayshow I initially attack each tradingproblem — it is also possible fortheory to be a laboratory curiositywith no practical application. Hap-pily, this is not the case for the useof phase in trading.

FIGURE 4A: PLOTTING THE SINE OF THE MEASURED PHASE ANGLE. When ina trend mode, the sine of the measured phase angle tends to wander around slowlybecause there is only an incidental rate change of phase.

FIGURE 4B: PHASOR DIAGRAM AND TIME DOMAIN. Sinewave indicator iscreated by advancing the measured phase by 45 degrees.

domain in Figure 4B. The two lines cross shortly before thepeaks and valleys of the cyclic turning points, enabling theuser to make his trading decision in time to profit from theentire amplitude swing of the cycle. A significant advantage isthat the two indicator lines don’t cross except at cyclic turningpoints, avoiding the false whipsaw signals of most oscillatorswhen the market is in a trend mode. The two lines don’t crossbecause the phase rate of change is nearly zero in a trend mode.Since the phase does not change, the two lines separated by 45degrees in phase never get the opportunity to cross.

If the rate of change of the measured phase does notcorrelate with the theoretical phase rate change of the domi-nant cycle, then a trend must be in force. A workable defini-tion is that a trend exists when the measured phase rate ofchange is less than 67% of the theoretical phase rate of thedominant cycle. This is a very sensitive detector for the trendmode, enabling you to capture high percentages of the trendmovement.

The parameter we use is the phaseof the cycle. The measured phasetells us with great sensitivity whenwe are in the trend mode, enablingthe capture of a large fraction ofthe trend movement.

Figure 5 is a display for the September 1996 Deutschemarkcontract. The price bars are displayed in the top segment withtwo adaptive moving average overlays. The second segmentis the sinewave indicator, plots of the sine of the measuredphase angle and the phase angle advanced by 45 degrees.The measured phase is displayed below the sinewave indica-tor, and the measured dominant cycle and spectrum aredisplayed in the bottom segment.

From the way the phase varied uniformly in March, it isclear that Deutschemark was in the cycle mode during that

month. As a result, the sinewave indicator looks like asinewave and gives two buy signals and one sell signal wherethe sinewave indicator lines cross.

The phase stopped changing at a uniform rate in April andMay because two cycles identified by the spectrum displaywere present simultaneously. Since the phase hardly changedfrom day to day, the Deutschemark went into a trend modeduring these two months. The trend mode is identified, inTradeStation lingo, by “PaintBars,” where the price bars areviolet.

The correct trading strategy during April and May was tohold a short position (a move worth more than $2,500 percontract) because the faster adaptive moving average was

FIGURE 5: SEPTEMBER 1996 DEUTSCHEMARK. Here’s the cycle and phaseresponse of the September 1996 Deutschemark.

MES

A 96

Page 6: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John F. Ehlers

below the slower one. Another way to identify the downtrendis that the phase remained near zero degrees (or near 360degrees) during these two months. Note that the sinewaveindicator does not give false whipsaw signals during Apriland May. Whipsaws in the trend mode are common foroscillator indicators such as the stochastic and the relativestrength indicator (RSI).

The phase resumed its uniform rate of change during Juneand into July because the dominant cycle settled down to arelatively stationary value. As a result, the cycle mode ap-peared, the sinewave indicator again looks like a sinewave,and four excellent sell signals and three excellent buy signalsresulted.

Figure 6, showing the cycle and phase response of theSeptember contract of US Treasury bonds, is another ex-ample of how phase can be used to sharpen your tradingskills. In February and March, bonds were in a decline. Thephase hovered near zero degrees, clearly identifying thedowntrend. The correct trading strategy during this periodwas to hold a short position until the first cyclic buy signalgiven by the sinewave indicator early in April.

From that first cyclic buy signal, there were three morecyclic buy signals and three cyclic sell signals in the ensuingthree months. Bonds didn’t stay exclusively in the cyclemode during that time because the cycle length tended towander around. However, the cycle wandering only intro-duced distortions in the shape of the sinewave indicator. Thecrossover signals it produced were unequivocal and wouldhave produced substantial profits in every case.

CONCLUSIONPhase is an exciting new parameter to help techniciansanalyze the market, and it can help in several regards. First,it enables you to establish your trading strategy to fit the trend

BASIC CODE FOR PHASE CALCULATIONThis BASIC code finds the real part of the phasor (thehorizontal component) and the imaginary part of thephasor (the vertical component) by summing the productof the price and the two sinusoids over one full cycle ofthe dominant cycle. The arctangent function locates thephase to be in the first or fourth quadrant. The quadrantambiguity is removed by adding π to the phase angle is thereal part is negative. A value of π/2 is arbitrarily added tothe computed phase so the start of the cycle is referencedto a sinewave. The computed phase angle is then tested tofall within the range from zero to 2π. The phase is thenconverted to degrees from radian measure.

An interesting observation is that if the price is a linearslope, summing the product of the price and a sine over acycle is the discrete equivalent of the integral ∫ x Sin(x)dx. Correspondingly, the real part is the equivalent of theintegral ∫ x Cos(x) dx. Working through these theoreticalexamples, we find that the phase is 180 degrees for atrending upslope and zero degrees for a trendingdownslope. Thus, phase can be a sensitive way to detecta trend.

The dominant cycle is a required parameter in the code.This can be a constant, obtained by measuring the numberof bars between significant lows or significant highs. Aswith the TradeStation code, you can use a default value of15 for the dominant cycle. In MESA96, the dominantcycle is measured for every bar and can change from barto bar.

Pi=3.1415926TwoPi=2*PiFor I=FirstRecord to LastRecord RealPart = 0 ImagPart = 0 For J = 0 To DominantCycle(I) - 1 If I > DominantCycle(I) Then Weight = Close(I - J) RealPart = RealPart + Cos(TwoPi * J /DominantCycle(I)) * Weight ImagPart = ImagPart + Sin(TwoPi * J /DominantCycle(I)) * Weight Next If Abs(RealPart) > .001 Then Phase(I) = Atn(ImagPart / RealPart) Else Phase(I) = Pi / 2 * Sgn(ImagPart) End If If RealPart < 0 Then Phase(I) = Phase(I) + Pi Phase(I) = Phase(I) + Pi / 2 If Phase(I) < 0 Then Phase(I) = Phase(I) + TwoPi If Phase(I) > TwoPi Then Phase(I) = Phase(I) -TwoPi Phase(I) = 180 * Phase(I) / PiNext

—J.F.E.

FIGURE 6: CYCLE AND PHASE RESPONSE OF SEPTEMBER 1996 TREASURYBONDS. Bonds were in a decline in February and March. The phase hovered nearzero degrees, clearly identifying the downtrend. The correct trading strategy in thisperiod was to hold a short position until the first cyclic buy signal given by thesinewave indicator early in April.

Page 7: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John F. Ehlers

TRADESTATION CODE FOR PHASE CALCULATIONThe following code is written in EasyLanguage for usewith TradeStation. The major differences from the BASIC

code are that the angles are computed in degrees ratherthan radians and the input to the routine is the dominantcycle. We have let the default dominant cycle be 15 bars.

inputs: DomCycle(15);vars: RealPart(0), ImagPart(0), Weight(0), Phase(0),J(0);

for J = 0 to DomCycle -1 Beginweight = close[J];If DomCycle <>0 then BeginRealPart = RealPart + Cosine(360 * J / DomCycle) *Weight;ImagPart = ImagPart + Sine(360 * J / DomCycle) *Weight;

mode or the cycle mode. If you aren’t comfortable trading thecycle mode, you can always stand aside for a while until a newtrend mode is established. If you want to trade the cycle mode,the sinewave indicator, which is created by plotting the sine ofthe phase angle and the sine of the phase angle advanced by 45degrees, gives clear buy and sell signals in advance of eachcyclic turn. Getting the signal in advance enables you to make †See Traders’ Glossary for definition S&C

end;end;

If AbsValue(RealPart) > .001 Then BeginPhase = ArcTangent(ImagPart/RealPart);endelse BeginPhase = 90 * Sign(ImagPart);end;

If RealPart < 0 then Phase = Phase +180;Phase = Phase + 90;If Phase < 0 then Phase = Phase + 360;If Phase > 360 then Phase = Phase - 360;

plot1(Phase, “Phase”);—J.F.E.

your entry and exit right at the cyclic turning point withoutgiving up a piece of the market movement.

John Ehlers is an engineer and developer of the MESA96trading software program.

Page 8: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Client Name: TD AmeritradeJob Number: 0000070618_0000071386_M01Description: “FUTURES” Magazine P4CB

Bleed: 8.50”w x 11.50”hTrim: 7.875 x 10.25Safety: 7 x 9.75

Full PG 4/C BLEED

This advertisement prepared by:HAVAS WORLDWIDE NY200 Hudson StreetNew York, New York 10013

AD: Marta LlopAE: Katie BurnsProd: Linda Pino

BILL LABOR TO JOB NUMBER: 0000070618BILL OOP TO JOB NUMBER: 0000070618

Trade over 50 futures products virtually 24 hours a day, 6 days a week, with thinkorswim® on your desktop or your mobile device using TD Ameritrade Mobile

Trader. Trade futures on indices, currencies, commodities and more to diversify your portfolio, and be better prepared to weather market conditions. You also get live interactive in-platform education, access to former floor traders, and even the ability to test-drive strategies without risk on paperMoney.® There’s never been

a better time to make your fear of futures a thing of the past.

Visit tdameritrade.com/tradefutures to learn more and open a futures account.

Futures trading is speculative and is not suitable for all investors. Futures accounts are not protected by SIPC. Futures trading services provided by TD Ameritrade Futures & Forex LLC. Trading privileges subject to review and approval. Not all clients will qualify. This is not an offer or solicitation in any jurisdiction where we are not authorized to do business. TD Ameritrade, Inc., member FINRA/SIPC. © 2016 TD Ameritrade IP Company, Inc. All rights reserved. Used with permission.

TRADE FUTURES LIKETHERE’S A TOMORROW.

Filename0000071386_M01 70618_71386_M01.indd

Art Director

Artist

Marta Llop

J.Liew

User / PrevUs-Last Modified

CMYK

2-4-2016 4:33 PM

Bleed

Trim

Saftey

8.5” x 11.5”

7.875” x 10.25”

7” x 9.75”

Path Premedia:Prepress:70618_71386:Fi-nal:Prepress:70618_71386_M01.indd

Derrick.Edwin / Chin.Liew

Client

Create

Proof

TD Ameritrade

2-4-2016 2:19 PM

Traffic Linda PinoFinal_7

Fonts Helvetica (Bold, Regular; True Type), Quicksand (Bold, Regular; OpenType), Helvetica LT Std (Bold; OpenType), Akzidenz-Grotesk Pro (Regular; OpenType)

Art TDA_70618_10c_SW_Robots.tif (Arts_Logos:TD Ameritrade:Art:Artwork:2016:TDA_70618_10c_SW_Robots.tif), TDAM_LOGOS_V15_LOCKUP_R_SW_KO.ai (Arts_Logos:TD Ameritrade:Logos:Logos:TDAM_LOGOS_V15_LOCKUP_R_SW_KO.ai), TDAM_CUSTOMERLOGOS_V115_PaintBorder_Vert_SWOP_NEWS_P.ai (Arts_Logos:TD Ameritrade:Logos:Customer Logos:TDAM_CUSTOMERLOGOS_V115_PaintBorder_Vert_SWOP_NEWS_P.ai), TDAM_CUSTOMERLOGOS_V116_Single_Paint_Stroke_SWOP_NEWS_P.ai (Arts_Logos:TD Ameritrade:Logos:Customer Logos:TDAM_CUSTOMERLOGOS_V116_Single_Paint_Stroke_SWOP_NEWS_P.ai)

S:7”

S:9.75”

T:7.875”

T:10.25”

B:8.5”

B:11.5”

Page 9: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

StockCharts.com

John Murphy Martin Pring

Arthur Hill Tom Bowley

Greg Schnell

Gatis Roze

Chip Anderson

Carl Swenlin

Julius de Kempenaer

Erin Heim

© 2015 StockCharts.com,Inc. All Rights Reserved. Information provided by StockCharts.com is not investment advice. You are responsible for your own investment decisions.

and more!

Live, interactive webinars hostedby seasoned market techniciansOur free daily webinars are hosted by some of the financial industry’s most distinguished chartists. Join these technical titans LIVE as they put their years of experience on display and share invaluable insights into the tools and strategies they use in their own trading. Tune in to any of our seven different webinar shows for free, airing six days a week, Monday through Saturday, and learn from the best toboost your technical skills and financial prowess.

Free daily blogs featuring over adozen renowned technical commentatorsStockCharts.com hosts free daily blog content from over a dozen professional technical analysts, including prominent names such as John Murphy, Martin Pring and Arthur Hill. Thousands of online investors trust StockCharts.com to provide the unbiased expert analysis and enriching educational commentary they need to cut through thenoise and make smarter investment decisions.

From daily blogs to live webinars, StockCharts.com hosts free current market analysis and educational commentary from someof the industry’s most distinguished technical analysts.

Daily technical commentaryby expert analysts to help youmake smarter investment decisions

Page 10: Stocks & Commodities V. 14:11 (483-487): Stay In Phase by John … · 2016-12-09 · because the phase rate of change is nearly zero in a trend mode. Since the phase does not change,

Subscribe Or Renew Today!Now a subscription to Technical Analysis of StockS & commoditieS magazine gets you so much more than just a magazine:

Or try our best value subscription:

• Full access to our Digital Edition The complete magazine as a PDF you can download.

• Full access to our Digital Archives That’s 33 years’ worth of content!

• Complete access to Working Money The information you need to invest smartly and successfully.

• Access to Traders.com Advantage Ideas, insights, evaluations, tips and techniques that can help you trade smarter.

PROFESSIONAL TRADERS’ STARTER KIT5-year subscription to S&C magazine, Working Money and Traders.com Advantage, access to the digital edition and our entire 33-year archive PLUS a free* book, Charting The Stock Market: The Wyckoff Method, all for a price that saves you $150 off the year-by-year price!*Shipping & handling charges apply for foreign orders.

1 year ..................$8999

2 years .............$14999

3 years .............$19999

All for only

for a 5-yearsubscription

Visit www.Traders.com to find out more!Email: [email protected] • Phone: 206-938-0570 • Toll free: 1-800-832-4642 • Fax: 206-938-1307

Join us on Facebook at www.facebook.com/STOCKSandCOMMODITIES Follow us on Twitter @STOCKSandCOMM