fve breakout trading.pdf

10
 Copyright (c) Technical Analysis Inc. Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos I n INDICATORS The Infinitely Useful FVE  Here’s an important enhancement to the finite volume elements indicator that’s especially useful with intraday minute charts.  by Markos Katsanos the April 2003 STOCKS & COMMODITIES, I introduced the finite volume elements indi- cator (FVE) and demonstrated how it can be used to detect breakouts in daily charts. To refresh your memory, the FVE is a money flow indicator, but it has two important inno- vations: first, the FVE takes into account both intra- and interday price action, and second, minimal price changes are taken into account by introducing a price threshold. Those innovations were introduced to improve on two important limitations of existing money flow indicators: Intraday money flow indicators (such as Chaikin’s money flow or intraday intensity) leave out all price action from the close to the next day’s open. This omission should not go unnoticed, since major news such as earnings numbers are usually released over- night. Similar interday money flow indicators such as on- balance volume† (OBV) add or subtract the volume from a running total, depending on whether the stock closed higher or lower. Thus, OBV will increase by all the day’s volume even if the security closed just one cent higher than the previous close. In designin g FVE, I introduced a threshold that will exclude minimal price changes. The FVE formula is: Where: t = Time segment chosen MA(V, t) = t-day moving average of volume V = Volume. It can take a +/- sign or zero value according to whether: (2) Detecting Breakouts In Intraday Charts Where: C= Today’s closing price H= Today’s high L= Today’s low Typical = (H+L+C)/3 Typical -1 = Yesterday’s typical price Cutoff coefficient = 0.3% The component on the right-hand side of (2) is the thresh- old parameter of the indicator and is a function of price only. I tested the indicator on daily charts and found that 0.3% was the optimal value for the cutoff coefficient. I did not take volatility into account, thus avoiding the extra complication in the formula and the controversy surrounding the subject of whether stock price changes are normally distributed. The drawback of this method, however, is that the constant cutoff coefficient will overestimate price changes in minute charts and underestimate corresponding changes in weekly or monthly charts. Based on the rule of square root of time, price changes of a random time series (such as stocks) move approximately proportional to the square root of the interval difference (see “Suggested reading and references”). The constant cutoff coefficient, therefore, should be adjusted to take into account the appropriate price interval using the formula below: Where: T = Chart interval in minutes Cutoff T = Cutoff for chart interval T Cutoff d = Cutoff for daily chart FVE =  (+V, V, 0) MA (V , t)  t  * 100 Σ 1 t * (1) C  H L 2 + typ ica l typica l -1  > cutoff * C or  < -cutoff * C + Cutoff t  = cutoff d  *  T 390 (3) Cutoff coefficients have been calculated for all time frames provided in Figure 1. These will have to be adjusted manually in the FVE formula. If you are using a tick interval chart, keep in mind that it has no intrabar extremes. The intraday component will vanish and the FVE formula will be reduced to a finite segment O BV indicator, but it will be more useful than OBV since it will oscillate between zero and +/-100. T his will make it easier to determine whether it is in a bullish or bearish state. An alternative way to calculate the cutoff coefficient, which will adjust to all time frames automatically, would be to take volatility into account.

Upload: thescienceoftime

Post on 14-Apr-2018

236 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 1/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

In

INDICATORS

The Infinitely Useful FVE 

 Here’s an important enhancement to the finite volume elements

indicator that’s especially useful with intraday minute charts.

 by Markos Katsanos

the April 2003 STOCKS & COMMODITIES, I

introduced the finite volume elements indi-

cator (FVE) and demonstrated how it can be

used to detect breakouts in daily charts. To

refresh your memory, the FVE is a money

flow indicator, but it has two important inno-

vations: first, the FVE takes into account both intra- and

interday price action, and second, minimal price changes are

taken into account by introducing a price threshold.

Those innovations were introduced to improve on two

important limitations of existing money flow indicators:

■ Intraday money flow indicators (such as Chaikin’s

money flow or intraday intensity) leave out all price

action from the close to the next day’s open. This

omission should not go unnoticed, since major news

such as earnings numbers are usually released over-

night.

■ Similar interday money flow indicators such as on-

balance volume† (OBV) add or subtract the volume from

a running total, depending on whether the stock closed

higher or lower. Thus, OBV will increase by all the day’s

volume even if the security closed just one cent higher

than the previous close. In designing FVE, I introduced a

threshold that will exclude minimal price changes.

The FVE formula is:

Where:

t = Time segment chosen

MA(V, t) = t-day moving average of volume

V = Volume. It can take a +/- sign or zero value

according to whether:

(2)

Detecting Breakouts In

Intraday ChartsWhere:

C= Today’s closing price

H= Today’s high

L= Today’s low

Typical = (H+L+C)/3

Typical-1

= Yesterday’s typical price

Cutoff coefficient = 0.3%

The component on the right-hand side of (2) is the thresh-

old parameter of the indicator and is a function of price only.

I tested the indicator on daily charts and found that 0.3% was

the optimal value for the cutoff coefficient. I did not take

volatility into account, thus avoiding the extra complication

in the formula and the controversy surrounding the subject of 

whether stock price changes are normally distributed. The

drawback of this method, however, is that the constant cutoff 

coefficient will overestimate price changes in minute charts

and underestimate corresponding changes in weekly or

monthly charts.

Based on the rule of square root of time, price changes of 

a random time series (such as stocks) move approximately

proportional to the square root of the interval difference (see

“Suggested reading and references”). The constant cutoff coefficient, therefore, should be adjusted to take into account

the appropriate price interval using the formula below:

Where:

T = Chart interval in minutes

Cutoff T

= Cutoff for chart interval T

Cutoff d

= Cutoff for daily chart

FVE =

(+V, V, 0)

MA (V, t) t * 100

Σ1

t

* (1)

CH L

2+ typical typical-1 > cutoff * C

or < -cutoff * C

+

Cutoff t = cutoff d * T390

(3)

Cutoff coefficients have been calculated for all time framesprovided in Figure 1. These will have to be adjusted manually

in the FVE formula.

If you are using a tick interval chart, keep in mind that it has

no intrabar extremes. The intraday component will vanish

and the FVE formula will be reduced to a finite segment OBV

indicator, but it will be more useful than OBV since it will

oscillate between zero and +/-100. This will make it easier to

determine whether it is in a bullish or bearish state.

An alternative way to calculate the cutoff coefficient,

which will adjust to all time frames automatically, would be

to take volatility into account.

Page 2: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 2/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

DETERMINING VOLATILITY

In calculating the historical volatility, the following

problems had to be addressed:

■ The shape of the distribution of stock price

changes deviates from the norm and is usually

positively skewed (off-center)

■ Variance is not constant over time.

One appropriate method to remove anomalies

and bring the distribution back to normal is to

convert prices to natural logarithms. The dynamic

effect of variance was addressed by calculating a

moving standard deviation over a short time span

equal to the finite time segment used to calculate

FVE. I forced the standard deviation to “move” by

adding the most recent and dropping the oldest

value from the calculation.

Historical volatility involves two distinct compo-

nents: interday and intraday. Interday volatility was

Threshold = Cutoff*C

The cutoff is calculated according to volatility formula (4).

Formula (4) is self-adjusting for each time interval. The

cutoff coefficients in Figure 1 should only be applied to the

constant threshold cutoff formula (2).

DETECTING BREAKOUTS IN INTRADAY CHARTS

The most common setup for a breakout is when the FVE

crosses the zero line at a steep angle, and in the process makes

higher highs and higher lows. Major breakouts were betterdetected on 30- or 60-minute charts. Stocks that were moving

sideways for some time, or basing for a relatively long period

of time, produced the most violent breakouts. In order to

reduce noise, the time period used to calculate FVE in intraday

minute charts had to be increased. The square root of time

relationship used to convert price changes did not produce the

best results, as the time segments were too large.

By testing on a number of stocks for different time frames,

I found that an approximate cubic root relationship existed

between the time segment used and the chart interval. This

can be expressed mathematically with the following formula:

(5)

Where:

PeriodT

= Period for chart interval t in bars

Periodd

= Period for daily chart in bars

FIGURE 1: The third column displays the square root of time relationship between different timeintervals. The fourth column displays the proposed cutoff coefficients for the old FVE formulaonly. These are not to be used with the new volatility-enhanced formula. The fifth columndisplays the proposed time span (in bars) for FVE and for different time interval charts.

Cutoff = 0.1* INTERV+ INTRAV

MF= CH L

2+ Typical Typical-1

+

PeriodT = periodd * 390T

3

calculated by taking the moving standard deviation of the

change of the log of the typical price (H+L+C)/3 over the most

recent time period. Intraday volatility was calculated by taking

the moving standard deviation of the difference of the logs of 

the day’s extreme values according to the following formulas:

INTERV = standard deviation (ln(Typ)– ln(Typ–1

))

INTRAV = standard deviation (ln(H)– ln(L))

Thus, the cutoff coefficient in inequality (2) was modified

according to the following formula:

(4)

Where:

Typical = (H+L+C)/3

Typical-1

= Yesterday’s typical price

INTERV = Interday volatility

INTRAV = Intraday volatility

ln = natural (to the base e) logarithm

The constant 0.1 is a universal optimum value derived by

testing and is valid for all time frames.The TradeStation and MetaStock codes for the modified

FVE calculation are included in sidebars 1 and 2, respectively.

I have also included a formula to calculate color-coded

volume bars according to inequality (2). Green is used for up

volume (that is, MF>threshold), red for down volume (MF<-

threshold), and blue when the stock does not move either way

by more than the threshold, where:

and 

Chart interval M inutes Sq. root Cutoff Period

of t ime coefficient for FVE

Tick 0.00 180

Minute 1 0.051 0.02 1605 min 5 0.113 0.03 10010 min 10 0.160 0.05 751/4 hr 15 0.196 0.06 601/2 hr 30 0.277 0.08 50Hourly 60 0.392 0.12 40Daily 390 1.000 0.30 22Weekly 1950 2.236 0.67 13Monthly 40950 10.247 3.07 5

CUTOFF COEFFICI ENTS FOR ALL TIM E FRAMES

Thus, to convert from a 22-day period on daily charts to the

appropriate period to use in a 60-minute chart, I multiply 22

by the cube root of 390/60 to get 41 bars. Values for the most

common minute charts can be found in Figure 1. Unless

optimization produces any better ones, these values can be

Page 3: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 3/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

used in intraday charts. If you use values smaller than those

proposed, it will make the indicator more sensitive but at the

expense of superfluous readings that are only suitable for

very short-term trading.

EXAMPLES

From February 14, 2003, until March 17, 2003 (Figure 2), thestock of Geron Corp. (GERN) was moving sideways or slightly

down. On March 12, FVE started diverging (on the 60-minute

charts), rising sharply to cross the zero line

at 15:30 on March 13. Three trading days

later, GERNhad surged an astonishing 215%

after announcing an important breakthrough

in its cancer research. The same setup was

repeated a few days later as FVE, diverging

from price, crossed the zero line at a very

steep angle. On March 27 at 15:30 it made

a series of two higher lows and two higher

highs. Two trading days after that, the stock 

was up again by more than 100%. It looked

as if the sky was the limit for GERN.

The next day, just as the stock price

made another high, FVE started making

lower highs. On 4/3/03 it nosedived to

cross its 30-day moving average, thus warn-

ing traders to get out.

On the 30-minute chart of Transmeta

Corp. (TMTA) displayed in Figure 3, the

breakout can be detected more easily. The

stock price had dropped from a high of 

$1.60 only a couple of months ago to less

than a dollar on April 22. But not for long.On that date, the relentless selling abated

and the stock started building a base, mov-

ing sideways for a week. FVE was limping

along below the zero line until May 2, when

it came to life abruptly, rose sharply, and

crossed the zero line. Two days later, the

stock broke out, rising more than 50%.

SYSTEM TESTING

In order to translate the setup described to

TradeStation EasyLanguage or MetaStock 

formula language or any other software code,

I had to define it precisely. I did not use thecross function available in both programs

because it produced too few or no trades at all.

Instead, the following two conditions de-

scribed FVE crossing the zero line:

■ Condition 1: FVE had to be between

-20 and 10.

■ Condition 2: The angle of the FVE

linear regression line had to be greater

than 30 degrees.

■ Condition 3: FVE should be above its 40-day expo-

nential average.

Condition 2 reduced the undesirable effect of whipsawing

around the zero line, and the combination of conditions 2 and

3 ensured that FVE was rising from below.

The requirement for the stock to be moving sideways was:

■ Condition 4: The stock’s 30-bar linear regression

FIGURE 2: You can see the 40-bar FVE moving sharply higher on 3/12/03 while the stock price was moving

sideways. On 3/18/03 the price of the stock surged. Color-coded volume bars calculated by the volatilityformula are displayed in the bottom window.

FIGURE 3: On 5/2/03 the FVE(50) rose sharply. Two days later the price of the stock rose more than 50%.

FVE

Volume bars

FVE

60-MINUTE CHART OF GERON CORP. (GERN) FROM 3/5/03 TO 4/10/03

30- M INUTE CHART OF TRANSM ETA CORP. (TM TA) FROM 4/2 1/03 TO 5/7/03

    T    R    A    D    E    S    T    A    T    I    O    N

Page 4: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 4/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

line should not rise more than

0.6% or fall less than

-0.3% per day (for daily charts)

or the corresponding percentages

in intraday charts.

This was expressed mathematically asfollows:

(6)

which can be expressed in terms of the

linear regression slope:

(7)

By substituting for:

(8)

Where:

LRV = Linear regression value of 

the linear regression line at the

latest bar

LRV-30

= Linear regression value of 

the linear regression line 30 bars

ago

LRS = Slope of the 30-bar linear

regression line

This condition did not achieve a perfect

base, since it only ensured that the linear

regression line remained relatively flat

but did not exclude intermediate swings of 

the stock price. I tried further constraints

but abandoned them, as they overwhelmed

the system and produced very few trades.

No optimization was carried out. I used

the value for the FVE period proposed in

Figure 1 for each intraday interval, except

for the five-minute interval, where it had to

be increased slightly from 100 to 120 bars.Technical analysis is not an exact science.

I have found out by testing that in the case

of very small time intervals of five minutes

or less, the cube root of time relationship in

formula (5) does not always work well for

every stock. The values proposed in Figure

1 might have to be adjusted in the range of 

+/- 25%, but in order to obtain the best

results, they should not be adjusted less or

more than the higher or lower time interval

value, respectively.

LRV LRV-30

30 * LRV-30

> -0.3%

LRS > -0.03%*LRV-30

LRS = tanα =LRV LRV-30

30

Buy

FVE exit

Buy

FVE exitBuy

FVE exit

FVE exit

Buy

Buy

FVE

Buy

FVE exit

Buy

FVE exit

FVE exit

Buy Buy

FVE exit FVE exit

Buy Buy

Buy

FVE exit

FVE exit

FIGURE 4: This is a terrible-looking chart, the envy of ski-slope developers and the darling of short sellers.This test detected all major breakouts and resulted in a respectful $17,000 profit with no short sales.

FIGURE 5: This was the clear winner, resulting in a net profit of $8,000.

 DAILY CHART OF ATMEL CORP. (ATML) FROM 10/1 2/01 TO 3/31/0 3

15- M INUTE CHART OF ATMEL CORP. (ATM L) FROM 3/1 0/03 TO 5/6/03

None of the above strategies were particularlysuitable for daytrading, since they involved keepingopen posit ions overnight. Not surprisingly, the mostappropriate for daytrading was the five-minutestrategy, with the average trade lasting no more thantwo cale ndar days or eight trading hours.

Page 5: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 5/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

TOP CHART: 30-MINUTE CHART OF ATMEL CORP. (ATML) FROM 1/7/03 TO 5/2/03

Volume bars

Buy

FVE exit

Buy

FVE exit

Buy

FVE exit Buy

FVE exit

Buy

TimeBarsLX

FVE exit

Buy

Buy

FVE exit

BuyBuy

FVE exit

FVE exit

FIGURE 6: All three major breakouts were detected, but there was one big loss that reduced net profits.

The square root of time relationship in

formula (3) was used to calculate the linear

regression percentages suggested in the

fourth condition for the different time

frames. This relationship produced good

results up to the smallest time interval of the

tests, and there was no need for any furtheradjustments.

The trade was exited after a certain number

of bars or when FVE declined at a steep angle.

More precisely, the exit conditions were:

■ Condition 5:The linear regression line

of 20-bar FVE had to decline at an

angle of -20 degrees or less.

■ Condition 6: A 50-bar time exit was

applied to the daily charts. The exit

period was increased for intraday charts.

In practice, a stop-loss condition should

also be applied. This was not included here,

as the purpose of the test was to compare the

efficacy of the different time frames.

Tests were performed on the daily chart of Atmel Corp.

(ATML) from September 4, 2001, to May 20, 2003, and on

intraday 30-, 15-, and five-minute charts from January 10,

2003, to May 20, 2003.

The daily chart test (Figure 4) produced excellent results.

Despite the stock being in a precipitous decline, a long-only

test returned an astonishing $17,000 profit on $10,000 per

trade capital, producing three winning long trades againstthe main trend. The buy and hold strategy lost a catastrophic

$7,500. The test detected all three major breakouts in Octo-

ber 2001, March 2002, and October 2002, but only the last

one of the smaller breakouts in 2003, which was still open by

the end of the test.

The stock was moving sideways during the intraday test

period. There were three brief major breakouts, one in the

middle of March, a smaller one in the middle of April, and

the last one at the beginning of May. All intraday tests

performed very well and produced at least $4,500 in profit,

versus the small loss suffered by buy and hold investors.

The clear winner was the 15-minute test (Figure 5) with

net profit of $8,000 versus a $500 buy and hold loss. Itdetected all three breakouts and suffered no major losses.

The runnerup was the five-minute test. Despite missing two

out of the three major breakouts, it came ahead of the 30-

minute test by detecting several minor ones only visible on

intraday charts.

The test on 30-minute charts (Figure 6) detected all three

major breakouts, but the results were impaired by a big loss.

This could have been prevented with a stop-loss condition.

None of the above strategies were particularly suitable for

daytrading, since they involved keeping open positions over-

night. Not surprisingly, the most appropriate for daytrading

was the five-minute strategy, with the average trade lasting no

more than two calendar days or eight trading hours.

Different programs calculate and present the profit/loss

report data differently, so these had to be checked manually.

I had to search through the usual plethora of test metrics to

present the most useful in Figure 7.

For the test to begin calculating FVE and its moving

average (2n1+n

2–1), extra bars need to be loaded before the

actual start test date, where: n1= FVE period and n2= movingaverage period. The variable n1was added twice, once for the

moving standard deviation and once for the FVE calculation.

To calculate the buy and hold profit, the first date I used

was the date that the test could start producing trades — that

is, the first date loaded plus (2n1+n

2–1). To calculate the

system profitability, I used the following useful formula

published by Michael Harris in the September 2002 STOCKS

& COMMODITIES:

(9)

Where:

(10)

(11)

AvgW= Average winning trade

AvgL= Average losing trade

N= Total number of trades

Nw=

 Number of winning trades

Values below zero indicate losing systems.

P =NW

N

RWL =AvgW

AvgL

Profitability= P 11 + Rwl

Page 6: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 6/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

FIGURE 7: P ROFIT/LOSS REPORT FOR FVE STRATEGY. Here you can see the results for the five-minute, 15-minute, 30-minute, and daily charts.

SYSTEM REPORT - FV E STRATEGY, Atme l Corpora ti on. (NASDAQ: ATMEL)

Chart Interval 5-minute 15-minute 30-minute Daily

Figure - 5 6 4Dollars per trade $10,000 $10,000 $10,000 $10,000Commission per trade $10.00 $10.00 $10.00 $10.00Total net profit (dollars/per trade constant) $4,668.30 $7,821.90 $4,495.70 $16,943.70Annual percent gain/loss 122.6% 211.5% 125.3% 99.1%Buy and hold profit -$505.37 -$465.98 -$1,230.15 -$7,513.31Annual buy and hold percent gain/loss -13.3% -12.6% -34.3% -43.9%Total number of trades 11 13 9 4Winning trades 7 8 5 3Losing trades 4 5 4 1Percent profitable 63.64% 61.54% 55.56% 75.00%Avg. trade profit/loss $424.39 $601.68 $499.52 $3,931.55Avg. winning trade $783.11 $1,132.42 $1,386.80 $5,707.07Avg. losing trade $203.37 -$247.50 -$609.57 -$1,395.00Ratio avg. win/avg. loss 3.85 4.58 2.28 4.09Profitability 1.54 1.42 0.94 2.80Max. trade drawdown -$588.00 -$918.40 -$1,458.00 -$1,625.00Reference bars needed 279 159 139 87Start date/loaded data 12/26/02 12/26/02 12/26/02 5/1/01Start date/test 01/02/03 01/06/03 01/10/03 09/04/01End date 05/20/03 05/20/03 05/20/03 05/20/03

Test period/days 139 135 131 624Time in the market (days) 21.2 34.1 33.1 142% of time in the market 15.27% 25.25% 25.24% 22.76%Avg. time in trades (days) 1.93 2.63 3.67 36Avg. time in trades (bars) 92 43 36 25Stock price at start of test 2.42 2.41 2.62 9.24Stock price at end of test 2.30 2.30 2.30 2.30

SYSTEM PARAM ETERS

FVE period 120 60 50 24FVE entry lower bound -20 -20 -20 -20FVE entry upper bound 10 10 10 10FVE exp. moving average period 40 40 40 40Linear regression period (bars) 20 20 20 20

Linear regression angle: entry (degrees) 30 30 30 30Linear regression angle: exit (degrees) -20 -20 -30 -30Closing price linear regression period (bars) 30 30 30 30Upper bound (%) 0.07 0.12 0.17 0.6Lower bound (%) -0.02 -0.04 -0.06 -0.2Time exit (bars) 150 90 70 50

CONCLUSION

You can increase the resolution of daily charts by using

intraday charts to detect major breakouts that develop in a very

short period of time and could not be spotted otherwise on the

daily charts. I found the most appropriate interval for major

breakouts to be the 60- or 30-minute interval. By increasing theresolution further to the five-minute interval, you could detect

most microbreakouts, with the adverse effect, however, of 

missing out on the major ones because of the unwanted noise.

The 15-minute interval was a good compromise that

could detect most major and some minor breakouts. Keep in

mind that there is no such thing as a perfect system. No

matter how good the system is, and however highly unlikely

the possibility of a loss is, it may happen to you, so it may

be a good idea to use a stop-loss condition.

 Markos Katsanos is a structural engineer and a private trader.

REFERENCES AND SUGGESTED READING

Harris, Michael [2002]. “Improve Your System With TheProfitability Rule,” Technical Analysis of STOCKS & COM-MODITIES, Volume 20: September.

Hinkle, D.E., W. Wiersma, and S.G Jurs [1998].  Applied Statistics For The Behavioral Sciences, Houghton-Mifflin.

Katsanos, Markos [2003]. “Detecting Breakouts,” Technical Analysis of STOCKS & COMMODITIES, Volume 21: April.

LeFèvre, Edwin [1994]. Reminiscences Of A Stock Operator ,John Wiley & Sons. Originally published in 1923.

Long, Erik [2003]. “Making Sense Of Fractals,” Technical Analysis of STOCKS & COMMODITIES, Volume 21: May.

Murphy, Joseph E. [1988]. Stock Market Probability, IrwinPublishing.

Parkinson, Michael [1980]. “The Extreme Value Method ForEstimating The Variance Of The Rate Of Return,” The Journal of Business 53:1, January.

S&C†See Traders’ Glossary for definition

Page 7: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 7/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

CINTRA(.1),CINTER(.1),Samples(22);Variables:

AlertFactor( 1 + AlertPct /100 ),

AlertStr( NumToStr( AlertPct, 2 ) ),INTRA(0),INTER(0),VINTRA(0),VINTER(0),CUTOFF(0),TP(0),TP1(0),MF(0);

TP=(High + Low + Close)/3;TP1=(H[1]+L[1]+C[1])/3;INTRA=LOG(High)-LOG(Low);VINTRA=StandardDev(INTRA,SAMPLES,1);INTER=LOG(TP)-LOG(TP1);VINTER=StandardDev(INTER,SAMPLES,1);CUTOFF=CINTRA*VINTRA+CINTER*VINTER;MF=(Close - (High + Low)/2)+ TP-TP1;

If BarType >= 2 then {i.e., not tick/minute data}BeginPlot1( Volume, “Vol” ) ;Plot2( AverageFC( Volume, AvgLength ),

“VolAvg” ) ;end

Else {if tick/minute data; in the case of minute data,also set the “For volume, use:” field in the FormatSymbol dialog to Trade Vol or Tick Count, as desired}

BeginPlot1( Ticks, “Vol” ) ;Plot2( AverageFC( Ticks, AvgLength ), “VolAvg”

) ;

End ;

{Color criteria}If MF>CutOff*close then

SetPlotColor( 1, UpColor )Else if MF<-1*CutOff*Close then

SetPlotColor( 1, DownColor )Else SetPlotColor( 1, NeutralColor );

{Alert criteria}If Plot1 crosses over Plot2 * AlertFactor then

Alert( “Volume breaking through “ + AlertStr + “%above its avg” ) ;

Green is used for up volume (MF>cutoff ), red for

down volume (MF<-Cutoff), and blue for neutral

(the stock is not moving at all or it is moving margin-

ally). It will also alert you on heavy volume (>70% of 

the 50-day average).

CINTRA and CINTER are the intra- and interday

volatility coefficients. Increasing or decreasing them

will result in more neutral (blue) bars.

SIDEBAR 1: TRADESTATION 7 CODE

1) Volatility-modified FVE formula:

Inputs:

Samples(22),PERMA(40),CINTRA(.1),CINTER(.1);Variables:TP(0),TP1(0),MF(0),VolumePlusMinus(0),FVE(0),

FVEsum(0),FveFactor(0),INTRA(0),INTER(0),VINTRA(0),VINTER(0),

CUTOFF(0);

TP=(High + Low + Close)/3;TP1=(H[1]+L[1]+C[1])/3;INTRA=Log(High)-LOG(Low);VINTRA=StandardDev(INTRA,SAMPLES,1);INTER=LOG(TP)-LOG(TP1);VINTER=StandardDev(INTER,SAMPLES,1);

CUTOFF=CINTRA*VINTRA+CINTER*VINTER;MF=(Close - (High + Low)/2)+ TP-TP1;If MF>CutOff*close then FveFactor=1Else if MF<-1*CutOff*Close then FveFactor=-1Else FveFactor=0;

If BarNumber > samples then beginVolumePlusMinus = Volume * FVEFactor;FVEsum = Summation(VolumePlusMinus,Samples);FVE=(FVEsum /(Average(Volume,Samples)*Samples))*100;

Plot1(Average(FVE,1),”FVE”);Plot2(XAverage(FVE,PERMA),”EMAFVE”);

Plot3(0,”0");

Alert (“FVE “);Condition1=FVE>-20 AND FVE<10 ;Condition2=FVE> XAVERAGE(FVE,PERMA);Condition3 =LinearRegANGLEFC(FVE,20)>30;If CONDITION1 AND CONDITION2 AND CONDI-TION3 then

alert(“FVE”);End;

The above code plots FVE and its 40-day exponential

moving average. It will also alert you if FVE crossesover -20 at a sharp angle (over 30o) and it is over its 30-

day EMA.

2) Volatility color-coded volume bar formula:

Inputs:AvgLength( 50 ),AlertPct( 70 ),UpColor( Green ),DownColor( Red ),NeutralColor(blue),

Page 8: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 8/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

After you verify the code and insert it into your

charts, select the volume bars, go to Format/Style, and

select Histogram.

3) FVE strategy

System-testing options:Fixed dollars per trade: $10,000Commissions: Entry $10, Exit: $10Positions: Longs onlyNumber of shares rounded to the nearest 10 shares

Inputs:Samples(50),FVEENTERL(-20),FVEENTERU(10),MA(40),LRPERIOD(20),BANGLE(30),SANGLE(-30),LRC(30),UB(.1),LB(-.05),BarToExitOn(70);

Variables:CINTRA(.1),CINTER(.1),TP(0),TP1(0),MF(0),CUTOFF(0),VolumePlusMinus(0),Fvesum(0),FveFactor(0),FVE(0),INTRA(0),INTER(0),VINTRA(0),VINTER(0);TP=(High + Low + Close)/3;TP1=(H[1]+L[1]+C[1])/3;INTRA=LOG(High)-LOG(Low);VINTRA=StandardDev(INTRA,SAMPLES);INTER=LOG(TP)-LOG(TP1);VINTER=StandardDev(INTER,SAMPLES);CUTOFF=CINTRA*VINTRA+CINTER*VINTER;

MF=(Close - (High + Low)/2)+ TP-TP1;If MF>CutOff*close then FveFactor=1Else if MF<-1*CutOff*Close then FveFactor=-1Else FveFactor=0;

if BarNumber> 2*Samples then beginVolumePlusMinus = Volume * FveFactor;FVEsum = Summation(VolumePlusMinus,Samples);FVE=(FVEsum / (Average(Volume,Samples)*Samples))*100;

Condition1=FVE>FVEENTERL ANDFVE<FVEENTERU ;Condition2=LinearRegANGLEFC(FVE,LRPERIOD)>BANGLE;Condition3=FVE> XAVERAGE(FVE,MA);Condition4 =LinearRegSlopeFC(C,LRC)<UB*LINEARREGVALUE(C,LRC,LRC-1)/100 ANDLinearRegSlopeFC(C,LRC )>LB*LINEARREGVALUE(C,LRC,LRC-1)/100;Condition5 =LinearRegANGLE(FVE,LRPERIOD)<SANGLE;

If MarketPosition = 0 AND Condition1 AND Condi-tion 2 AND Condition 3 AND Condition 4 then

Buy ( “BUY” ) THIS BAR ON CLOSE ;If condition5 then Sell (“FVE EXIT”) this bar ATCLOSE;If BarsSinceEntry = BarToExitOn then

Sell ( “TimeBarsLX” ) this bar AT CLOSE;End;

The period for calculating FVE was adjusted for

each time frame according to the values in the table

in Figure 1.

The stock price linear regression percentage boundswere also adjusted according to the square root of time

relationship. The final values can be found in Figure 7.

 —M.K.

Page 9: FVE Breakout Trading.pdf

7/27/2019 FVE Breakout Trading.pdf

http://slidepdf.com/reader/full/fve-breakout-tradingpdf 9/9

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 21:9 (44-55): Detecting Breakouts In Intraday Charts by Markos Katsanos

VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);VNEUT:=If(MF<CUTOFF AND MF>-CUTOFF ,V,0);VNEUT

3) System test

System-testing options:Initial capital: $10,000Commissions: Entry $10, exit: $10Entry price: Close, exit price: ClosePositions: Longs only

Enter Long:PERIOD:=24; COEF:=.1;INTRA:=Log(H)-Log(L);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));

VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);FVE:=Sum(If(MF>CUTOFF, +V,If(MF<-CUTOFF,-V,0)),PERIOD)

 /Mov(V,PERIOD,S)/PERIOD*100;FVE<10 AND FVE>-20 ANDLinRegSlope(FVE,20)>.58 ANDFVE>Mov(FVE,40,E) AND LinRegSlope(C,30)<Ref(C,-30) *.6/100 AND LinRegSlope(C,30)>-Ref(C,-30)*.3/100

Close Long:PERIOD:=24; COEF:=0.1;INTR:=Log(H)-Log(L);VINTRA:=Stdev(INTR,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);FVE:=Sum(If(MF>CUTOFF, +V, If(MF <-CUTOFF, -V,0)),PERIOD)/Mov(V,PERIOD,S)/PERIOD*100;LinRegSlope(FVE,20)<-0.58

SIDEBAR 2: M ETASTOCK 7. 2 CODE

1) Volatility-modified FVE formula:

PERIOD:= Input(“PERIOD FOR FVE”,5,80,22);COEF:=Input(“COEF FOR CUTOFF”,0,2,.1);

INTRA:=Log(H)-Log(L);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);FVE:=Sum(If(MF>CUTOFF, +V, If(MF <-CUTOFF, -V,0)),PERIOD)/Mov(V,PERIOD,S)/PERIOD*100;FVE

2) Volatility color-coded volume bar formula:

Since you can’t program colors in MetaStock code, I have

created three different indicators: one for up volume, one for

down volume, and a third for neutral volume.

Insert all three in the same inner window. Double-click-

ing on each will open its properties. Select Style/Histogram

for all and the color green, red, and blue for the up volume,

down volume, and neutral volume, respectively.

The formula for the up volume (green) is:

PERIOD:= Input(“PERIOD FOR FVE”,10,80,22);COEF:=Input(“COEF FOR CUTOFF”,0,2,.1);INTRA:=Log(H)-Log(L);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));

VINTER:=Stdev(INTER,PERIOD);CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);VPLUS:=If(MF>CUTOFF ,V,0);VPLUS

The formula for the down volume (red) is:

PERIOD:= Input(“PERIOD FOR FVE”,10,80,22);COEF:=Input(“COEF FOR CUTOFF”,0,2,.1);INTRA:=Log(H)-Log(L);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));VINTER:=Stdev(INTER,PERIOD);

CUTOFF:=COEF*(VINTER+VINTRA)*C;MF:=C-(H+L)/2+Typical()-Ref(Typical(),-1);VMINUS:=If(MF<-CUTOFF ,V,0);VMINUS

And the formula for the neutral volume (blue) is:

PERIOD:= Input(“PERIOD FOR SD”,10,80,22);COEF:=Input(“COEF FOR CUTOFF”,0,2,.1);INTRA:=Log(H)-Log(L);VINTRA:=Stdev(INTRA,PERIOD);INTER:=Log(Typical())-Log(Ref(Typical(),-1));

The parameters above are for the daily test only. For the intraday

tests, the FVE period and the linear regression percentages have

to be adjusted according to the values in Figure 7.

The Time exit stops could be adjusted by selecting Edit/ 

Stops/Inactivity and filling the period values by the corre-

sponding values in Figure 7. In MetaStock 8.0, this can be

done by adding:

Simulation.CurrentPositionAge>=50

at the end of the close long conditions.

The linear regression angle function is not available in

MetaStock 7.20, but this is not a problem, as it can be

substituted by the linear regression slope function, which is

of course the tangent of the linear regression angle.

 —M.K.