MetaStock Custom Indicators

5 35 5 MACD
Absolute Breadth Index
Advance/Decline Line with Negative Volume
Adaptive Moving Average, by Perry Kauffman
ADX/ADXR Custom (without rounding)
Arms Index (TRIN)
Aroon Indicators, by Tushar Chande
"Average-Modified Method", by Perry Kauffman
Bollinger Bands
Breadth Thrust
Candlecode
Candle Strength Index
Chande Momentum Oscillator Composite Average
Chande Momentum Oscillator Volatility
Chande's Momentum Oscillator
Chande's Trendscore
Changing Ways Accumulation/Distribution
Comparative Relative Strength in MetaStock for Windows
Confidence %
Coppock Curve
Daily Close vs High and Low Close
Detrended Price Oscillator
Disparity Index
Displaying the Price of a Security in 32nds and 64ths
Divergence between the Close and an Indicator
Dynamic Momentum Oscillator
Elliot Oscillator
End Point Moving Average
End Points of a Linear Regression Line with Standard Deviations
Gann High Low
Gann-Swing
Gann-Trend
Gap Identification
GRIIF1 Identification Oscillator
Hi Low Wave Daily
Historical Volatility Daily
Historical Volatility Weekly
Insync Index
Kurtosis Indicator
MACD Histogram
Market Facilitation Index
Market Facilitation Index Expert Advisor
Market Pressure - Ultimate
Market Thrust Oscillator
Martin Pring's KST Formulas
Mass Index
McClellan Oscillator
McClellan Summation Index
McGinley Dynamic
Modified VIX Indicator
Money Flow Index
Morris Double Momentum Oscillator
Moving Average of Only One Day of a the Week
Natenberg's Volatility
One Day Money Flow
Percent Above/Below Moving Average
Persistence of Money Flow
Plotting Alpha and Beta
Polarized Fractal Efficiency
Price Action Indicator (PAIN)
Price Oscillator Wave
Price Volume Rank
Price Volume Trend Stochastic
Random Walk Index
Rate of Change Since a Specific Date
Recursive Moving Trend Average
Regression Oscillator and the Slope/Close Indicator
Relative Strength Index (RSI) Custom
Relative Volatility Index (RVI)
R squared, Chande & Kroll's
Rule of 7 Oscillator
Short Volume Wave
Slope of a Line
Slope of a Linear Regression Line
Standard Error Bands for MetaStock for Windows
Special Trix
STIX Oscillator
Stochastic %D
Stochastic Relative Strength Index
Stochastic Wave Long
Stochastic Wave Short
Support and Resistance - Yoni
The New Advance Decline Line
Tick Line Momentum Oscillator
Trading Channel Index
Trending Bandini
Trendline Formula
True Strength Index
Tushar Chande's Target Price
Tushar Chande's Vidya with Volatility Bands
Volatility%
Volatility Difference
Volume Accumulation % Indicator
Volume Oscillator Wave
Weekly High Low Wave
Weekly Oscillator Segment
Weekly Price Oscillator
Wilder's Volatility

TASC Trader's Tips

Freeburg Precious Metal Switch Fund System
Rainbow Charts
Using Fibonacci Ratios and Momentum
Volatility % Indicator
Breaking out of Price Channels
Smoothing Techniques for more Accurate Signals
Anchored Momentum
Double Tops and Double Bottoms
Adaptive Moving Average
Automatic Support and Resistance
Mutated Variables, Volatility and a New Market Paradigm
Channel Analysis
A Volatility Trade in Gold
From Terms to Technical Tools
Simple Moving Average with Resistance and Support
"Combining Statistical and Pattern Analysis", Shark – 32
Better Bollinger Bands
Dynamic Multiple Time Frames
Sine-Wave Weighted Moving Average

MetaStock - 5 35 5 MACD

rev. 30/3/01

The 5,35,5 MACD is a variation of the standard 12,26,9 MACD and was made popular by Chris Manning, who uses it to identify major market divergence points:

((Mov( CLOSE, 5, E) - Mov( CLOSE, 35, E))-(Mov((Mov( CLOSE, 5, E) - Mov( CLOSE, 35, E)),5,E)))

When first plotted on a chart, the 5,35,5 MACD will appear as a solid line with no horizontal line at the value of zero (as shown in picture below).

After applying the 5 35 5 MACD indicator to your chart, use the following steps to create a histogram with vertical line at zero.

A) Double click the indicator to open the properties dialogue box.

B) Select the Color\Style tab and using the Style drop-down list, select the histogram setting (second from the bottom).

C) Select the Horizontal Lines tab and enter a value of zero (0) for the horizontal line value. Click Add.

D) Click OK (indicator will appear as per picture below)

MetaStock Formula - Absolute Breadth Index

rev. 01/06/97

The Absolute Breadth Index (ABI) is a market momentum indicator that was developed by Norman G. Fosback. The ABI shows how much activity, volatility, and change is taking place on the New York Stock Exchange while ignoring the direction prices are headed. You can think of the ABI as an "activity index". High readings indicate market activity and change, while low readings indicate lack of change. In Mr. Fosback's book, Stock Market Logic, he indicates that historically, high values typically lead to higher prices three to twelve months later.


The MetaStock™ formula for the Absolute Breadth Index is:

ABS ( Advancing Issues - Declining Issues )


To plot it:

MetaStock Formula - Advance Decline Line with Negative Volume

rev. 01/06/97

There is a way to get the negative volume on an advance-decline line chart in MetaStock™ for Windows™.

The requirement is: Each security must have both the number of issues and the volume in the file. Advancing issues with advancing volume in one security and declining issues with declining volume in one security file. These files may be obtained from Reuters Trend Data by way of The DownLoader for Windows. You will also need to create a composite security of the Advance-Decline line, which is the advances - declines.

The following steps will get you an advance-decline line with negative volume where applicable. Follow these steps once and save as a CHART. When you want to use it simply load the chart and the program will calculate the new volume plot using the new data.

This will be the chart you load to do your study of the advance-decline line with negative volume

MetaStock Formula - Adaptive Moving Average, by Perry Kaufman

rev. 01/06/97

This is a Metastock for Windows version 6.5 formula.

Periods := Input("Time Periods",1,1000, 10);

Direction := CLOSE - Ref(Close,-periods);

Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);

ER := Abs(Direction/Volatility);

FastSC := 2/(2 + 1);

SlowSC := 2/(30 + 1);

SSC := ER * (FastSC - SlowSC) + SlowSC;

Constant := Pwr(SSC,2);

AMA := If(Cum(1) = periods +1, ref(Close,-1) + constant * (CLOSE - ref(Close,-1)),Prev + constant * (CLOSE - PREV));

AMA

MetaStock Formula - ADX / ADXR Custom (without Rounding)

rev. 01/20/99

Here are custom ADX and ADXR formulas that will plot the decimals after the calculation. The built-in indicators plot exactly as Welles Wilder plots them in his book, New Concepts in Technical Trading Systems. These custom indicators calculate the same way except they do not round as Wilder does.


ADX Custom

Periods:=Input("Time Periods",1,100,14);
PlusDM:=If(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),If(H >Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)> Ref(L,-1)-L, H-Ref(H,-1),0));
PlusDI:=100*Wilders(PlusDM,Periods)/ATR(Periods);
MinusDM:=If(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,If(H>Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0));
MinusDI:=100*Wilders(MinusDM,Periods)/ATR(Periods) ;
DIDif:=Abs(PlusDI-MinusDI);
DISum:=PlusDI+MinusDI;
ADXFinal:=100*Wilders(DIDif/DISum,Periods);
ADXFinal


ADXR Custom

Periods:=Input("Time Periods",1,100,14);
PlusDM:=If(H>Ref(H,-1) AND L<=Ref(L,-1), H-Ref(H,-1),If(H>Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)>Ref(L,-1)-L, H-Ref(H,-1),0));
PlusDI:=100*Wilders(PlusDM,Periods)/ATR(Periods);
MinusDM:=If(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,If(H>Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0));
MinusDI:=100*Wilders(MinusDM,Periods)/ATR(Periods) ;
DIDif:=Abs(PlusDI-MinusDI);
DISum:=PlusDI+MinusDI;
ADXFinal:=100*Wilders(DIDif/DISum,Periods);
ADXRCustom:= (ADXFinal+Ref(ADXFinal,LastValue(1-periods)))/2;
ADXRCustom

MetaStock Formula - Arms Index (TRIN)

rev. 01/06/97

The Arms Index, also known as TRIN, is a market indicator that shows the relationship between the number of stocks that increase or decrease in price (advancing/declining issues) and the volume associated with stocks that increase or decrease in price (advancing/declining volume). The Arms Index was developed by Richard W. Arms, Jr. in 1967.

The Arms Index is primarily a short term trading tool. The Index shows whether volume is flowing into advancing or declining stocks. If more volume is associated with advancing stocks than declining stocks, the Arms Index will be less than 1.0; if more volume is associated with declining stocks, the Index will be greater than 1.0.

The formula for the Arms Index is:

(Advancing Issues / Declining Issues) / (Advancing Volume / Declining Volume)


To calculate the Arms Index in MetaStock™ for Windows you will need to first collect the four pieces of data.

After the data has been collected follow these steps:

For data from RTD or Dial Data

For data from CompuServe

You will know have the Arms Index (TRIN) plotted. You can drag it to its own inner window if you prefer.

MetaStock Formula - Aroon Indicators, by Tushar Chande

rev. 01/06/97

For interpretation of the Aroon indicators refer to Tushar Chande's article "Time Price Oscillator" in the September, 95 Technical Analysis of Stocks & Commodities magazine.


The Aroon down:

100* (14 - (( If (Ref (L,-1) = LLV( L ,14 ) ,1 , If ( Ref (L ,-2 ) = LLV ( L,14 ) ,2 , If ( Ref (L ,- 3 ) =

LLV( L,14 ) ,3 ,If ( Ref (L ,-4 ) = LLV ( L ,14 ) ,4 ,If (Ref ( L ,-5 ) = LLV ( L ,14 ) ,5 ,If (Ref (L ,-6 ) =

LLV( L,14 ) ,6 ,If ( Ref (L ,-7 ) = LLV ( L,14 ) ,7 ,If (Ref ( L ,-8 ) = LLV ( L ,14 ) ,8 ,If (Ref( L ,-9 ) =

LLV( L,14 ) ,9 ,If ( Ref (L,-10) = LLV (L,14 ) ,10 ,If (Ref (L ,-11) = LLV( L,14 ) ,11 ,If (Ref(L,-12 ) =

LLV(L ,14) ,12,If ( Ref (L,-13) = LLV (L ,14 ) ,13 ,If ( Ref ( L,-14) = LLV( L,14 ) ,14 ,0) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) / 14


The Aroon up:

100 * ( 14 - ( ( If (Ref (H ,-1) = HHV(H ,14 ) ,1 ,If (Ref (H ,-2 ) = HHV (H ,14 ) ,2 ,If (Ref (H ,- 3 ) =

HHV(H ,14 ) ,3, If (Ref (H ,-4 ) = HHV(H ,14 ) ,4 ,If (Ref (H ,-5 ) = HHV(H ,14 ) ,5 ,If (Ref (H ,-6 ) =

HHV(H ,14 ) ,6 ,If (Ref (H,-7 ) = HHV(H ,14 ) ,7 ,If (Ref (H ,-8 ) = HHV(H ,14) ,8 , If (Ref (H ,-9 ) =

HHV(H ,14) ,9 ,If (Ref (H ,-10 ) = HHV(H ,14 ) ,10 ,If (Ref (H ,-11 ) = HHV(H ,14) ,11 ,If (Ref (H ,-12 ) =

HHV(H ,14) ,12 ,If (Ref(H ,-13) = HHV(H ,14 ) ,13 ,If (Ref (H ,-14 ) = HHV(H ,14 ) ,14 ,0 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) / 14


The Aroon Oscillator = Aroon up - Aroon down.

** The UP and DOWN Aroon indicators are to be plotted in the same inner-window.

** These are constructed using 14 time periods, you can alter this by replacing every entry of 14 with the desired time period.

Note: The Aroon indicators are built in indicators, in MetaStock 6.0 for Windows.

MetaStock Formula - Average Modified Method by Perry Kaufman

rev. 10/27/97

From The New Commodity Trading Systems and Methods, by Perry J. Kaufman

Chapter 4 - Moving Averages, pg. 60.

This formula is for version 6.5 of MetaStock for Windows 95 & NT only and cannot be written in previous version.

This is a modified simple moving average.

The formula will prompt you for input for the number of time periods to use in the moving average.

Day:=Cum(1)+1;

Z:=Input("Periods",2,1000,5);

MV:=(1/Z);

If(Day<(Z+2),C,If(day=(Z+2),Mov(C,LastValue(Z),S),PREV+(MV*(C-PREV))))

MetaStock Formula - Bollinger Bands

rev. 01/06/97

"Trading bands are one of the most powerful concepts available to the technically based investor, but they do not, as is commonly believed, give absolute buy and sell signals based on price touching the bands. What they do is answer the perennial question of whether prices are high or low on a relative basis. Armed with this information, an intelligent investor can make buy and sell decisions by using indicators to confirm price action.

But before we begin, we need a definition of what we are dealing with. Trading bands are lines plotted in and around the price structure to form an ''envelope". It is the action of prices near the edges of the envelope that we are particularly interested in…."

Taken from Stocks & Commodities, V. 10:2 (47-51): Using Bollinger Bands by John Bollinger

For further interpretation refer to the above article found in the February 1992 issue of Technical Analysis of Stocks and Commodities.

Bollinger Bands are built into MetaStock™, however you may prefer to use the individual custom formulas.

The custom formulas for the components of the Bollinger Bands are as follows:

Upper Band:
mov( C,20,S ) + ( 2 * ( std( C,20 ) ) )

Lower Band:
mov( C,20,S ) - ( 2 * ( std( C,20 ) ) )

Middle Band:
mov( C,20,S )

%B :
( ( C+2 * std( C,20 ) - mov( C,20,S ) ) / ( 4 * std( C,20 ) ) ) * 100

Band width :
( ( mov( C,20,S) + ( 2 * ( std( C,20 ) ) ) )- ( mov( C,20,S) - ( 2 * ( std( C,20 ) ) ) ) )
/ mov( C,20,S)

MetaStock Formula - Breadth Thrust

rev. 01/06/97

The Breadth Thrust indicator is a market momentum indicator developed by Dr. Martin Zweig. The Breadth Thrust is calculated by taking a 10-day exponential moving average of the advancing issues divided by the advancing plus declining issues.

According to Dr. Zweig a Breadth Thrust occurs when, during a 10-day period, the Breadth Thrust indicator rises from below 40 percent to above 61.5 percent. A "Thrust" indicates that the stock market has rapidly changed from an oversold condition to one of strength, but has not yet become overbought.

Dr. Zweig also points out that there have only been 14 Breadth Thrusts since 1945. The average gain following these 14 Thrusts was 24.6 percent in an average time frame of 11 months. Dr. Zweig also points out that most bull markets begin with a Breadth Thrust.


To plot the Market Breadth in MetaStock™ for Windows you will need to:

MetaStock Formula - Candlecode

Bdy:=Abs(O-C);
Lshd:=If(C>=O,O-L,C-L);
Ushd:=If(C>=O,H-C,H-O);
ThBotB:=BBandBot(Bdy,55,E,0.5);
ThTopB:=BBandTop(Bdy,55,E,0.5);
ThBotL:=BBandBot(Lshd,55,E,0.5);
ThTopL:=BBandTop(Lshd,55,E,0.5);
ThBotU:=BBandBot(Ushd,55,E,0.5);
ThTopU:=BBandTop(Ushd,55,E,0.5);
CCode:=If(C=O,1,0)*If(Ushd>=Lshd,64,48)+If(C=O,0,1)*(If(C>O,1,0)*(If(Bdy<=ThBotB,80,0)+If(Bdy>ThBotB AND Bdy<=ThTopB,96,0)+ If(Bdy>ThTopB,112,0))+ If(C<O,1,0)*(If(Bdy<=ThBotB,32,0)+ If(Bdy>ThBotB AND Bdy<=ThTopB,16,0)))+(If(Lshd=0,3,0)+ If(Lshd<ThBotL AND Lshd>0,2,0)+ If(Lshd>ThBotL AND Lshd<=ThTopL AND Lshd>0,1,0))+(If(Ushd>0 AND Ushd<=ThBotU,4,0)+ If(Ushd>ThbotU AND Ushd<=ThTopU,8,0)+ If(Ushd>ThTopU,12,0));
CCode;

MetaStock Formula - Candle Strength Index

Periods:=Input("Enter Periods",2,13,2);
Mov(Mov(Mov(Fml("Candlecode"),Periods,S),Periods,S),Periods,S)

MetaStock Formula - Chande Momentum Oscillator Composite Average

(((CMO(C,5))+(CMO(C,10))+(CMO(C,20)))/3)

MetaStock Formula - Chande Momentum Oscillator Volatility

S1:= Stdev( CMO(C,5),5);
S2:= Stdev(CMO(C,10),10);
S3:= Stdev(CMO(C,20),20);
CMOV:=(S1*CMO(C,5))+(S2*CMO(C,10))+(S3*CMO(C,20))/(S1+S2+S3);
CMOV;

MetaStock Formula - Chande's Momentum Oscillator

rev. 01/06/97

The following are MetaStock formulas for Tuschar Chande's Momentum Oscillator. For interpretation refer to the book The New Technical Trader, by Tuschar Chande and Stanley Kroll.

CMO_1
Sum( If( C ,> ,Ref( C, -1 ) , ( C - Ref( C ,-1 ) ) ,0 ) ,14 )

CMO_2
Sum( If( C ,< ,Ref( C ,-1 ) , ( Ref( C ,-1 ) - C ) ) ,0 ) ,14 )

CMO_Final
100 * ( ( Fml( "CMO_1" ) - Fml( "CMO_2" ) ) / ( Fml( "CMO_1" ) + Fml( "CMO_2" ) ) )


You could also combine the above three formulas into one formula. The syntax would be:

100*((Sum(If(C,>,Ref(C,-1),(C-Ref(C,-1)),0),14))-(Sum(If(C,<,REF(C,-1),(REF(C,-1)-C),0),14))) /((Sum(If(C,>,Ref(C,-1),(C-Ref(C,-1)),0),14)+(Sum(If(C,<,REF(C,-1),(REF(C,-1)-C),0),14))))

*** These formulas were constructed using 14 time periods, you can change this by replacing every occurrence of 14 with your desired time period value.

MetaStock Formula - Chande's Trendscore

If(C>=Ref(C,-11),1,-1)+If(C>=Ref(C,-12),1,-1)+If(C>=Ref(C,-13),1,-1)+
If(C>=Ref(C,-14),1,-1)+If(C>=Ref(C,-15),1,-1)+If(C>=Ref(C,-16),1,-1)+
If(C>=Ref(C,-17),1,-1)+If(C>=Ref(C,-18),1,-1)+If(C>=Ref(C,-19),1,-1)+
If(C>=Ref(C,-20),1,-1)

MetaStock Indicator - Changing Ways Accumulation/Distribution

Cum(If(Fml( "Todays Change" ) > Mov(Fml( "Todays Change" ),7,E) AND C > Ref(C,-1),
C + V,
If(Fml( "Todays Change" ) < Mov(Fml( "Todays Change" ),7,E) AND C < Ref(C,-1),
Neg(C + V) ,0)))

Where Fml( "Todays Change" ) = c - ref(c,-1)

Comparitive Relative Strength in MetaStock™ for Windows

rev. 01/06/97

Comparative Relative Strength charts can be useful in deciding which security to buy, by helping to pinpoint the best performer. They can also be useful in developing spreads, i.e., purchase of the best performer "long", and selling the weaker issues "short." Comparative Relative Strength can be applied in MetaStock for Windows as follows:


Creation of a Template for Comparative Relative Strength

(For this illustration, we assume an equity/stock is compared to the S&P 500, both of which must first have been collected from your vendor. Both data files should be in the same periodicity.)

  1. Load the S&P 500.
  2. Load the equity, or whatever you wish to find the relative strength for.
  3. Drag the S&P 500 plot into a new inner window of the equity. (You may need to click Stack first.)
  4. Close the S&P 500 chart.
  5. Create a custom indicator: Div(close, p)
  6. Drag the custom indicator into the inner window containing the S&P 500 plot, moving it over the plot until the plot changes to a pink or lavender color, then release your mouse button. (This is called dragging and dropping an indicator on an indicator. The new indicator will plot in the same window as the S&P 500 plot.) You have two options here:
  7. Save this chart as a Template. (File|Save As, set "Save File As Type" to Template, and give it a name, such as CMPRELST.MWT.)

Any time you want to see Comparative Relative Strength of an equity against the S&P 500, apply this template to the equity's chart. Note: if you should move the data file against which you are comparing, such as the S&P 500, this template will no longer work, and would have to be recreated.


To Run an Exploration Using Comparative Relative Strength

  1. Load the S&P 500 (or whatever you want to compare against).
  2. Create a custom indicator of the Close.
  3. Drag and drop this indicator on the S&P 500 (or whatever...). (Note: the S&P 500 plot must change to pink/lavender color before you drop it.) The indicator will plot.
  4. Select the indicator plot (by single-clicking with the left mouse button on the line).
  5. Do an Exploration with DIV(Close,p) in column A, and specify which directory to explore.
  6. The results are displayed in the Exploration report.

(P is a special variable that points at the last indicator plotted or selected.)

MetaStock Formula - Confidence %

(Sum(Mov(C * (2.5/ Sqrt(50 * V)),10,S)-
LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3 ) /
Sum(HHV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5) -
LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3) ) * 100

MetaStock Indicator - Coppock Curve

rev. 01/06/97

The Coppock Curve was developed by Edwin Sedgwick Coppock in 1962. It was featured in the November 94 issue of Technical Analysis of Stocks & Commodities, in the article "The Coppock Curve", written by Elliot Middleton.:

Taken from Stocks & Commodities, V. 12:11 (459-462): The Coppock Curve by Elliott Middleton

"We are creatures of habit. We judge the world relative to what we have experienced. If we're shopping for a mortgage and rates have been in the teens (as they were in the early 1980s) and then drop to 10%, we are elated. If, however, they've been at 8% and then rise to 10%, we are disappointed. It all depends on your perspective.

The principle of adaptation-level applies to how we judge our income levels, stock prices and virtually every other variable in our lives. Psychologically, relativity prevails..


SIMPLEST FORMS

The moving average is the simplest form of adaptation-level. Moving average crossover rules accurately signal the onset of periods of returns outside the norm, whether positive or negative. This makes moving average crossovers useful to traders who want to get a boost on entering or exiting stocks or funds.

The oscillator is also based on adaptation-level, although in a slightly different way. Oscillators generally begin by calculating a percentage change of current price from some previous price, where the previous price is the adaptation-level or reference point. The mind is attuned to percentage changes because they represent returns. If you bought Microsoft Corp. stock (MSFT) at $50 and it goes to $80, you make 60% before dividends. If you bought Berkshire Hathaway (BRK) at $4,000 and it rises to $4,030, the same dollar gain, you make 0.75% before dividends. It's the percentage change that counts. Relativity again.

Coppock reasoned that the market's emotional state could be determined by adding up the percentage changes over the recent past to get a sense of the market's momentum  (and oscillators are generally momentum indicators ). So if we compare prices relative to a year ago - which happens to be the most common interval - and we see that this month the market is up 15% over a year ago, last month it was up 12.5% over a year ago, and 10%, 7.5% and 5%, respectively, the months before that, then we may judge that the market is gaining momentum and, like a trader watching for the upward crossover of the moving average, we may jump into the market."

The MetaStock™ formula for the Coppock Curve is:

(MOV(ROC(MOV(C,22,S),250,%),150,E))/100

MetaStock Indicator - Daily Close vs. High and Low Close

if((C-L)/(H-L),>,.66 ,1, if((C-L)/(H-L),<,.38,-1,0))

MetaStock Indicator - Detrended Price Oscillator

rev. 01/06/97

The Detrended Price Oscillator (DPO) is an indicator that attempts to eliminate the trend in prices. Detrended prices allow you to more easily identify cycles and overbought/oversold levels. Here is the MetaStock custom formula for the DPO:

Close-Ref( Mov(Close, X, Simple ), T)

***where X is the number of Time Periods for the Oscillator and T = X / 2 + 1.


For example, a 20 period DPO would be:

X = 20
T = (20/2 + 1) = 11
Close-Ref( Mov(Close, 20, Simple),11)

MetaStock Indicator - Disparity Index

rev. 01/06/97

Steve Nison refers to the his Disparity Index "as a percentage display of the latest close to a chosen moving average". This can be defined in MetaStock using the formula:

( ( C - Mov( C ,X ,? ) ) / Mov( C ,X ,? ) ) * 100

** where X is the number of time periods and ? is the calculation type of the moving average.


For example:

( ( C - Mov( C ,13,E ) ) / Mov( C ,13 ,E ) ) * 100

** where X = 13 time periods and ? = Exponential moving average.

MetaStock Indicator - Displaying the Price of a Security in 32nds and 64ths

rev. 01/06/97

All versions of MetaStock prior to our Windows software would need this formula.

You can display your security's prices in 32nds and 64ths, by using the following custom formulas. Once plotted these values will be displayed in the indicator window.


For 32nds:

INT( C ) + ( ( FRAC( C ) / .03125 ) / 100 )


For 64ths:

INT( C ) + ( ( FRAC( C ) / .015625 ) / 100 )


**Where C is for the security's closing price and can be replaced with O, H, or L for the open, high, or low price instead.

MetaStock Indicator - Divergence Between the Close and an Indicator

Rev. 03/18/97

The following formula will calculate the correlation of the Close and the MACD. It is written using a "long form" MACD so that the time periods used by the MACD may be changed. This indicator shows "divergence" between the close and the indicator:


In the Windows versions of MetaStock the formula is:

Correl(((Sum(Cum(1)*(Mov(C,12,E)-Mov(C,26,E)),100))-(Sum(Cum(1),100)*
Sum((Mov(C,12,E)-Mov(C,26,E)),100)/100))/((Sum(Power(Cum(1),2),100))-
(Power(Sum(Cum(1),100),2)/100)),((Sum(Cum(1)*C,100))-(Sum(Cum(1),100)*
Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))-(Power(Sum(Cum(1),100),2)/100)),12,0)

The interpretation of the indicator output is as follows:
- .08 (80%) and lower is divergence between the Close and the MACD.
- 1 is very strong divergence.
+ 1 is very strong correlation.

The formula was constructed this way so that most other indicators may be used in place of the MACD.


For example here is the same indicator using the RSI(14):

Correl(((Sum(Cum(1)*(RSI(14)),100))-(Sum(Cum(1),100)*
Sum((RSI(14)),100)/100))/((Sum(Power(Cum(1),2),100))-(Power(Sum(Cum(1),100),2)/100)),
((Sum(Cum(1)*C,100))-(Sum(Cum(1),100)*Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))-
(Power(Sum(Cum(1),100),2)/100)),12,0)

MetaStock Indicator - Dynamic Momentum Oscillator

rev. 01/06/97

In July 1996 Futures magazine, E. Marshall Wall introduces the Dynamic Momentum Oscillator (Dynamo). Please refer to this article for interpretation.

He describes the Dynamo Oscillator to be:

Dynamo = Mc - ( MAo - O )

where
Mc = the midpoint of the oscillator
MAo = a moving average of the oscillator
O = the oscillator


This concept can be applied to most any oscillator to improve its results.


For example:

Applying the Dynamo Oscillator to a 5-period %K slowed 3 periods Stochastic Oscillator would give:

50-(Mov(Stoch(5,3),21,S)-Stoch(5,3))

where:
Mc = Stochastic Oscillator's midpoint = 50
MAo = Moving average of the Stochastic = Mov(Stoch(5,3),21,S
O = Stochastic Oscillator = Stoch(5,3)


This example applies it to an RSI oscillator:

50-(Mov(RSI(14),21,S)-RSI(14))

where:
Mc = RSI's midpoint = 50
MAo = Moving average of the RSI = Mov(RSI(14),21,S
O= RSI Oscillator = RSI(14)

MetaStock Indicator - Elliot Oscillator

Mov((H+L)/2,5,S)-Mov((H+L)/2,34,S)

MetaStock Indicator - End Point Moving Average

rev. 01/06/97

The End Point Moving Average was introduced in the October 95 issue of Technical Analysis of Stocks & Commodities in the article "The End Point Moving Average", by Patrick E. Lafferty. The exact formula for the End Point Moving average is as follows:

( 14 * Sum( Cum( 1 ) * C,14 ) - Sum( Cum( 1 ),14) * Sum( C,14) ) / (14 * Sum( Pwr( Cum( 1 ),2),14 ) - Pwr( Sum( Cum( 1 ),14 ),2 ) ) * Cum( 1 ) + (Mov(C,14,S) - Mov( Cum( 1 ),14,S) * (14 * Sum( Cum( 1 ) * C,14) - Sum( Cum( 1 ),14 ) * Sum( C,14) ) / (14 * Sum( Pwr( Cum( 1 ),2 ),14) - Pwr( Sum( Cum( 1 ),14 ),2 ) ) )

The above formula plots the last value of a linear regression line of the previous 14 periods. The Time Series Forecast takes this value and the slope of the regression line to forecast the next day and then plots this forecasted price as today's value.

***Please note the above formula is using 14 regression periods. If you desire to use different time periods you must change all instances of the number 14 to the desired number of time periods.

For interpretation refer to Mr. Lafferty's article.

MetaStock Indicator - End Points of a Linear Regression with Standard Deviations

rev. 01/06/97

In MetaStock 5.x for Windows there is a way to plot the end points of a linear regression line with channels +/- 2 Standard Deviations.

Here are the three formulas:

*Linear Regression (14):
(14 * Sum(Cum(1) * C,14) - Sum(Cum(1),14)* Sum(C,14)) /(14 * Sum(Pwr(Cum(1),2),14) - Pwr(Sum(Cum(1),14),2)) * Cum(1) + (Mov(C,14,S) - Mov(Cum(1),14,S) * (14 * Sum(Cum(1) * C,14) - Sum(Cum(1),14) * Sum(C,14))/(14 * Sum(Pwr(Cum(1),2),14) - Pwr(Sum(Cum(1),14),2)))
*Linear Regression Lower Band:
Fml( "*Linear Regression (14)" ) - 2* Stdev( Fml( "*Linear Regression (14)" ) ,14)
*Linear Regression Upper:
Fml( "*Linear Regression (14)" ) + 2* Stdev( Fml( "*Linear Regression (14)" ) ,14)

MetaStock Indicator - Gann High Low

HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),
{then}1,
{else}If(CLOSE<Ref(Mov(L,3,S),-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}Mov(H,3,S),
{else}Mov(L,3,S));
HiLo;

MetaStock Indicator - Gann Swing

Us:=BarsSince((H > Ref(H,-1)) AND (Ref(H,-1) > Ref(H,-2)));
Ds:=BarsSince((L < Ref(L,-1)) AND (Ref(L,-1) < Ref(L,-2)));
Sd1:=If(Us=0,
{then}If(Ref(L,-1)<>LowestSince(1,Ds=0,L),
{then}1,
{else}0),
{else}If(Ds=0,
{then}If(Ref(H,-1)<>HighestSince(1,Us=0,H),
{then}-1,
{else}0),
{else}0));
Sd2:=If(Sd1=1,
{then} If(Ref(BarsSince(Sd1=1),-1) > Ref(BarsSince(Sd1=-1),-1),
{then}1,
{else}0),
{else} If(Sd1=-1,
{then}If(Ref(BarsSince(Sd1=1),-1) < Ref(BarsSince(Sd1=-1),-1),
{then}-1,
{else}0),
{else}0));
TD1:=ValueWhen(1,Sd2<>0,Sd2);
Td1;

MetaStock Indicator - Gann Trend

{Swing Direction}
Sd:= FmlVar("GANN-Swing","TD1") ;
{Swing Change High}
Sch:=If(Sd=1 AND Ref(sd,-1)=-1,
{then}1,
{else}0);
{Swing Change Low}
Scl:=If(Sd=-1 AND Ref(Sd,-1)=1,
{then}1,
{else}0);
{Peak Value}
Pv:=If(Scl=1,
{then}HighestSince(1,Sch=1,H),
{else}0);
{Trough Value}
Tv:=If(Sch=1,
{then}LowestSince(1,Scl=1,L),
{else}0);
{Trend Direction}

Td:=If(H>ValueWhen(1,Pv>0,Pv),
{then}1,
{else}If(L<ValueWhen(1,Tv>0,Tv),
{then}-1,
{else}0));
{UpTrend=1 DownTrend =-1}
Tdv:=ValueWhen(1,Td<>0,Td);
Tdv;

MetaStock Indicator - Gap Identification

if(L,>,ref(H,-1),1, if(H,<,ref(L,-1),-1,0))

MetaStock Indicator - GRIIF1 Identification Oscillator

GRIIF1 Momentum Oscillator
tsf(C,9)-ref(tsf(C,9),-1)

GRIIF2 Momentum Oscillator
(ref(tsf(C,9),-1)-(ref(tsf(C,9),-2)))

GRIIF3 Momentum Oscillator
(ref(tsf(C,9),-2)-(ref(tsf(C,9),-3)))

GRII4 Momentum Oscillator
(tsf(C,9)-ref(tsf(C,9),-1))+((ref(tsf(C,9),-1)-ref(tsf(C,9),-2)))+((ref(tsf (C,9),-2)-(ref(tsf(C,9),-3))))

MetaStock Indicator - Hi Low Wave Daily

if(H,>,ref(hhv(H,100),-1),1,if(L,<,ref(llv(L,100),-1),-1,0))

MetaStock Indicator - Historical Volatility Daily

rev. 01/21/97

With MetaStock™ for Windows, you can easily plot the 10 and 100 day Historical Volatility. First use the Indicator Builder to enter the following Custom indicators:

Historical Volatility 10 day
Std(Log(C/Ref(C,-1)),10)*Sqrt(365)*100
Historical Volatility 100 day
Std(Log(C/Ref(C,-1)),100)*Sqrt(365)*100

Next plot both indicators in the same inner window. If the Scaling Options dialog appears, choose the Merge with Scale on Right (or left) option.

I find it easier to see the Historical Volatility signals by combining the 10 and 100 day indicators into the following indicator.

Historical Volatility Indicator
Std(Log(C/Ref(C,-1)),10)/Std(Log(C/Ref(C,-1)),100)

Plot this indicator in MetaStock for Windows, then click your mouse button on the indicator. Choose Historical Volatility Indicator Properties and then choose the Horizontal Lines page. Add a horizontal line at .5 and then choose the OK button. You now know the 10 period volatility is less than half the 100 period volatility anytime this indicator crosses below its horizontal line.

To test trading systems using this indicator it would he helpful to use the alert function along with a trend following indicator, such as the following example:

Enter Long: Cross(CLOSE,Mov(C,20,E)) AND Alert(Fml("Historical Volatility Indicator")<=5,10)

Enter Short: Cross(Mov(C,20,E),CLOSE) AND Alert(Fml("Historical Volatility Indicator")<=5,10)

This system will enter a long trade when the close has crossed above its 20 day moving average, and when Historical Volatility Indicator was .5 or lower within the last 10 days. The system will sell when the close crosses below its 20 day moving average, and when Historical Volatility Indicator was .5 or lower within the last 10 days. Use any indicator you would like, this just provides a basic example of how to use this indicator in a system test.

MetaStock Indicator - Historical Volatility Weekly

rev. 01/21/97

With MetaStock™ for Windows, you can easily plot the 10 and 100 week Historical Volatility. First use the Indicator Builder to enter the following Custom indicators:

Historical Volatility 10 week
Std(Log(C/Ref(C,-1)),10)*Sqrt(365/7)*100
Historical Volatility 100 week
Std(Log(C/Ref(C,-l)),100)*Sqrt(365/7)*100

Next plot both indicators in the same inner window. If the Scaling Options dialog appears, choose the Merge with Scale on Right (or left) option.

I find it easier to see the Historical Volatility signals by combining the 10 and 100 week indicators into the following indicator.

Historical Volatility Indicator
Std(Log(C/Ref(C,-1)),10)/Std(Log(C/Ref(C,-1)),100)

Plot this indicator in MetaStock for Windows, then click your mouse button on the indicator. Choose Historical Volatility Indicator Properties and then choose the Horizontal Lines page. Add a horizontal line at .5 and then choose the OK button. You now know the 10 period volatility is less than half the 100 period volatility anytime this indicator crosses below its horizontal line.

To test trading systems using this indicator it would he helpful to use the alert function along with a trend following indicator, such as the following example:

Enter Long: Cross(CLOSE,Mov(C,20,E)) AND Alert(FmI("Historical Volatility Indicator")<=5,10)

Enter Short: Cross(Mov(C,20,E),CLOSE) AND Alert(Fml("Historical Volatility Indicator")<=5,10)

This system will enter a long trade when the close has crossed above its 20 week moving average, and when Historical Volatility Indicator was .5 or lower within the last 10 weeks. The system will sell when the close crosses below its 20 week moving average, and when Historical Volatility Indicator was .5 or lower within the last 10 weeks. Use any indicator you would like, this just provides a basic example of how to use this indicator in a system test.

MetaStock Indicator - Insync Index

rev. 01/06/97

The interpretation for the following formulas came from the article "The Insync Index", by Norm North, in Technical Analysis of Stocks & Commodities Jan 1995.

All of these formulas are necessary for the last one, Insync Index to run properly. They are listed in the order in which they should be copied and pasted into the MetaStock Formula Builder

BOLInSLB
Mov( C ,20 ,S ) - 2 * ( Std( C ,20 ) )

BOLInSUB
Mov( C ,20 ,S ) + 2 * ( Std( C ,20 ) )

BOLInS2
( C - Fml( "BOLInSLB" ) ) / ( Fml( "BOLInSUB" ) - Fml( "BOLInSLB" ) )

BOLInSLL
If( Fml( "BOLInS2" ) ,< , .05 ,-5 ,If( Fml( "BOLInS2" ) ,> ,.95 ,5 ,0 ) )

CCIInS
If( CCI(14 ) ,> ,100 ,5 ,If ( CCI(14 ) ,< ,-100 ,-5 ,0 ) )

EMVInS2
EMV(10 ,S ) - Mov( EMV(10 ,S) ,10 ,S )

EMVInSB
If( Fml( "EMVInS2" ) ,< ,0 ,If( Mov( EMV(10 ,S ) ,10 ,S ) ,< ,0 ,-5 ,0 ) ,0 )

EMVInSS
If( Fml( "EMVInS2" ) ,> ,0 ,If( Mov( EMV(10 ,S ) ,10 ,S ) ,> ,0 ,5 ,0 ) ,0 )

MACDInS2
MACD( ) - Mov( MACD( ) ,10 ,S )

MACDinSB
If( Fml( "MACDInS2" ) ,< ,0 ,If( Mov( MACD( ) ,10 ,S ) ,< ,0 ,-5 ,0 ) ,0 )

MACDInSS
If( Fml( "MACDInS2" ) ,> ,0 ,If( Mov( MACD( ) ,10 ,S) ,> ,0 ,5 ,0 ) ,0 )

MFIInS
If( MFI( 20 ) ,> ,80 ,5 , If( MFI( 20 ) ,< ,20 ,-5 ,0 ) )

PDOInS2
DPO( 18 ) - Mov( DPO( 18 ) ,10 ,S )

PDOInSB
If( Fml( "PDOInS2" ) ,< ,0 ,If( Mov( DPO( 18 ) ,10 , S) ,< ,0 ,-5 ,0 ) ,0 )

PDOInSS
If( Fml( "PDOInS2" ) ,> ,0 ,If( Mov( DPO ( 18 ) ,10 ,S) ,> ,0 ,5 ,0 ) ,0 )

ROCInS2
ROC( C ,10 ,$ ) - Mov( ROC( C ,10 ,$ ) ,10 ,S )

ROCInSB
If( Fml( "ROCInS2" ) ,< ,0 ,If( Mov( ROC( C ,10 ,$ ) ,10 ,S ) ,< ,0 ,-5 ,0 ) ,0 )

ROCInSS Index
If( Fml( "ROCInS2" ) ,> ,0 ,If( Mov( ROC( C ,10 ,$ ) ,10 ,S ) ,> ,0 ,5 ,0 ) ,0 )

RSIInS
If( RSI(14 ) ,> ,70 ,5 ,If( RSI(14 ), < ,30 ,-5 ,0 ) )

STO%dInS
If( Stoch(14 ,3 ) ,> ,80 ,5 ,If( Stoch(14 ,3 ) ,< ,20 ,-5 ,0 ) )

STO%kInS
If( Stoch(14 ,1) ,> ,80 ,5 ,If( Stoch(14 ,1 ) ,< ,20 ,-5 ,0 ) )

InSync Index
50 + Fml( "CCIInS" ) + Fml( "BOLInSLL" ) + Fml( "RSIInS" ) + Fml( "STO%kInS " ) + Fml( "STO%dInS" ) + Fml( "MFIInS" ) + Fml( "EMVInSB" ) + Fml( "EMVInSS" ) + Fml( "ROCInSS" ) + Fml( "ROCInSB" ) + Ref (Fml( "PDOInSS" ) ,-10 ) + Ref (Fml( "PDOInSB" ) ,-10 ) + Fml( "MACDInS S" ) + Fml( "MACDInSB" )

These formulas were provided by Barry Millman. All questions should be addressed to him at 73374.1364@Compuserve.com.

Mr. Millman wrote these formulas using many Custom Formula slots for clarity and ease of understanding. Please note that the final formula 'InSync Index' requires all of the previous formulas to be correct.

MetaStock - Kurtosis Indicator

rev. 01/06/97

The Kurtosis is a market sentiment indicator. The MetaStock formula for the Kurtosis is as follows:

Mov(Mov(Mo(3)-Ref(Mo(3),-1),66,E),3,S)

The Kurtosis is constructed from three different parts. The Kurtosis, the Fast Kurtosis(FK), and the Fast/Slow Kurtosis(FSK).

The Kurtosis(K) portion of this calculation is mo(3)-ref(mo(3),-1). Which is today's Kurtosis - yesterday's Kurtosis.

The Fast Kurtosis(FK) is mov(K,66,E) mov(mo(3)-ref(mo(3),-1,66,E). Which is the Kurtosis smoothed with a 66 period exponential moving average.

The Fast/Slow Kurtosis(FSK) is the complete formula mov(mov(mo(3)-ref(mo(3),-1),66,E),3,S). Which is the FK smoothed with 3 period simple moving average.


**You may want to experiment with different time periods to optimize the results. For example, to calculate a 4 period Kurtosis, a 50 period FK and a 10 period FSK, use the following formula:

mov(mov(mo(4)-ref(mo(4),-1),50,E),10,S)

MetaStock Indicator -  MACD Histogram

rev. 03/18/98

These two formulas are for the Dr. Alexander Elder indicators.


The custom formula for the MACD Histogram is:

( Mov( C,12,E ) - Mov( C,26,E ) ) - Mov( ( Mov( C,12,E ) - Mov( C,26,E ) ),9,E )


The custom formula for the Weekly MACD Histogram utilizing daily data is:

Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),60,E)-
Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),130,E)-
Mov(Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),60,E)-
Mov(If(DayOfWeek()=5,C,Peak(1,If(DayOfWeek()=5,C,0),1)),130,E),45,E)

MetaStock Indicator - Market Facilitation Index

rev. 01/06/97

The following formulas were constructed using interpretation from Technical Analysis of Stocks & Commodities Magazine June 1994, article "The Market Facilitation Index", by Gary Hoover.

Taken from Stocks & Commodities, V. 12:6 (253-254): The Market Facilitation Index by Gary Hoover

"Applying technical analysis to developing trading signals begins with the investigation of price movement and often incorporates volume studies to improve trading accuracy. The Market Facilitation Index (MFI) is one indicator that synthesizes both price and volume analysis. The MFI is the ratio of the current bar's range (high-low) to the bar's volume.

The MFI is designed to gauge the efficiency of price movement. The efficiency is measured by comparing the current bar's MFI value to the previous bar's MFI value. If the MFI increased, then the market is facilitating trade and is more efficient, implying that the market is trending. If the MFI decreased, then the market is becoming less efficient, which may indicate a trading range is developing that may be a trend reversal…."

Range:
High-Low

MFI:
Fml("Range") / Volume

Efficiency:
If(Fml("MFI"),>,Ref(Fml("MFI"),-1),1, If(Fml("MFI"),<,Ref(Fml("MFI"),-1),-1, If(Fml("MFI"),=,Ref(Fml("MFI"),-1),0,0)))

Where:
+1 = increase
-1 = decrease
0 = unchanged

Market Facilitation Comparison:
If(V,>,Ref(V,-1),If(Fml("MFI"),>,Ref(Fml("MFI"),-1) ,1,If(Fml("MFI"),<,Ref(Fml("MFI"),-1),2,0)),If(V,< ,Ref(V,-1),If(Fml("MFI"),>,Ref(Fml("MFI"),-1),3,If( Fml("MFI"),<,Ref(Fml("MFI"),-1),4,0)),0))

Where:
1 = +,+
2 = +,-
3 = -,+
4 = -,-

Market Facilitation Index Expert Advisor

Rev. 02/24/97

In the August 1996 Stocks & Commodities, an article by Thom Hartle titled "The Market Facilitation Index" showed how to color bars to identify chart patterns based on changes in the market facilitation index and volume. Here is how to do this in MetaStock 6.0's new Expert Advisor.

The first step is to create a new expert by choosing Expert Advisor from MetaStock's Tool menu, and then choose New from the Expert Advisor. Name the expert "Market Facilitation Index", enter any notes you like and then click on the Highlights tab. Enter the following Highlights by choosing New, the color and then entering the following formulas:

Green Bar (Green Bar)
ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) > 0

Fade Bar (Blue Bar)
ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) < 0

Fake Bar (Dk Gray Bar)
ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) < 0

Squat Bar (Red Bar)
ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) > 0


After you have entered the four highlights click OK to finish editing the expert's properties. You can now right-click on the heading or background of any chart. Next select Expert Advisor and then Attach from the Chart shortcut menu. Attach the market facilitation index expert, and it will highlight the four market facilitation patterns that were discussed in Hartle's article. Note: You can save a chart as a template with this expert attached, and then any time you apply the template to a chart the market facilitation index expert will automatically attach to the chart.

 -- Allan J. McNichol, Equis International

MetaStock Indicator - Market Pressure - Ultimate

Sum(If(C > Ref(C,-1)
AND V > Ref(V,-1),
V * C,
If(C < Ref(C,-1)
AND V < Ref(V,-1),
Neg(V) * C,0)),7) * 4 +

Sum(If(C > Ref(C,-1)
AND V > Ref(V,-1),
V * C,
If(C < Ref(C,-1)
AND V < Ref(V,-1),
Neg(V) * C,0)),14) * 2 +
Sum(If(C > Ref(C,-1)
AND V > Ref(V,-1),
V * C,
If(C < Ref(C,-1)
AND V < Ref(V,-1),
Neg(V) * C,0)),28)

MetaStock Indicator - Market Thrust Oscillator

rev. 01/06/97

The following formulas were taken from the article, "The Cumulative Market Thrust Line", by Tushar Chande, in the December 1993 issue of Technical Analysis of Stocks & Commodities.

Taken from Stocks & Commodities, V. 11:12 (506-511): The Cumulative Market Thrust Line by Tushar S. Chande, PhD.

"STOCKS & COMMODITIES contributor Tushar Chande originally introduced the concept of market thrust in August 1992 as a method by which to overcome the limitations of the Arms index. Since then, variations have been suggested on the theme and here, Chande offers the variation of a cumulative market thrust line, in which market thrust is cumulated to calculate a volumetric advance-decline line by including the effect of up and down volume."

Composite securities are created from 4 separate files. Advances, Declines, Upvolume, Downvolume. The article side bar presupposes the user has these four files.

Reuters Trend Data (RTD) supplies this data in two files. The tickers are X.NYSE-A (Advances, number and volume) and X.NYSE-D (Declines, number and volume). To use these two files, you must utilize two different custom formulas and the indicator buffer in MetaStock™ for DOS.

CompuServe supplies this data in 4 files. The tickers are NYSEI (Advances); NYSEJ (declines); NYUP (Advance volume) and NYDN (decline volume).

Dial/Data supplies this data in two files. Advances, number and volume and Declines, number and volume. The tickers are @*NAZ_K and @*NDZ_K.


For the Windows versions of MetaStock:

For RTD and Dial Data:

#1: C * V
#2: 100 * ( ( P - ( C * V ) ) / ( ( P + ( C * V ) ) ) )

To plot it:


For CompuServe data:

#1: C
#2: 100 * ( ( P - C ) / ( ( P + C ) ) )

To plot it:

** To create the cumulative thrust oscillator line perform the same steps as above except change formula #2 to:

Cum(100*(P-C)/(P+C)) for CompuServe data
Cum(100*(P-(C*V))/(P+(C*V))) for RTD and Dial Data

** To create the cumulative market thrust line, the formula is:

Cum(P-C) for CompuServe data
Cum(P-(C*V)) for RTD and Dial Data

You now have the thrust indicator plotted exactly as the article discusses.

Martin Pring's KST Formulas

rev. 01/06/97

The KST indicator was developed by Martin J. Pring. The name KST comes from "Know Sure Thing". The KST is constructed by summing four smoothed rates of change. For more interpretation refer to Martin Pring's article "Summed Rate of Change (KST)" in the September 92 issue of TASC.

The following formulas are MetaStock formulas for the KST.


Daily KST Simple Moving Average

(Mov(Roc(C,10,%),10,S)*1) + (Mov(Roc(C,15,%),10,S)*2) + (Mov(Roc (C,20,%),10,S)*3) + (Mov(Roc(C,30,%),15,S)*4)


Long-Term Monthly KST Simple Moving Average

( (Mov(Roc(C,9,%),6,S)*1) + (Mov(Roc(C,12,%),6,S)*2) + (Mov(Roc(C ,18,%),6,S)*3) + (Mov(Roc(C,24,%),9,S)*4) ) / 4


Intermediate KST Simple Moving Average

(Mov(Roc(C,10,%),10,S)*1) + (Mov(Roc(C,13,%),13,S)*2) + (Mov(Roc (C,15,%),15,S)*3) + (Mov(Roc(C,20,%),20,S)*4)


Intermediate KST Exponential Moving Average

(Mov(Roc(C,10,%),10,E)*1) + (Mov(Roc(C,13,%),13,E)*2) + (Mov(Roc (C,15,%),15,E)*3) + (Mov(Roc(C,20,%),20,E)*4)


Long-Term KST Exponential Moving Average

(Mov(Roc(C,39,%),26,E)*1) + (Mov(Roc(C,52,%),26,E)*2) + (Mov(Roc (C,78,%),26,E)*3) + (Mov(Roc(C,109,%),39,E)*4)


Short-Term KST Weekly Exponential Moving Average

(Mov(Roc(C,3,%),3, E)*1) + (Mov(Roc(C,4,%),4, E)*2) + (Mov(Roc(C,6,%),6, E)*3) + (Mov(Roc(C,10,%),8, E)*4)

MetaStock Indicator - Mass Index

rev. 01/06/97

The Mass Index was designed to identify trend reversals by measuring the narrowing and widening of the range between the high and low prices. As the range widens the Mass Index increases; as the range narrows the Mass Index decreases.

The MASS Index appeared in the June 92 Technical Analysis of Stocks & Commodities article "The Mass Index", by Donald Dorsey.

Taken from Stocks & Commodities, V. 10:6 (265-267): The Mass Index by Donald Dorsey

"Range oscillation, not often covered by students of technical analysis, delves into repetitive market patterns during which the daily trading range narrows and widens. Examining this pattern, Donald Dorsey explains, allows the technician to forecast market reversals that other indicators may miss. Dorsey proposes the use of range oscillators in his mass index."

The following is the MetaStock formula for

Sum(Mov( ( H - L ) ,9 ,E) / Mov(Mov( ( H - L ) ,9 ,E) ,9 ,E ) ,25 )

MetaStock Indicator - McClellan Oscillator

rev. 01/06/97

The McClellan Oscillator, developed by Sherman and Marian McClellan, is a market breadth indicator that is based on the smoothed difference between the number of advancing and declining issues on the New York Stock Exchange. The McClellan Oscillator is one of the most popular breadth indicators. Buy signals are typically generated when the McClellan Oscillator falls into the oversold area of -70 to -100 and turns up. Sell signals are generated when the oscillator rises into the overbought area of +70 to +100 and then turns down.

Extensive coverage of the McClellan Oscillator is provided in their book Patterns for Profit.

To plot the McClellan Oscillator, create a composite security in The DownLoader™ of Advancing Issues minus Declining Issues. Open a chart of the composite in MetaStock™ and plot this custom indicator.

Mov(CLOSE,19,EXPONENTIAL) - Mov(CLOSE,39,EXPONENTIAL)

MetaStock Indicator - McClellan Summation Index

rev. 01/06/97

The McClellan Summation Index is a market breadth indicator developed by Sherman and Marian McClellan. It is a long-term version of the McClellan Oscillator and its interpretation is similar to that of the McClellan Oscillator except that it is more suited to major trend reversals.

For more extensive coverage of the index refer to the book Patterns for Profit, by Sherman and Marian McClellan.

McClellan suggests the following rules for use with the summation Index:

The summation index is plotted by adding the Cum function to the McCllellan Oscillator. The formula is:

Cum(Mov(C,19,E) - Mov(C,39,E))

MetaStock Indicator - McGinley Dynamic

Ref(Mov(C,12,E),-1)+((C-(Ref(Mov(C,12,E),-1))) / (C/(Ref(Mov(C,12,E),-1))*125))

MetaStock Indicator - Modified VIX Indicator

rev. 01/06/97

The interpretation for the Modified Volatility Index was taken from the article Modifying The Volatility Index, by S. Jack Karczewski, in the April 1995 issue of TASC. The Volatility Index (VIX) is the implied volatility of a group of Standard & Poors 100 index options. It is updated by the CBOE.

This formula assumes you can get the VIX information downloaded from some data vendor, such as Dial Data, Telescan, or DBC Signal.

The custom formula you should create is the Modified VIX:

( ( ( P - Mov( P ,15 ,E ) ) / Mov( P ,15 ,E ) ) * ( 100 * 33 * 2 ) ) * ( Sqrt( 252 ) / Sqrt( 15 ) / C )


The steps to get the actual charts are:

For the Windows versions of MetaStock:

1 - Open the chart of the OEX
2 - Open the chart of the VIX.
3 - Drag the plot of the OEX into the chart of the VIX.
4 - Plot the formula for the Modified VIX directly on top of the OEX plot.

You now have a plot of the Modified VIX.

**For interpretation of the Modified VIX refer to Mr. Karczewski's article.

MetaStock Formula - Money Flow Index

rev. 01/06/97

Taken from Stocks & Commodities, V. 12:8 (321-324): SIDEBAR: The Money Flow Index

"The money flow index (MFI) is a volume-weighted form of the relative strength index (RSI). Instead of using up closes versus down closes, the MFI compares today's average price to yesterday's average price and then weighs the average price by volume to calculate money flow (MF). The ratio of the summed positive and negative money flows are then normalized to be on a scale of zero to 100."


Here are the MetaStock™ formulas for the Money Flow Index:

Positive Money Flow:
sum ( if ( typ( ) ,> ,ref ( typ ( ) ,-1 ) ,V * typ ( ) ,0 ) , PERIODS)
Negative Money Flow:
sum ( if ( typ( ) ,< ,ref ( typ( ) ,-1) ,V * typ ( ) * -1 ,0 ) , PERIODS)
Money Flow Ratio:
fml ( "Positive Money Flow" ) / fml ( "Negative Money Flow" )
Money Flow Index:
100 - ( 100 / ( 1 + fml ( "Money Flow Ratio" ) ) )

***The time periods are controlled by PERIODS in the Positive and Negative Money Flow formulas.

MetaStock Indicator - Morris Double Momentum Indicator

Mov(((ROC(C,12.8,%))+(ROC(C,19.2,%))),10,W)

MetaStock Formula - Moving Average of Only One Day of the Week

rev. 01/06/97

Frequently we get requests for a formula that would take only one day of the week and average them for several weeks. For example construct a moving average of only the Fridays. This can be done in MetaStock™ for Windows by using the following formula.

The following MetaStock formula is for a moving average of the Friday of every week, if you want it calculated on any other day you would substitute a 1 for Monday, 2 for Tuesday, 3 for Wednesday, and 4 for Thursday. The number of day you wanted would replace the two 5's already in the formula. This moving average is currently a 6 week or 6 Friday moving average. If you wanted to change it to another periodicity you would change the 30 to the number of weeks or specific days multiplied by 5. In other words if you wanted a 4 day moving average of Friday you would change the 30 to 4*5 or 20.

Mov(If(DayOfWeek( )=5,C,Peak(1,If(DayOfWeek( )=5,C,0),1)),30,S)

MetaStock Indicator - Natenberg's Volatility

rev. 01/21/97

Historical volatility is defined by Sheldon Natenberg, as the standard deviation of the logarithmic price changes measured at regular intervals of time. In Mr. Natenberg's book, Option Volatility & Pricing, he covers volatility in detail and gives the formula for computing historical volatility. In MetaStock™ the equivalent formula would be:

Std( Log( C / Ref( C ,-1 ) ) ,10 ) * Sqrt( 365 / 7 )

This assumes Weekly Data. To utilize this with Daily Data, the formula would be:

Std( Log( C / Ref( C,-1) ),10 ) * Sqrt( 365 )

For further interpretation refer to the book Option Volatility & Pricing, by Sheldon Natenberg.

MetaStock Indicator - One Day Money Flow

(((Close-Low) - (High-Close)) / (High-Low)) * Volume

MetaStock Indicator - Percent Above/Below Moving Average

(oscp(1,30,E,%))

MetaStock Indicator - Persistence of Money Flow

Pds1:= Input("CMF Periods?",1,100,21);
Pds2:= Input("PMF Periods?",10,1000,120);
Sum((cmf(Pds1)>0),Pds2)/(Pds2/100)

MetaStock Indicator - Persistence of Money Flow

Pds1:= Input("CMF Periods?",1,100,21);
Pds2:= Input("PMF Periods?",10,1000,120);
Sum((cmf(Pds1)>0),Pds2)/(Pds2/100)

MetaStock Indicator - Plotting Alpha and Beta

rev. 01/06/97

To plot Alpha and Beta in MetaStock follow the steps below. **The custom indicator named Beta is required to plot Alpha.


In the Windows versions of MetaStock:

To plot Alpha:

  • Create the custom formulas Alpha and Beta (see below for formula syntax).
  • Open a chart of the desired security.
  • Drag the price plot of the index you are comparing, into the chart of the security and close the chart of the index. **Maximize the security chart if needed.
  • Drag the custom indicator Alpha from the Quick List and drop it onto the price plot of the index. **The index plot will turn a purplish color when you are plotting on top of it.

**Note, this formula is set to calculate Alpha over 21 periods. To change the time periods replace each instance of 21 in the formula with the desired number of periods and also change the time periods in the Beta custom indicator.

( Sum( ROC( CLOSE ,1 ,% ) ,21 ) - ( Fml( "Beta" ) * Sum( ROC( INDICATOR,1,%) ,21 ) ) ) / 21


To plot Beta:

  • Open a chart of the desired security.
  • Drag the price plot of the index your comparing, into the chart of the security.
  • Drag this custom indicator from the Quick List and drop it onto the price plot of the index.

Note, this formula is set to calculate beta over 21 periods. To change the time periods replace each instance of 21 in the formula with the desired number of periods.

( ( 21 * Sum( ROC( CLOSE ,1 ,% ) * ROC( INDICATOR ,1 ,% ) ,21 ) ) -

( Sum( ROC( CLOSE ,1 ,% ) ,21) * Sum( ROC( INDICATOR ,1 ,% ) ,21 ) ) ) /

( (21 * Sum( Pwr( ROC( INDICATOR ,1 ,% ) ,2 ) ,21 )) - Pwr( Sum( ROC( INDICATOR ,1 ,% ) ,21 ) ,2 ))

**Beta is a measure of volatility of one security against another. This is typically used to measure the volatility of a stock against an index like the S&P 500. A value greater than one indicates the stock is more volatile than the index.

MetaStock Indicator - Polarized Fractual Efficiency

Rev. 03/20/97

The January 1994 issue of Stocks & Commodities featured an article by Hans Hannula on Polarized Fractual Efficiency. Here is the custom formula for creating the five-period smoothed 10-day PFE using MetaStock:

Mov(If(C,>,Ref(C,-9),Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2)) /
Sum(Sqr(Pwr(Roc(C,1,$),2)+1),9),-
Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2)) /
Sum(Sqr(Pwr(Roc(C,1,$),2)+1),9))*100,5,E)

MetaStock - Price Action Indicator (PAIN)

Rev. 7/01/97

If you were only given today's open, high, low and close, how could you make heads or tails of it? The Price Action Indicator (PAIN) can help. The formula returns a single value that weighs intra-day momentum (C-O), Late Selling Pressure (LSP) (C-L), and Late Buying Pressure (LBP) (C-H). The formula is proven by constructing ideal limit-up and limit down scenarios in bond futures. The output is shown to be consistent with the interpretation of Japanese candlestick patterns. See Michael B. Geraty (1997). "Getting Better Directions" Futures Vol. 26: Aug.

((C-O)+(C-H)+(C-L))/2

MetaStock Indicator - Price Oscillator Wave

if(ref(oscp(3,15,S,%),-1),<,0,1,0)

MetaStock Indicator - Price Volume Rank

rev. 01/06/97

Taken from Stocks & Commodities, V. 12:6 (235-239): Price-Volume Rank by Anthony J. Macek

"Imagine receiving a warning when the market was likely to collapse or being alerted when one of your favorite stocks was about to rally. What if these signals came from analysis that was simple enough to do without a computer and took only a few minutes a day to update, using just two pieces of information found in virtually any newspaper? Is this a dream? Maybe not. Anthony Macek explains.

The old adage about keeping things simple applies even to the investment world. Methods of analysis such as polarized fractal efficiency and price oscillator divergences do a great job, but for those with neither the time nor the inclination to master the techniques necessary to monitor every blip and sputter that the market produces may be served just as well by noting only two very important market variables: price and volume."

For interpretation refer to the June 94 issue of Technical Analysis of Stocks & Commodities.

You need to create all of the following custom formulas in order for the PV Rank to calculate properly.

P-V Rank:
Fml( "PV1" ) + Fml( "PV2" )

PV1:
If( C ,> ,Ref( C ,-1 ) ,If( V ,> ,Ref( V ,-1 ) ,1 ,If( V ,< ,Ref(V ,-1 ) ,2 ,0 ) ) ,0 )

PV2:
If( C ,< ,Ref( C ,-1 ) ,If( V ,< ,Ref( V ,-1 ) ,3 ,If( V ,> ,Ref( V ,-1 ) ,4 ,0 ) ) ,0 )

PV Biggie: (This combines all formulas into one formula)
If( C ,> ,Ref( C ,-1 ) ,If( V ,> ,Ref( V ,-1 ) ,1 ,If( V ,< ,Ref( V ,-1 ) ,2 ,0 ) ) ,If( C ,< ,Ref( C ,-1 ),If( V ,< ,Ref( V ,-1 ) ,3 ,If( V ,> ,Ref( V ,-1 ) ,4 ,0 ) ) ,0 ) )

MetaStock Indicator - Price Volume Trend Stochastic

{Fast line}
Mov((PVT()-LLV(PVT(),19))/
(HHV(PVT(),19)-LLV(PVT(),19)), 5, S)

{Slow Line}
Mov(Mov((PVT()-LLV(PVT(),19))/
(HHV(PVT(),19)-LLV(PVT(),19)), 5, S),3,S)

MetaStock Indicator - Random Walk Index

rev. 01/06/97

The following formulas, for the Random Walk Index, were constructed using information from the article "Are There Persistent Cycles", by E. Michael Poulos, in the September 1992 TASC.

All formulas are needed.

-----------------------------------------------------------------

MetaStock Windows versions:

Random Walk Index:

Max( ( Ref(HIGH,-1) - LOW ) / ( ( Ref(Sum (Atr ( 1 ) ,2 ),-1) / 2) * Sqrt( 2 ) ) ,Max( (Ref(HIGH,-2) -LOW) / ( ( Ref(Sum (Atr ( 1 ),3),-1) / 3) * Sqrt( 3 ) ), Max( (Ref(HIGH,-3) - LOW) / ( (Ref(Sum (Atr( 1 ) ,4) ,-1) / 4) * Sqrt( 4 ) ) , Max( ( Ref( HIGH,-4) - LOW) / ( (Ref(Sum(Atr( 1 ),5),-1) / 5) * Sqrt( 5 ) ), Max( (Ref(HIGH,-5) - LOW) / ( (Ref( Sum( Atr ( 1 ),6),-1) / 6 ) * Sqrt( 6 ) ), Max( ( Ref(HIGH,-6) -LOW) / ( (Ref( Sum( Atr( 1 ),7),-1) / 7) * Sqrt( 7 ) ), Max((Ref(HIGH,-7)-LOW) / ( (Ref(Sum (Atr( 1 ),8),-1) / 8) * Sqrt(8) ), (Ref(HIGH,-8)-LOW) / ( (Ref(Sum (Atr (1),9),-1) / 9) * Sqrt( 9 ) ) ) ) ) ) ) ) )

MetaStock Formula - Rate of Change Since a Specific Date

rev. 05/25/99

The following formula plots a percent rate of change between a specific date and today. The user is prompted for the specific date.This will only work in MetaStock™ for Windows 95/NT version 6.5 (or higher) or in MetaStock Professional.

Construct the formula in the Indicator Builder, giving it the name shown below in bold. All the text after "FORMULA:" and before "*END OF FORMULA*" below should be placed in the Formula field in the Indicator Builder. Once the indicator has been created, you can drag it out of the Indicator Quicklist for placement in an inner-window of your chart.

NAME: ROC Since a Date

FORMULA:

Day1 := Input("Day",1,31,4);
Month1 := Input("Month",1,12,1);
Year1 := Input("Year",1900,2400,1999);

100 * (CLOSE - ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1, CLOSE))/ ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1,CLOSE)

MetaStock Indicator- Recursive Moving Trend Average

Lb:=Input("Look-Back Period?",3,100,21);

Alpha:=2/(LB+1);

Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;

RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+

(Alpha*(C+Bot-Ref(Bot,-1)));

RMTA;

MetaStock Indicator - Regression Oscillator and Slope/Close Indicator

rev. 02/25/97

In MetaStock 6.0 it’s easy to create the Regression Oscillator and the Slope/Close Indicator from Richard Goedde’s article, "Market timing with the regression oscillator", which appears in the March 97 issue of Technical Analysis Stocks and Commodities magazine.


First choose Indicator Builder from the Tools menu and enter the following formulas:

Regression Oscillator
100 * (CLOSE/ LinearReg(CLOSE,63)-1)

Slope/Close
10000* LinRegSlope(CLOSE,63)/CLOSE

Next drag each of these formulas from the Indicator QuickList and drop them on the heading of a chart. To create horizontal lines, click the right mouse button while the mouse pointer is positioned over the Regression Oscillator to display the shortcut menu. Choose Regression Oscillator Properties. On the Horizontal lines page add horizontal lines at 14, 0, and -14.

You can use The Explorer to perform the screen mentioned in the article. First choose The Explorer from the Tools menu, next create a new Exploration with the following information:

Column A
Name: Reg Osc
Formula: Fml("Regression Oscillator")

Column B
Name: Slp/Cls
Formula: Fml("Slope/Close")

Filter
Formula: ColB > 50 and ColA >-15 and ColA < -5

Choose OK and then Explore to run the Exploration. For MetaStock for Windows 5.x users the instructions are the same except enter the following custom indicator in place the ones mentioned earlier.

Regression Oscillator
100 * (CLOSE/ ((63 * Sum(Cum(1) * C,63) - Sum(Cum(1),63) * Sum(C,63)) / (63 * Sum(Pwr(Cum(1),2),63) - Pwr(Sum(Cum(1),63),2)) * Cum(1) + (Mov(C,63,S) - Mov(Cum(1),63,S) * (63 * Sum(Cum(1) * C,63) - Sum(Cum(1),63) * Sum(C,63)) / (63 * Sum(Pwr(Cum(1),2),63) - Pwr(Sum(Cum(1),63),2))))-1)

Slope/Close
10000* ((63 * Sum(Cum(1) * C,63) - Sum(Cum(1),63) * Sum(C,63)) / (63 * Sum(Pwr(Cum(1),2),63) - Pwr(Sum(Cum(1),63),2)))/CLOSE

MetaStock Indicator - Relative Strength Index (RSI) Custom

rev. 12/11/98

This custom RSI will allow you to select which price data to use when you plot it. The standard RSI uses the close value as Welles Wilder did when he created the indicator. This custom indicator will allow you to use the other price fields including volume.

Q:=Input("Time Periods",1,1000,14);

B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1);

Z:=If(B=1,Wilders(If(ROC(C,1,$)>0,ROC(C,1,$),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)>0,ROC(O,1,$),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)>0,ROC(H,1,$),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)>0,ROC(L,1,$),0),LastValue(Q)),Wilders(If(ROC(V,1,$)>0,ROC(V,1,$),0),LastValue(Q))))));

Y:=If(B=1,Wilders(If(ROC(C,1,$)<0,Abs(ROC(C,1,$)),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)<0,Abs(ROC(O,1,$)),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)<0,Abs(ROC(H,1,$)),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)<0,Abs(ROC(L,1,$)),0),LastValue(Q)),Wilders(If(ROC(V,1,$)<0,Abs(ROC(V,1,$)),0),LastValue(Q))))));

RS:=Z/Y;

100-(100/(1+RS))

MetaStock Indicator - Relative Volatility Index (RVI)

rev. 01/06/97

The following formulas were taken from the article "The relative volatility index," written by Dorsey, Donald, in the June 93 issue of Technical Analysis of STOCKS & COMMODITIES.

Taken from Stocks & Commodities, V. 11:6 (253-256): The Relative Volatility Index by Donald Dorsey

"The RVI is simply the relative strength index (RSI) with the standard deviation over the past 10 days used in place of daily price change. Because most indicators use price change for their calculations, we need a confirming indicator that uses a different measurement to interpret market strength. The RVI measures the direction of volatility on a scale of zero to 100. Readings above 50 indicate that the volatility as measured by the 10-day standard deviation of the closing prices is more to the upside. Readings below 50 indicate that the direction of volatility is to the downside. The initial testing indicates that the RVI can be used wherever you might use the RSI and in the same way, but the specific purpose of this study is to measure the RVI's performance as a confirming indicator."

The RVI was designed to measure the direction of volatility. It calculates price strength by measuring volatility rather than price change.

All of the following formulas are required:

@RVI Down

((PREV*13)+If(ROC(C,1,%)<0,Stdev(C,10),0))/14

@RVI Up

((PREV*13)+If(ROC(C,1,%)>0,Stdev(C,10),0))/14

@RVI

(100*Fml("@RVI Up"))/(Fml("@RVI Up")+Fml("@RVI Down"))

MetaStock Indicator R-squared, Chande and Kroll's

rev. 01/06/97

In their book The New Technical Trader, Chande & Kroll introduce the r2 indicator. They state that "the primary use of r2 is as a confirming indicator" and that "it is a lagging indicator that shows the strength of the trend."

In MetaStock the r2 formula is:

Pwr(Corr(Cum( 1 ),C,14,0),2)


They also present a smoothed r2 which would be:

Mov(Pwr(Corr(Cum( 1 ),C,14,0),2)*100,14,S)


For interpretation refer to Chande & Kroll's book, as stated above.

Note: The r-squared indicator is built into MetaStock for Windows version 6.0 and later.

MetaStock Indicator - Rule of 7 Oscillator

Rule of 7 Down Objective
If((ROC(C,12,%)>-1.5),If((ROC(C,12,%)>-3),
If((ROC(C,12,%)>-4.5),((H-(H-L)*1.75)),((H-(H-L)*2.33))),((H-(H-L)*3.5))),(H-(H-L)))

Rule of 7 Up Objective
If((ROC(C,12,%)>1.5),If((ROC(C,12,%)>3),
If((ROC(C,12,%)>4.5),(((H-L)*1.75)+L),(((H-L)*2.33)+L)),(((H-L)*3.5)+L)),((H-L)+L))

Rule of 7 Oscillator
Fml("Rule of 7 UP Objective") -
Fml("Rule of 7 DOWN Objective")

MetaStock Indicator - Short Volume Wave

if(oscv(1,50,S,%),>,0, if(V,>,ref(V,-1),1,0),0)

MetaStock Indicator - Slope of a Line

rev. 01/06/97

The following custom formula returns the slope of a line. For example, this formula returns the slope of a 14 day run of the security's closing prices.

( (14 * (Sum(Cum( 1 ) * C ,14 ) ) ) - (Sum(Cum( 1 ) ,14 ) * (Sum( C ,14) ) ) ) / ( (14 * Sum(Pwr (Cum( 1 ) ,2 ) ,14 ) ) - Pwr(Sum(Cum( 1 ) ,14 ) ,2 ) )


To apply this to different lines you would replace C with the desired syntax for the line. For example the slope of a 25 period simple moving average would be:

( ( Sum(Cum(1) * Mov(C,25,S),14) ) - (Sum(Cum(1),14) * Sum(Mov(C,25,S),14) / 14) ) / ( (Sum(Power(Cum(1),2),14) ) - (Power(Sum(Cum(1),14),2) / 14) )


You could also make this a universal formula by using the P variable. You could then plot the formula on top of any line.

( (14*(Sum(Cum(1)*P,14) ) ) - Sum(Cum(1),14)*(Sum(P,14 ) ) ) / ( (14*Sum(Pwr(Cum(1),2 ),14 ) )-Pwr(Sum(Cum(1),14),2 ) )

MetaStock Indicator - Slope of a Linear Regression Line

rev. 01/06/97

The following custom formula will return the slope of a Linear Regression Line.

tp:=Input("Time Periods",1,200,21);

((tp*(Sum(Cum(1)*C,tp)))-(Sum(Cum(1),tp)*(Sum(C,tp))))/((tp*Sum(Pwr(Cum(1),2),tp))-Pwr(Sum(Cum(1),tp),2))

Standard Error Bands for MetaStock
for Windows

rev. 01/06/97

For interpretation refer to the article "Standard Error Bands", in the September 96 issue of TASC, written by Jon Anderson.

21 period Upper Band (smoothed):

Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1) + (Mov(C,21,S) - Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2))) +2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21)) -((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))/ ((Sum(Power(Cum(1),2),21))-(Power(Sum(Cum(1),21),2)/21)) *((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S)

21 period Lower Band (smoothed):

Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1) +(Mov(C,21,S) - Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2))) - 2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21)) -((Sum(Cum(1)*C,21))- ((Sum(Cum(1),21) * Sum(C,21)/21))) / ((Sum(Power(Cum (1),2),21))-(Power(Sum(Cum(1),21),2)/21))*((Sum(Cum(1)*C,21))- ((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S)

21 period R2 (smoothed):

Mov((Pwr(Corr(Cum(1),C,21,0),2)),3,S)

21 period Regression Slope:

(((Sum(Cum(1)*C,21))-(Sum(Cum(1),21)*Sum(C,21)/21)) / ((Sum(Power(Cum(1),2),21))-(Power(Sum(Cum(1),21),2)/21)))

21 period %A:

((C-Fml("21 period lower band (smoothed)")) / (Fml("21 period upper band(smoothed)") -Fml("21 period lower band (smoothed)")))

21 period Regression (smoothed):

Mov((21*Sum(Cum(1)*C,21)-Sum(Cum(1),21)*Sum(C,21))/ (21*Sum(Pwr(Cum(1),2),21)-Pwr(Sum(Cum(1),21),2))*Cum(1) +(Mov(C,21,S) - Mov(Cum(1),21,S) * (21*Sum(Cum(1) * C,21) - Sum(Cum(1),21)*Sum(C,21))/(21*Sum(Pwr(Cum(1),2),21) -Pwr(Sum(Cum(1),21),2))),3,S)

MetaStock Indicator - Special Trix

trix(12)-ref((trix(12)),-1)

MetaStock Indicator - STIX Oscillator

rev. 01/06/97

STIX oscillator is a short-term trading oscillator that was published in The Polymetric Report. It compares the amount of volume flowing into advancing and declining stocks.

Calculation:
STIX is based on a variation of the Advance/Decline Ratio:

A/D Ratio = (Advancing Issues /(Advancing Issues + Declining Issues)) * 100

The STIX is a 21-period exponential moving average of the above A/D Ratio. In MetaStock this would be:

STIX = Mov((Advancing Issues /(Advancing Issues + Declining Issues)) * 100,21,E)


To construct the STIX in MetaStock for Windows you would need to perform the following steps:

  • In The DownLoader for Windows create a composite of the Advancing Issues + Declining Issues.
  • In MetaStock open the composite and the Advancing Issues
  • Tile the charts so they can both be viewed.
  • Drag the plot of the composite into the chart of the Advancing Issues.
  • Create the custom formula: Mov((C/P)*100,21,E)
  • Plot this formula on top of the composite plot in the Advancing Issues chart. (The composite's plot will turn a purplish color when the formula is going to be plotted on it)
  • You can then drag that new plot to a separate inner window if you prefer.

For interpretation refer to The Polymetric Report.

MetaStock Indicator - Stochastic %D

rev. 01/06/97

The following formula is a three day moving average of a 14 day Stochastic. In MetaStock for Windows this would be the indicator line that is plotted with the built in Stochastic indicator

Mov( ( ( ( C - LLV( L,14 ) ) /( HHV( H,14 ) - LLV( L,14 ) ) ) * 100 ) ,3 ,S )

MetaStock Indicator - Stochastic Relative Strength Index

rev. 01/06/97

In his book The New Technical Trader, Tushar Chande defines the Stochastic RSI as:

StochRSI = (RSI - RSIL)/(RSIH -RSIL)

where RSIL and RSIH are the lowest and highest values of the RSI over a given period.

In his book he uses 14 periods. The MetaStock™ formula for the Stochastic RSI is:

( ( RSI ( 14 ) - LLV( RSI (14 ) ,14 ) ) / ( ( HHV( RSI (14 ) ,14 ) ) - LLV(RSI (14 ),14 ) ) )

MetaStock Indicator - Stochastic Wave Long

if(ref(stoch(14,3),-1),=,llv(stoch(14,3),3),2, if(stoch(14,3),=,llv(stoch(14,3),3),1,0))

MetaStock Indicator - Stochastic Wave Short

if(ref(stoch(14,3),-1),=,hhv(stoch(14,3),3),2, if(stoch(14,3),=,hhv(stoch(14,3),3),1,0))

MetaStock Indicator - Support and Resistance

rev. 26/04/01

Think of security prices as the result of a head-to-head battle between a bull (the buyer) and a bear (the seller). The bulls push prices higher and the bears push prices lower. The direction prices actually move reveals who is winning the battle.

Support levels indicate the price where the majority of investors believe that prices will move higher, and resistance levels indicate the price at which a majority of investors feel prices will move lower.

To create the Support and Resistance indicator in MetaStock use the following custom formula:

LookBack := Input("Look Back Periods",1,1000,10);
Resistance :=ValueWhen(1,Cross(Mov(C, LookBack,
S),C),HHV(H, LookBack));
Support :=ValueWhen(1,Cross(C,Mov(C, LookBack,
S)),LLV(L, LookBack));
Resistance;
Support;

To use this formula most effectively, use the parameters dialogue to change the style to a dotted line while increasing the line weighting.

MetaStock Indicator - The New Advance Decline Line

rev. 01/06/97

The formulas and steps necessary to do the New Advance -Decline Line from the September 1994 Technical Analysis of Stocks & Commodities, page 14 by Daniel Downing are:

Taken from Stocks & Commodities, V. 12:9 (363-365): A New Advance-Decline Line by Daniel E. Downing

"Here's a trading tool that uses a unique version of the daily advance-decline line of the New York Stock Exchange (NYSE). This version helps in our short- and long-term trading of index options and stock index futures. It gives many good short-term trading signals and excellent but infrequent longer-term signals…

The philosophy behind this tool is that the short-term trader's capital is finite and that traders have to reliquify their holdings after a period. Traders can buy and try to push the equities higher only so many times before they need to reliquify, just as only a finite amount of selling waves can take place before the sellers are out of supplies. A tool that points to when short-term traders need to reliquify their positions will also spot when the markets will soon reverse their trends."


For the Windows versions of MetaStock:

  • Load the advances
  • Load the declines
  • Drag the plot of the advances into the chart of the declines
  • Plot the following custom formula directly on the plot of advances.

Cum( If( P ,>= ,1000 ,If(C ,< ,1000 , + 1 ,0 ) ,If( C ,>= ,1000 ,-1 ,0 ) ) )

MetaStock Indicator - Tick Line Momentum Oscillator

rev. 01/06/97

In his article "Using The Tick In A Short-Term Indicator", in the January 94 issue of TASC, Daniel E. Downing presents the Tick Line Momentum Oscillator.

Taken from Stocks & Commodities, V. 12:1 (42-44): Using The Tick In A Short-Term Indicator by Daniel E. Downing

"The tick index, the net difference of the numbers of stocks last traded on an uptick from those last traded on a downtick , is a well-known indicator, but it's got a problem. The raw number result is volatile, perhaps too volatile for some. What to do? here, then, is a way to smooth out the noise to identify short-term trading opportunities.

The tick is a basic unit for the markets, watched with fascination during periods of turmoil and periods of enthusiasm. It is quoted throughout the day on most quote services. In addition, the closing tick value can be found on the market statistics pages of financial newspapers such as Barron's and The Wall Street Journal. Let me present, then, the tick line momentum oscillator, which is based on the closing value for the New York Stock Exchange (NYSE) tick indicator. The oscillator has been shown to have a good track record of determining when the NYSE is overbought or oversold on a short-term basis. The formula for the tick line momentum oscillator is simple and can be easily calculated without a computer, although a spreadsheet version can be found in the sidebar, "Tick line momentum." Finally, the oscillator is straightforward and simple to apply."

The MetaStock formula for the Tick Line Momentum Oscillator is:

Mov( ROC( Cum( If( C ,> ,Ref( Mov(C ,10 ,E ) ,-1 ) ,+1 ,If( C ,< ,Ref( Mov( C ,10 ,E ) ,-1 ) ,- 1 ,0 ) ) ) ,5 ,$ ) ,5 ,E )

For interpretation refer to Mr. Downing's article.

MetaStock Index - Trading Channel Index

rev. 01/06/97

The Trading Channel Index comes from an early version of AIQ's Stock Expert program. "The Trading Channel Index measures the location of average daily price relative to a smoothed average of average daily price. It is derived from the average difference between these two values."

To create the Trading Channel Index in MetaStock create the following custom formula's:

AP+: Average price
( H + L + C ) / 3

ESA+: Smoothed price average
Mov( Fml( "AP+" ) ,10 ,E ) + ( Mov( Ref( Fml( "AP+" ) ,-1 ) ,10 ,E ) )

D+: Price range estimate
Mov( ( Fml( "AP+" ) - Fml( "ESA+" ) ) ,10 ,E ) + ( Mov( Ref( Fml( "AP+" ) - Fml( "ESA+" ) ,-1 ) ,10 ,E ) )

CI+: Channel index
( ( Fml( "AP+" ) - Fml( "ESA+" ) ) / ( 0.015 * Fml( "D+" ) ) )

TRADING CHANEL INDEX:
Mov( Fml( "CI+" ) ,21 ,E ) + ( Mov( Ref( Fml( "CI+" ) ,-1 ) ,21 ,E ) )

MetaStock Indicator - Trending Banding

Mov(C,2,S)>
Mov(Mov(C,2,S),2,S) AND
Mov(Mov(C,2,S),2,S)>
Mov(Mov(Mov(C,2,S),2,S),2,S) AND
Mov(Mov(Mov(C,2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S) AND
Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S) AND
Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S) AND
Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S) AND
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S) AND
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)ANDMov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)>
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)

MetaStock Indicator - Trendline Formula

Trough(1,L,10)+

((((Trough(1,L,10)-Trough(2,L,10))

/

(TroughBars(2,L,10)-TroughBars(1,L,10)))

*TroughBars(1,L,10)))

This formula will draw a trendline from the most recent bottom.

The L (low) can be changed to C (close) and the 10 can be changed to a different percent value.

You will also need to change the line style to the last one in the drop down list.

MetaStock Index - True Strength Index

100 * ( Mov( Mov( ROC(C,1,$),25,E),13,E) / Mov( Mov( Abs(ROC(C,1,$)),25,E),13,E))

MetaStock Indicator - Tushar Chande's Target Price

A:=Mov(Abs(C-Ref(C,-1)),10,S);
TPH1:=C+A;
TPH2:=C+(2*A);
TPL1:=C-A;
TPL2:=C-(2*A);
TPH1;
TPH2;
TPL1;
TPL2;

MetaStock Indicator - Tushar Chande's Vidya with Volatility Bands

K:=Stdev(C,5)/Mov(Stdev(C,5),20,S);
SC:=0.9;
Vidya:=SC*K*C+(1-SC*K)*Ref(C,-1);
UpperBand:=Vidya+2*.5*K;
LowerBand:=Vidya-2*.5*K;
UpperBand;
LowerBand;
Vidya;

MetaStock Indicator - Volatility %

Lookback := Input("Time Periods",1,1000,50);

HighVolatility := Input("High Volatility %",.01,100,3);

100 * Sum(100 * ATR(1)/CLOSE > HighVolatility, Lookback)/Lookback

MetaStock Indicator - Volatility Difference

mov(H-L,1,S)/mov(H-L,20,S)

MetaStock Indicator - Volume Accumulation % Indicator

Periods:=Input("Time Periods",1,60,21);
X:=(2*C-H-L)/(H-L);
TVA:=Sum(V*x,Periods);
TV:=Sum(V,Periods);
VA:=100*TVA/TV;
VA

MetaStock Indicator - Volume Oscillator Wave

if(oscv(1,50,S,%),>,50,1,0)

MetaStock Indicator - Weekly High Low Wave

if(H,>,ref(hhv(H,40),-1),1, if(L,<,ref(llv(L,40),-1), -1,0))

Weekly Oscillator Segment

mov(oscp(43,86,S,%),43,S)

MetaStock Indicator - Weekly Price Oscillator

mov(oscp(10,20,S,%),10,S)

MetaStock Indicator - Wilder's Volatility

rev. 6/06/98

In his book New Concepts in Technical Trading Systems, J. Welles Wilder Jr. talks about volatility and describes his Volatility Index and Volatility System. Both of these can be performed in MetaStock™ for Windows. This document describes how to construct both the index and the system.

The Volatility Index (VI) is described by Wilder as:

VI Today = (13 * VI Prev + TR1) / 14 *where TR1 is today's true range.


He defines the true range as the greatest of the following:

  1. The distance from today's high to today's low
  2. The distance from yesterday's close to today's high, or
  3. The distance from yesterday's close to today's low.

In MetaStock version 5.0 or higher you would use the following function.

VI Today = ATR(14)

 
The Volatility System is:

Enter Long

Cross(C,Ref(LLV(C,7),-1)+(Ref(ATR(7),-1)*3))

Enter Short

Cross(Ref(HHV(C,7),-1)-(Ref(ATR(7),-1)*3),C)

 

MetaStock Formula - Freeburg Precious Metal Switch Fund System

To create the Freeburg Precious Metal Switch Fund system in MetaStock for Windows, you must first create the K ratio as a composite security. To do this, launch The Downloader from MetaStock, and choose New and then Composite from The Downloader's File menu. Make sure the directory specified is the directory where your weekly GMI and Handy and Harman data are located. Name the composite the K ratio, then choose the Barron's Gold Mining Index as the Primary symbol and Handy and Harman prices as the secondary symbol. Next, choose Divide as the Operator and the click the OK button to add the composite.  Open the K ratio chart in MetaStock, Plot the Bollinger Bands Indicator and enter 46 for the number of periods and 2.3 for the standard deviations. Plot Bollinger Bands again and enter 4 for the periods and 1.6 for the Standard Deviations. Your chart should look like the one in Figure ?.

You can also create this system in MetaStock for Dos with the same steps.

The data necessary for this chart/indicator, is extremely difficult to obtain. The only source we are aware of on diskette is the author of the article. The data is in a Lotus spreadsheet. It must be output to ASCII and then converted to MetaStock data files. He will make a small charge for this data. 

To keep the GMI data updated, it is only available from Barrons magazine and must be manually input. The Handy & Harman data must also be manually updated. This may be obtained from the Wall Street Journal as well.

MetaStock Formula - Rainbow Charts

To create Rainbow Charts in MetaStock for Windows, open any chart, drop the moving average indicator from the Indicator QuickList, and drop it in the same inner windows as the price bars. Enter two for the Periods and simple for the Method. Next plot a second moving average on the first moving average by dragging a moving average from the QuickList and dropping it on the first moving average (Note: The first moving average should turn light purple before you release the mouse button). If you dropped it correctly the Parameters dialog should say ‘Indicator’ for the Price Field. Click OK to accept two periods and simple as the parameters. Change the color of this moving average as desired. Now plot a third moving average of the second moving average by repeating these steps. Continue this until you have ten moving averages. Choose Yes if MetaStock prompts you about plotting a duplicate indicator.

Next choose Indicator Builder from the Tools menu and enter the following formulas.

Rainbow Max

Max(Mov(C,2,S),
Max(Mov(Mov(C,2,S),2,S),
Max(Mov(Mov(Mov(C,2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S))))))))))

Rainbow Min

Min(Mov(C,2,S),
Min(Mov(Mov(C,2,S),2,S),
Min(Mov(Mov(Mov(C,2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S))))))))))

Rainbow Oscillator

100 * (CLOSE - ((Mov(C,2,S)+
Mov(Mov(C,2,S),2,S)+
Mov(Mov(Mov(C,2,S),2,S),2,S) + Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S) + Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S) + Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S)+ Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+ Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)) /10))/(HHV(C,10)-LLV(C,10))

Lower Rainbow Band

-100 * (Fml("Rainbow Max") - Fml("Rainbow Min")) /
(HHV(C,10) - LLV(C,10))

Upper Rainbow Band

100 * (Fml("Rainbow Max") - Fml("Rainbow Min")) /
(HHV(C,10) - LLV(C,10))


Plot the Rainbow Oscillator in a new inner window of your chart with the ten moving averages, by dropping the custom indicator from the QuickList onto the chart’s heading. Right click on the Rainbow Oscillator and choose properties, then change the Style to a histogram. Now plot the Lower Rainbow Band and the Upper Rainbow Band in the same inner window as the Rainbow Oscillator. If the scaling dialog appears when plotting these indicators, choose ‘Merge with Scale on Right.’ Change the colors of the Upper and Lower Rainbow Bands as desired. Now save this as a new template by choosing Save As from the File Menu and changing the File Type to template, so you can easily apply it to any chart.

MetaStock Formula - Fibonacci Ratios and Momentum

In MetaStock for Windows, you can establish Fibonacci Retracement levels as outlined in the November 1997 TASC article "Using Fibonacci Ratios and Momentum" by Thom Hartle by first creating an Expert in the Expert Advisor. To do this, choose Expert Advisor from the Tools menu and then choose New. Enter the following Expert Highlights and Expert Symbols into your Expert.

Fibonacci Ratios and Momentum

Highlights

Name: RSI > 50

Condition: RSI(14) > 50

Color: Dk Green

  
Name: RSI < 50

Condition: RSI(14) < 50

Color: Red


Symbols

Name: Isolated Low

Condition: LOW < Ref(LOW,-1) AND LOW < Ref(LOW,1)

Graphic: Buy Arrow

Color: Black

Label: Isolated Low

  
Name: Isolated High

Condition: HIGH > Ref(HIGH,-1) AND HIGH > Ref(HIGH,1)

Graphic: Sell Arrow

Color: Black

Label: Isolated High


Note: If the Symbol labels make the chart too busy you may want to shorten the label (e.g. change Isolated High to IH).

Next, close the Expert Advisor, open any chart, and then click the right-mouse button on the chart’s heading. Choose Expert Advisor and then Attach from the Chart Shortcut Menu. You can now choose Fibonacci Retracement from the Insert menu, and then drag from one isolated extreme to another. In MetaStock 6.5 you should right-click on the Fibonacci Retracement lines and choose properties. Check the Snap to Price checkbox so the Retracement lines will automatically snap to the high and low prices. If you followed these steps correctly, your chart should look like the chart below

MetaStock Formula - Volatility % Indicator

You can easily create the Volatility% Indicator from William Brower’s article in MetaStock for Windows. First choose Indicator Builder from the Tools menu in MetaStock. Next choose New and enter one of the following formulas:

Formula for MetaStock

Volatility%

Lookback := Input("Time Periods",1,1000,50);

HighVolatility := Input("High Volatility %",.01,100,3);

100 * Sum(100 * ATR(1)/CLOSE > HighVolatility, Lookback)/Lookback


Formula for earlier versions of MetaStock for Windows

Volatility%

100 * Sum(100 * ATR(1)/CLOSE > 3, 50)/50

Now drag the Volatility% from the Indicator QuickList and drop it on the desired chart.

Allan McNichol
Equis International

MetaStock Formula - Breaking out of Price Channels

Breaking out of Price Channels, by Gerald Marisch,"Technical Analysis of Stocks & Commodities", January 1998, page 93.

"Here's a technique based upon Tushar Chande's variable-length moving average.    The indicator is more responsive to market price movements than a conventional simple or exponential moving average, and can be used for position trading."

The following formula will match the authors slight modification to the variable moving average:

VIDYA 21,5 Indicator

Length:=Input("Length",1,200,21);

Smooth:=Input("Smoothing",1,200,5);

AbsCMO:=(Abs(CMO(C,Length)))/100;

SC:=2/(Smooth+1);

VIDYA:=If(Cum(1)<=(Length+1),C,(SC*AbsCMO*CLOSE)+(1-(SC*AbsCMO))*PREV);

VIDYA

The following Expert highlights will show you when the price has undergone trend changes as discussed in the article.  Enter each section as a separate highlight in an Expert Advisor.  To do this, create a new Expert and select Highlights from the tab dialog.  Then select New and name it Bull.  Paste the Bull trend formula into the condition box within the editor and set the color to green.    Do this for the Bear and the Pause conditions as well, selecting the matching colors,  Attach this Expert to your chart and if the conditions are met, the price bars will be displayed in the proper colors.


Green Bars (Bull trend):

Length:=21;

Smooth:=5;

AbsCMO:=(Abs(CMO(C,Length)))/100;

SC:=2/(Smooth+1);

VIDYA:=If(Cum(1)<=(Length+1),C,(SC*AbsCMO*CLOSE)+(1-(SC*AbsCMO))*PREV);

C>(Vidya*1.01) 


Red Bars (Bear trend):

Length:=21;

Smooth:=5;

AbsCMO:=(Abs(CMO(C,Length)))/100;

SC:=2/(Smooth+1);

VIDYA:=If(Cum(1)<=(Length+1),C,(SC*AbsCMO*CLOSE)+(1-(SC*AbsCMO))*PREV);

C<(VIDYA*.99)


Yellow Bars( Pause or pending reversal of the trend):

Length:=21;

Smooth:=5;

AbsCMO:=(Abs(CMO(C,Length)))/100;

SC:=2/(Smooth+1);

VIDYA:=If(Cum(1)<=(Length+1),C,(SC*AbsCMO*CLOSE)+(1-(SC*AbsCMO))*PREV);

C>(VIDYA*.99) AND C<(VIDYA*1.01)

MetaStock Formula - Smoothing Techniques for More Accurate Signals

The following MetaStock formulas are from the 1998 January TASC article "Smoothing Techniques for more Accurate Signals", by Tim Tillson. Refer to his article for interpretation.

"More sophisticated smoothing techniques can be used to determine market trend.   Better trend recognition can be lead to more accurate trading signals."

ILRS

Periods:=Input("Periods?",2,63,11);
Size:=LastValue(Cum(1));
Start:=LastValue(Ref(Mov(P,Periods,S),Periods-Size));
Cum(LinRegSlope(P,Periods))+Start;

T3

Periods:=Input("Periods?",1,63,5);
a:=Input("Hot?",0,2,.7);
e1:=Mov(P,Periods,E);
e2:=Mov(e1,Periods,E);
e3:=Mov(e2,Periods,E);
e4:=Mov(e3,Periods,E);
e5:=Mov(e4,Periods,E);
e6:=Mov(e5,Periods,E);
c1:=-a*a*a;
c2:=3*a*a+3*a*a*a;
c3:=-6*a*a-3*a-3*a*a*a;
c4:=1+3*a+a*a*a+3*a*a;
c1*e6+c2*e5+c3*e4+c4*e3;

MetaStock Formula - Anchored Momentum

The four indicators in Rudy Stefenel’s article "Anchored Momentum" can be easily created in MetaStock. First, choose Indicator Builder from the Tools menu. If you have MetaStock 6.5 enter the following formulas:


General Anchored Momentum w/ Exponential Smoothing

MomPer := Input("Momentum Periods",1,1000,10);

SmaPer := Input("Simple Moving Average Periods",1,1000,7);

EmaPer := Input("Exponential Moving Average Periods",1,1000,7);

100 * ((Mov(CLOSE, EMAPer, E) / Ref(Mov(CLOSE, SmaPer, S), ((SmaPer - 1)/2)

- MomPer)) - 1)


General Anchored Momentum

MomPer := Input("Momentum Periods",1,1000,10);

SmaPer := Input("Simple Moving Average Periods",1,1000,7);

100 * ((CLOSE / Ref(Mov(CLOSE, SmaPer, S), ((SmaPer - 1)/2) - MomPer)) - 1)


Most Anchored Momentum w/ Exponential Smoothing

MomPer := Input("Momentum Periods",1,1000,10);

SmaPer := Input("Simple Moving Average Periods",1,1000,7);

EmaPer := Input("Exponential Moving Average Periods",1,1000,7);

100 * ((Mov(CLOSE, EmaPer, E) / Mov(CLOSE, (2 * MomPer) + 1, S) ) - 1)


Most Anchored Momentum

MomPer := Input("Momentum Periods",1,1000,10);

SmaPer := Input("Moving Average Periods",1,1000,7);

100 * ((CLOSE / Mov(CLOSE, (2 * MomPer) + 1, S) ) - 1)

Drag any of the above indicators from the Indicator QuickList to the desired chart. MetaStock 6.5 will prompt you to enter values for the specified parameters. If you have an earlier version of MetaStock, you will need to enter values in the following formulas instead of using the MomPer, SmaPer, and EmaPer variables.

General Anchored Momentum w/ Exponential Smoothing

100 * ((Mov(CLOSE, EMAPer, E) / Ref(Mov(CLOSE, SmaPer, S), ((SmaPer - 1)/2)- MomPer)) - 1)


General Anchored Momentum

100 * ((CLOSE / Ref(Mov(CLOSE, SmaPer, S), ((SmaPer - 1)/2) - MomPer)) -1)


Most Anchored Momentum w/ Exponential Smoothing

100 * ((Mov(CLOSE, EmaPer, E) / Mov(CLOSE, (2 * MomPer) + 1, S) ) - 1)


Most Anchored Momentum

100 * ((CLOSE / Mov(CLOSE, (2 * MomPer) + 1, S) ) - 1)

MetaStock Formula - Double Tops and Double Bottoms

In the February 1998 issue of Technical Analysis of Stocks & Commodities magazine, Thomas Bulkowski discusses the use of Double Bottoms as a means of finding profitable trades. 

In MetaStock for Windows, you can find both Double Tops and Double Bottoms with these formulas.  There is a caveat however.  In the article, Mr. Bulkowski utilizes the High-Low range in finding Double Bottoms.  These formulas use only the close value, so a few of the lower priced issues will not produce signals in MetaStock.   Overall, however, these formulas produce most of the major signals he discusses.

 
Double Tops

PK:=Zig(C,10,%)<Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)>Ref(Zig(C,10,%),-2);

TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)<Ref(Zig(C,10,%),-2);

PK1:=PeakBars(1,C,10);

PK2:=PeakBars(2,C,10);

(ValueWhen(1,PK,Ref(C,-1))/ValueWhen(2,PK,Ref(C,-1))>.96 AND ValueWhen(1,PK,Ref(C,-1)) / ValueWhen(2,PK,Ref(C,-1))<1.04) AND PK2-PK1>=10 AND Cross(ValueWhen(1,TR,Ref(C,-1)),C) 


Double Bottoms

PK:=Zig(C,10,%)<Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)>Ref(Zig(C,10,%),-2);

TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)<Ref(Zig(C,10,%),-2);

TR1:=TroughBars(1,C,10);

TR2:=TroughBars(2,C,10);

(ValueWhen(1,TR,Ref(C,-1))/ValueWhen(2,TR,Ref(C,-1))>.96 AND ValueWhen(1,TR,Ref(C,-1)) / ValueWhen(2,TR,Ref(C,-1))<1.04) AND TR2-TR1>=10 AND Cross(C,ValueWhen(1,PK,Ref(C,-1)))

MetaStock Formula - Adaptive Moving Average

In MetaStock 6.5 you can easily create the Perry Kaufman Adaptive Moving Average system. With MetaStock 6.5 running, choose Indicator Builder from the Tools menu and then click on the New button. Enter the following formulas.

Adaptive Moving Average Binary Wave

Periods := Input("Time Periods",1,1000, 10);

Direction := CLOSE - Ref(Close,-periods);

Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);

ER := Abs(Direction/Volatility);

FastSC := 2/(2 + 1);

SlowSC := 2/(30 + 1);

SSC := ER * (FastSC - SlowSC) + SlowSC;

Constant := Pwr(SSC,2);

AMA := If(Cum(1) = periods +1, ref(Close,-1) + constant * (CLOSE - ref(Close,-1)),Prev + constant * (CLOSE - PREV));

FilterPercent := Input("Filter Percentage", 0,100,15)/100;

Filter := FilterPercent * Std(AMA - Ref(AMA,-1),Periods);

AMALow := If(AMA < Ref(AMA,-1),AMA,PREV);

AMAHigh := If(AMA > Ref(AMA,-1),AMA,PREV);

If(AMA - AMALow > Filter, 1 {Buy Signal}, If(AMAHigh - AMA > Filter, -1 {Sell Signal}, 0 {No_Signal}))

 
Adaptive Moving Average

Periods := Input("Time Periods",1,1000, 10);

Direction := CLOSE - Ref(CLOSE,-periods);

Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);

ER := Abs(Direction/Volatility);

FastSC := 2/(2 + 1);

SlowSC := 2/(30 + 1);

SSC := ER * (FastSC - SlowSC) + SlowSC;

Constant := Pwr(SSC,2);

AMA := If(Cum(1) = periods +1, ref(Close,-1) + constant * (CLOSE - ref(Close,-1)),Prev + constant * (CLOSE - PREV));

AMA

If you want to see the Adaptive Moving Average, just plot it on any chart. If you want to see the buy and sell signals of the Adaptive Moving Average system plot the Adaptive Moving Average Binary wave. This binary wave plots a 1 when there is a buy signal, a –1 when there is a sell signal and a zero when there is no signal.

MetaStock Formula - Automatic Support and Resistance

Copied from Technical Analysis of Stocks and Commodities Magazine. This is in regards to an article on page 51 of the May 1998 issue.

In my article "Automatic support and resistance" in this issue, I present a computerized approach to finding support and resistance levels on a chart. To recreate the indicators and system described in my article using MetaStock for Windows, enter the following formulas:

Indicators:

S1: IF(Ref(LOW,-4)=LLV(LOW,9),Ref(LOW,-4),PREVIOUS)
S2: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S1"),-1))
S3: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S2"),-1))
S4: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S3"),-1))
S5: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S4"),-1))
S6: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S5"),-1))

WSO: 100*(1­(Int(Fml("S1")/CLOSE)+Int(Fml("S2")/CLOSE)+Int(Fml("S3")/CLOSE)+Int(Fml("S4")/CLOSE) +Int(Fml("S5")/CLOSE)+Int(Fml("S6")/CLOSE))/6)

R1: IF(Ref(HIGH,-4)=HHV(HIGH,9),Ref(HIGH,-4),PREVIOUS)
R2: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R1"),-1))
R3: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R2"),-1))
R4: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R3"),-1))
R5: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R4"),-1))
R6: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R5"),-1))

WRO: 100*(1­(Int(Fml("R1")/CLOSE)+Int(Fml("R2")/CLOSE) +Int(Fml("R3")/CLOSE)+Int(Fml("R4")/CLOSE) +Int(Fml("R5")/CLOSE)+Int(Fml("R6")/CLOSE))/6)

The indicators S1 through S6 and R1 through R6 should be plotted as points and not as a continuous line.


Trading System Formulas and Parameters:
Enter long positions on either building support or sustained uptrend and exit position using stops. No short positions.

Enter Long: Fml("WSO") > Mov( Fml("WSO") , 4 , S ) OR Mov( Fml("WRO") , 30 , S ) > 95


Stop Out:

Breakeven stop: Floor level at 2%

Trailing stop: Profit risk of 10 Percent, ignoring 10 periods

Maximum loss stop: Maximum loss of 7%


Other Conditions:

Initial equity = 1000, Long positions only, Trade price = close, Trade delay = 0, Entry commission = 0%, Exit commission = 0%, , Interest rate = 5%, Margin req. 100%

MetaStock Formula - Muted Variables, Volatility, and a New Market Paradigm

Mutated Variables, Volatility and a New Market Paradigm by Walter T. Downs, Ph.D.

In MetaStock for Windows 6.0 or higher, use the Expert Advisor to create highlights, which will show when contraction and expansion phases are present. First, choose Expert Advisor from the tools menu in MetaStock. Create a new Expert with the following highlights:

Expert name: New Market Paradigm

Highlights

  • Name: Contraction
  • Condition: BBandTop(CLOSE,28,SIMPLE,2)< Ref(BBandTop(CLOSE,28,SIMPLE,2),-1) AND
    BBandBot(CLOSE,28,SIMPLE,2)>Ref(BBandBot(CLOSE,28,SIMPLE,2),-1)
  • Color: Blue
  • Name: Expansion
  • Condition: BBandTop(CLOSE,28,SIMPLE,2)> Ref(BBandTop(CLOSE,28,SIMPLE,2),-1) AND
    BBandBot(CLOSE,28,SIMPLE,2)<Ref(BBandBot(CLOSE,28,SIMPLE,2),-1)
  • Color: Red

Click OK to save the changes to the Expert. Open a chart and then click your right-mouse button while pointing at the chart heading. Choose Expert Advisor and then choose Attach from the chart shortcut menu. Choose the New Market Paradigm Expert and then click the OK button. The price bars in the chart will be highlighted blue during a contraction phase and red in an expansion phase.

MetaStock Formula - Channel Analysis

Channel Analysis, beginning on page 18 of the July 1998 Technical Analysis of Stocks & Commodities Magazine It's quite easy to create the Trend Channels discussed in Thom Hartle's Channel Analysis article in MetaStock for Windows.

After opening a chart, you may want to zoom in a little to make it easier to draw the Trend Channels more precisely. You can do this by clicking on the "+" button located on the Chart Toolbar at the bottom of the chart. Next you may want to identify the bars for the support or resistant points by drawing circles on the bars as Mr. Hartle did in the article, or you can use symbols from the symbol palette.

Both can be chosen from the Drawing Toolbar which is on left side of the chart. After identifying the points to draw the trendline, click on the Trendline button, also located on the Drawing Toolbar, and draw the trendline between the closing prices of the two bars. If you are using MetaStock 6.5, you may want to right-click on the trendline, choose properties, and then check the Snap to Price checkbox. This will make the trendline line up exactly with the closing prices.

To create the second trendline of the Trend Channel, right-click on the first trendline and choose Create Parallel Line. Drag this parallel line so it aligns with the highest high between the two support points or the lowest low between two resistance points. If desired, you can go to the properties of each of these trendlines and choose to extend the lines to the right.

MetaStock Formula - A Volatility Trade in Gold

"A Volatility Trade In Gold" by David S. Landry, CTA, Technical Analysis of Stocks & Commodities, page 87.

In this article the author gives formulas for three indicators MetaStock.  The formulas as given will work in all versions of MetaStock.  However, there is an error in the formula the author names Volatility 12 EMA.  The formula should be: Mov((Fml("CONHV4") + Fml("CONHV6") + Fml("CONHV10"))/3,12,e)

Here are formulas for version 6.5 of MetaStock for Windows.  These formulas use Inputs which allow you to select the time periods when you plot the formulas.

David Landry Historical Volatility
Num:=Input("Number Of Periods For Numerator",1,100,4);
Den:=Input("Number Of Periods For Denominator",2,1000,100);
(Log(C/Ref(C,-1)),Num)/Std(Log(C/Ref(C,-1)),Den)
David Landry Average Historical Volatility
Den:=Input("Number Of Periods For Denominator",2,1000,100);
((Std(Log(C/Ref(C,-1)),4)/Std(Log(C/Ref(C,-1)),Den))+(Std(Log(C/Ref(C,-1)),6)/Std(Log(C/Ref(C,-1)),Den))+(Std(Log(C/Ref(C,-1)),10)/Std(Log(C/Ref(C,-1)),Den)))/3
David Landry EMA of Historical Volatility
Den:=Input("Number Of Periods For Denominator",2,1000,100);
EMA:=Input("Number Of Periods For EMA",2,100,12);
Mov(((Std(Log(C/Ref(C,-1)),4)/Std(Log(C/Ref(C,-1)),Den))+(Std(Log(C/Ref(C,-1)),6)/Std(Log(C/Ref(C,-1)),Den))+(Std(Log(C/Ref(C,-1)),10)/Std(Log(C/Ref(C,-1)),Den)))/3,LastValue(EMA),E)

Note: Standard deviation information was not included here because the way these formulas are being used, any standard deviation being used would return an identical value as 1 standard deviation.

MetaStock Formula - From Terms to Technical Tools

In Walter Downs’ article "From Terms To Technical Tools" he introduces the Point of Balance Oscillator, two conditions to color bars and two system tests. All of these can be created quite easily in MetaStock 6.5. To create the Point of Balance Oscillator, choose Indicator Builder from the Tools menu, click on the New button, and enter the following formula:


Point of Balance Oscillator

n := Input("Time Periods",1,100,12)/2;

POBC1 := (HHV(CLOSE, n) + LLV(CLOSE,n))/2;

POBC2 := (HHV(POBC1, n) + LLV(POBC1,n))/2;

POBC3 := (HHV(POBC2, n) + LLV(POBC2,n))/2;

POBC4 := (HHV(POBC3, n) + LLV(POBC3,n))/2;

POBC5 := (HHV(POBC4, n) + LLV(POBC4,n))/2;

POBC6 := (HHV(POBC5, n) + LLV(POBC5,n))/2;

POBC7 := (HHV(POBC6, n) + LLV(POBC6,n))/2;

POBC8 := (HHV(POBC7, n) + LLV(POBC7,n))/2;

POBC9 := (HHV(POBC8, n) + LLV(POBC8,n))/2;

POBC10 := (HHV(POBC9, n) + LLV(POBC9,n))/2;

AV := (POBC1 + POBC2 + POBC3 + POBC4 + POBC5 + POBC6 + POBC7 + POBC8 + POBC9 + POBC10) / 10;

POBCOsc := 100 * ((CLOSE - AV) / (HHV(CLOSE, 10)-LLV(CLOSE, 10)));

POBCOsc

To highlight bars based on the Bull Fear and Bear Fear conditions discussed in the article, choose Expert Advisor from the Tools menu, click on the New button and enter the following expert:


Bull Fear and Bear Fear Expert

HIGHLIGHTS

  • Name: Bull Fear
  • Condition:
        n := 12 {Time periods};
        BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n);
        CLOSE > BullFear
  • Color: Blue
  • Name: Bear Fear
  • Condition:
        n := 12 {Time periods};
        BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n);
        CLOSE < BearFear
  • Color: Red

To test the two systems discussed in the article, choose System Tester from the Tools menu and enter both of the following systems:


Bull and Bear Fear System Test

SIGNAL FORMULAS

Enter Long:

n := 12 {Time periods};

BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n);

Cross(CLOSE,BullFear)

   
Enter Short:

n := 12 {Time periods};

BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n);

Cross(BearFear,CLOSE)

 
Four-Bar Fear System Test

SIGNAL FORMULAS

Enter Long:

n := 12 {Time periods};

BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n);

BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n);

Cross(CLOSE,BullFear) AND Ref(Sum(CLOSE < BullFear AND CLOSE > BearFear,4),-1) = 4

  
Close Long:

LOW < Ref(LLV(LOW,3),-1)

  
Enter Short:

n := 12 {Time periods};

BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n);

BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n);

Cross(BearFear,CLOSE) AND Ref(Sum(CLOSE < BullFear AND CLOSE > BearFear,4),-1) = 4

  
Close Short:

HIGH > Ref(HHV(HIGH,3),-1)

After entering the systems click on the Options button in the System Tester dialog, go to the Testing tab and change the Trade Price to Open and set the Trade delay to one.

Following is the formula for the moving averages discussed in the article, but not contained in the Traders Tip published in TASC. Please note, this formula will plot all three moving averages, but will not plot them in three different colors.

TP:=Input("Time Periods",1,100,12);

BLF:=((HHV(H,TP)+LLV(H,TP))/2);

BRF:=((HHV(L,TP)+LLV(L,TP))/2);

POB:=((BLF-BRF)/2)+BRF;

BLF;

BRF;

POB

MetaStock Formula - Simple Moving Average with Resistance and Support

In this issue, Dennis L.Tilley uses support and resistance to confirm price and SMA crossover signals in his article "Simple Moving Average with Resistance and Support".

In MetaStock for Windows, you can easily recreate the SMARS Indicators discussed in Tilley's article. First, choose Indicator Builder from the Tools menu in MetaStock 6.5. Next, choose New and enter the following formulas:

Resistance and Support

LookBack := Input("Look Back Periods",1,1000,10);

Resistance :=ValueWhen(1,Cross(Mov(C, LookBack, S),C),HHV(H, LookBack));

Support :=ValueWhen(1,Cross(C,Mov(C, LookBack, S)),LLV(L, LookBack));

Resistance;

Support;


Resistance and Support * F

PrCnt:=Input("Percentage",0,100,10);

LookBack:= Input("Look Back Periods",1,1000,10);

Resistance:=ValueWhen(1,Cross(Mov(C,LookBack,S),C),HHV(H,LookBack));

Support:=ValueWhen(1,Cross(C,Mov(C,LookBack,S)),LLV(L,LookBack));

Resistance * ((100-prcnt)/100);

Support * ((prcnt/100)+1);


Note* It is much easier to see the difference between the actual "Resistance and Support" lines and the
"Resistance and Support * F " lines if you change the color and/or style of one of them. *

To Display the Indicators in MetaStock 6.5 Drag the "Moving Average" indicator from the Indicator QuickList into the price window. Choose Simple as the method, enter the time periods and then click OK.

Now, drag the "Resistance and Support" indicator from the QuickList into the price window. You will be prompted to enter the "Look Back" periods. You should select the same time periods you used with the "Moving Average".

Finally, drag the "Resistance and Support * F" indicator into the price window. You will be prompted to enter the "Percentage" and the "Look Back" periods. If you would like the indicator to be a 10% difference from the "Resistance and Support" line, you would enter 10. You should select the same time periods you used with the "Moving Average".

Allan McNichol
Equis International

MetaStock Formulas - Combining Statistical and Pattern Analysis Shark – 32

In MetaStock for Windows you can use the Expert Advisor to recreate the "Shark – 32" signals on your charts as discussed in Walter T. Down's article "Combining Statistical and Pattern Analysis".

First, choose Expert Advisor from the Tools menu in MetaStock 6.5. Next, choose New and enter the following formulas:

Name:

Click the Name tab and enter "Shark – 32" in the Name field.


Trends:

Click the Trends tab and enter the following formulas in the Bullish and Bearish fields.

Bullish: Mov(C,5,S)>Mov(C,20,S);

Bearish: Mov(C,5,S)<Mov(C,20,S);


Highlights:

Click the Highlights tab, choose New, and enter "3rd Bar" in the Name field. Now change the color in the Color field to Blue. Finally, enter the following formula in the Condition field, and then choose OK.

Symmetry:=.28;

Apex:=(H+L)/2;

WB:=Ref(H,-2)-Ref(L,-2);

Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,If(Apex <= (Ref(H,-2)-(WB*Symmetry)) AND Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

Shark;

Using the same method as above, enter the following 2 highlight formulas.

Name: 2nd Bar

Color: Blue

Condition:

Symmetry:=.28;

Apex:=(H+L)/2;

WB:=Ref(H,-2)-Ref(L,-2);

Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,If(Apex <= (Ref(H,-2)-(WB*Symmetry)) AND Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

Ref(Shark,+1)=1;

  
Name: 1st Bar

Color: Blue

Condition:

Symmetry:=.28;

Apex:=(H+L)/2;

WB:=Ref(H,-2)-Ref(L,-2);

Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,If(Apex <= (Ref(H,-2)-(WB*Symmetry)) AND Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

Ref(Shark,+2)=1;


Symbols:

Click the Symbols tab, choose New and enter "Shark Buy" in the Name field. Now enter the following formula in the Condition field.

Symmetry:=.28;

Apex:=(H+L)/2;

WB:=Ref(H,-2)-Ref(L,-2);

Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,If(apex <= (Ref(H,-2)-(WB*Symmetry)) AND Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

Buyok:=Cross(C,ValueWhen(1,Shark=1,Ref(H,-2)));

Chk:=Cum(Buyok)-ValueWhen(1,Shark=1,Cum(Buyok));

ValidChk:=Alert(Shark=1,25);

{Note* The above ValidChk variable makes the Shark signal valid for 25 periods. If the price does not cross above the High value of the base within 25 periods, you will not receive a signal. You can change the number of periods by changing 25 to the number of periods you desire. *}

Buy:= Buyok=1 AND Ref(Chk,-1)=0 AND ValidChk=1;

Buy;

Click the Graphic tab. Change the symbol in the Graphic field to Buy Arrow. Now change the color in the Color field to Green. Finally, type "Buy" in the Label field, and then choose OK.

Using the Same method as above, enter the following Symbol formula.

Name: Shark Sell

Condition:

Symmetry:=.28;

Apex:=(H+L)/2;

WB:=Ref(H,-2)-Ref(L,-2);

Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,If(apex <= (Ref(H,-2)-(WB*Symmetry)) AND Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

Sellok:=Cross(ValueWhen(1,Shark=1,Ref(L,-2)),C);

Chk:=Cum(Sellok)-ValueWhen(1,Shark=1,Cum(Sellok));

ValidChk:=Alert(Shark=1,25);

{Note* The above ValidChk variable makes the Shark signal valid for 25 periods. If the price does not cross below the Low value of the base within 25 periods, you will not receive a signal. You can change the number of periods by changing 25 to the number of periods you desire. *}

Sell:= Sellok=1 AND Ref(Chk,-1)=0 AND ValidChk=1;

Sell;

Symbol: Sell Arrow

Color: Red

Label: Sell

After you have finished creating the Symbol formulas, you can attach the Expert to your chart by choosing Expert Advisor from the Tools Menu. Select the Expert called "Shark – 32" from your list of Experts, choose Attach, and then Close.

MetaStock Formula - Better Bollinger Bands

In an article in Futures Magazine, October 1998, Dennis McNicholl describes the use of Bollinger Bands and provides a means of making them tighter when markets are trending. He calls them Better Bollinger Bands.

Here is the formula for MetaStock 6.5 or higher.

pds:=Input("Periods",2,200,20);
sd:=Input("Standard Deviations",.01,10,2);
alpha:=2/(pds+1);
mt:=alpha*C+(1-alpha)*(If(Cum(1)<pds,C,PREV));
ut:=alpha*mt+(1-alpha)*(If(Cum(1)<pds,C,PREV));
dt:=((2-alpha)*mt-ut)/(1-alpha);
mt2:=alpha*Abs(C-dt)+(1-alpha)*PREV;
ut2:=alpha*mt2+(1-alpha)*PREV;
dt2:=((2-alpha)*mt2-ut2)/(1-alpha);
but:=dt+sd*dt2;
blt:=dt-sd*dt2;
dt;
but;
blt

MetaStock Formula - Dynamic Multiple Time Frames

Here are the formulas described in the 1999 bonus issue of "Technical Analysis of Stocks & Commodities" magazine in the article "Dynamic Multiple Time Frames", p 45. All formulas are written to use daily data. The lines are plotted as described in the article, with the fixed lines only changing their values on the first day of each week.

A sixth formula, Tendency, was added to indicate which way the price will tend to move, based on the relationship between the Friday close and the fixed balance point. This formula plots a value on Thursday and on Friday just in case Friday is a market holiday. On every trading week which includes Friday data, ignore the Thursday value. A value of 1 means prices will tend up first and a value of -1 means they will tend down

Variables were used in places to simplify the formulas and to allow the referencing of certain values in formulas that plot multiple lines.

Dynamic Balance Point

Ref( HHV(H,5)+LLV(L,5)+C, -1)/3


Dynamic BP Steps

WBPS:= Ref( (HHV(H,5)+LLV(L,5)+C)/3,-1);

( WBPS + Ref(WBPS,-5) + Ref(WBPS,-10) + Ref(WBPS, -15) + Ref(WBPS,-20) ) / 5


Fixed Balance Point

day:=DayOfWeek();

FBC:= If(day=1,

If(BarsSince(day=1)>5,

Ref( HighestSince(1,day=2,H) + LowestSince(1,day=2,L)+C,-1)/3,

Ref( HighestSince(1,day=1,H) + LowestSince(1,day=1,L)+C,-1)/3),

If(day=2 AND Ref(day,-1)>1,

If(BarsSince(day=1)>5,

Ref( HighestSince(1,day=2,H) + LowestSince(1,day=2,L)+C,-1)/3,

Ref( HighestSince(1,day=1,H) + LowestSince(1,day=1,L)+C,-1)/3),0));

ValueWhen(1,FBC>0,FBC)


Support & Resistance

day:=DayOfWeek();

WR:= If(day=1,

If(BarsSince(day=1)>5,

Ref( HighestSince(1,day=2,H) - LowestSince(1,day=2,L),-1),

Ref( HighestSince(1,day=1,H) - LowestSince(1,day=1,L), -1)),

If(day=2 AND Ref(day,-1)>1,

If(BarsSince(day=1)>5,

Ref( HighestSince(1,day=2,H) - LowestSince(1,day=2,L),-1),

Ref( HighestSince(1,day=1,H) - LowestSince(1,day=1,L),-1)),0));

WRV:= ValueWhen(1,WR>0,WR);

T1:=Fml("Fixed Balance Point") + (WRV*.5);

T2:=Fml("Fixed Balance Point") + (WRV*.618);

B1:=Fml("Fixed Balance Point") - (WRV*.5);

B2:=Fml("Fixed Balance Point") - (WRV*.618);

T1;

T2;

B1;

B2


Weekly BP Steps

(Peak(1,FmlVar("Fixed Balance Point","FBC"),1) + Peak(2,FmlVar("Fixed Balance Point","FBC"),1) +

Peak(3,FmlVar("Fixed Balance Point","FBC"),1)+

Peak(4,FmlVar("Fixed Balance Point","FBC"),1) +

Peak(5,FmlVar("Fixed Balance Point","FBC"),1) ) / 5


Tendency

If(DayOfWeek()=4 OR DayOfWeek()=5, If((HighestSince(1,Cross(3,DayOfWeek()),H)+

LowestSince(1,Cross(3,DayOfWeek()),L)+C)/3<C,1,-1),0)

MetaStock Formula - "How Smooth is Your Data Smoother?" (Sine-Wave Weighted Moving Average)

The article "How Smooth is Your Data Smoother", by Patrick E. Lafferty, reviews different types of moving averages, including a Sine-Weighted Moving Average. The Sine-Weighted Moving Average can easily be created in MetaStock 6.5 or higher. In MetaStock select the "Indicator Builder" from the "Tools" menu. In the Indicator Builder click "New" and enter the name (shown below in Bold font) in the Name field. Then place the formula (all the text after "FORMULA:" and before "*END OF FORMULA*") in the Formula field in the Indicator Builder:

NAME: Sine-Weighted Moving Average

FORMULA:

PI:=3.1415926;
SD:=180/6;
S1:=Sin(1*180/6)*C;
S2:=Sin(2*180/6)*Ref(C,-1);
S3:=Sin(3*180/6)*Ref(C,-2);
S4:=Sin(4*180/6)*Ref(C,-3);
S5:=Sin(5*180/6)*Ref(C,-4);
Num:=S1+S2+S3+S4+S5;
Den:=Sin(SD)+Sin(2*SD)+Sin(3*SD)+Sin(4*SD)+Sin(5*SD);

Num/Den

Next, click OK and Close out of the Indicator Builder. Open a chart and plot the new formula by dragging it from the Indicator QuickList or by using "Indicators" from the "Insert" menu.

Formula by Cheryl Elton, Equis International

 

Cycle Indicators

Many securities, particularly futures, show a tendency to move in cyclical patterns. Price changes can often be anticipated at key cyclical intervals.

 

Cycle Lines

Description

Cycles allow us to accurately predict events in nature: bird migrations, the tides, planetary movements, etc. You can also use cycle analysis to predict changes in financial markets, although not always with the accuracy found in nature.

We know that prices are a consensus of human expectations. These expectations are always changing, and causing prices to oscillate between overbought and oversold levels. Fluctuations in prices are a natural process of changing expectations and lead to cyclical patterns.

Interpretation

An obvious example of a cyclical pattern is shown in a chart of a sine wave. Although security prices rarely move with this degree of predictability, even a quick glance at many security charts is enough to see evidence of some type of cyclical pattern.

Cycle Line tools allow you to place equally spaced vertical lines on a chart. Since you can control the spacing between the cycle lines, you may be able to visually extrapolate the cycles evident in a plot. If you extend the right margin of a chart, the cycle lines will extend into the future. This can help you anticipate when the next peak or trough of a cycle may occur.

Detrended Price Oscillator

Description

The Detrended Price Oscillator (DPO) is an indicator that attempts to eliminate the trend in prices. Detrended prices allow you to more easily identify cycles and overbought/oversold levels.

The calculation is quite simple; you simply center an x-period moving average by shifting it back x/2 + 1 periods. This centered moving average is then subtracted from the close. The result is an oscillator that crosses above and below zero.

Since the DPO is shifted back "x/2 + 1" periods, the last "x/2 + 1" periods will have no values.

MetaStock Pro prompts you to enter the number of periods. The value entered should be the approximate length of the cycle you wish to identify. Cycles longer than the number of periods you enter will not be shown. The default value is 20.

Interpretation

Long-term cycles are made up of a series of short-term cycles. Analyzing these shorter term components of the long-term cycles can be helpful in identifying major turning points in the longer term cycle. The DPO is helpful in recognizing the underlying cyclical components of the price action.

Fibonacci

Description

Leonardo Fibonacci was an important mathematician who was born in Italy around the year 1170. It is rumored that Fibonacci discovered the relationship of what are now referred to as Fibonacci numbers while studying the Great Pyramid of Giza in Egypt.

Fibonacci numbers are a sequence of numbers in which each successive number is the sum of the two previous numbers:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, etc.

These numbers possess an intriguing number of interrelationships, such as the fact that any given number is approximately 1.618 times the preceding number and any given number is approximately 0.618 times the following number.

Interpretation

MetaStock Pro has four Fibonacci studies: arcs, fans, retracements, and time zones. 

The general interpretation of the Fibonacci studies involves the anticipation of a change in trend as prices near the lines created by the Fibonacci studies.

Arcs
The calculation and interpretation of Fibonacci Arcs is similar to that of Fibonacci Fan Lines. First, a trendline is drawn between two extreme points. MetaStock Pro then draws three arcs, centered on the second extreme point, that intersect the trendline drawn between the two extreme points at the Fibonacci levels of 38.2%, 50.0%, and 61.8%.

The interpretation of Fibonacci Arcs involves looking for, or anticipating, support and resistance as prices approach the arcs. A common technique is to display both Fibonacci Arcs and Fibonacci Fan Lines and to anticipate support/resistance at the points where the Fibonacci studies cross.

The points where the Arcs cross the price data will vary depending on the scaling, because the Arcs are drawn so they always appear circular relative to the computer screen.

Fans
Fibonacci Fan Lines are displayed by first drawing a trendline between two extreme points. MetaStock Pro then draws an invisible vertical line through the second extreme point. This vertical line is then divided at the Fibonacci levels of 38.2%, 50.0%, and 61.8%. Finally, three trendlines are drawn from the first extreme point so they pass through the invisible vertical line at the above three levels. (This technique is similar to the method used to calculate Speed Resistance Lines.)

Retracements
Fibonacci Retracements are displayed by first drawing a trendline between two extreme points (i.e., a significant trough and peak). After selecting Fibonacci Retracement from the Insert menu, a series of up to nine horizontal lines will be drawn at the Fibonacci levels of 0.0%, 23.6%, 38.2%, 50.0%, 61.8%, 100%, 161.8%, 261.8%, and 423.6%. 

After a significant move (either up or down), prices will often rebound and retrace a significant portion (if not all) of the original move. As the price retraces, support and resistance levels will often occur at or near the Fibonacci Retracement levels.

Time Zones
The Fibonacci Time Zones command displays vertical lines at the Fibonacci intervals of 1, 2, 3, 5, 8, 13, 21, 34, etc. The interpretation of Fibonacci Time Zones involves looking for significant changes in price near the vertical lines.

Fourier Transform

Description

It is beyond the scope of this website to provide a full explanation of Fourier analysis. Further information can be found in Technical Analysis of Stocks & Commodities magazine (TASC), Volume One issues #2, #4, and #7; Volume Two issue #4; Volume Three issues #2 and #7 (Understanding Cycles); Volume Four issue #6; Volume Five issues #3 (In Search of the Cause of Cycles) and #5 (Cycles and Chart Patterns); and Volume Six issue #11 (Cycles).

Fourier Transforms were originally developed as an engineering tool to study repetitious (cyclical) phenomena such as the vibration of a stringed musical instrument or an airplane wing during flight.

The complete analysis concept is called spectral analysis. Fast Fourier Transform (FFT) is an abbreviated calculation that computes in seconds rather than minutes. The FFT sacrifices phase relationships and concentrates only on cycle length and amplitude (strength).

The benefit of FFT is its ability to extract the predominate cycle(s) from a series of data (e.g., an indicator or a security's price).

FFTs are based on the principal that any finite, time-ordered set of data can be approximated arbitrarily well by decomposing the data into a set of sine waves. Each sine wave has a specific cycle length, amplitude, and phase relationship to the other sine waves.

Problems occur when applying FFT analysis to security price data because FFTs were designed to be applied to non-trending, periodic data (whereas security price data tends to be trending). This is overcome by "detrending" the data using either a linear regression trendline or a moving average.

Security data is not truly periodic, since securities are not traded on weekends and some holidays. MetaStock Pro removes these discontinuities by passing the data through a smoothing function called a "hamming window."

Interpretation

As stated at the beginning of this section, it is beyond the scope of this website to provide complete interpretation of FFT analysis. The remainder of this section explains the interpretation of MetaStock Pro's Interpreted FFT.

The Interpreted FFT displays an indicator that shows the three predominate cycle lengths and the relative strength (i.e., the relative amplitudes) of the cycles.

The Interpreted FFT indicator is always displayed from the most significant cycle to the least significant cycle. The longer the indicator remains at a specific cycle length, the more predominate it was in the data being analyzed.

Once you know the predominate cycle length, you may want to use it as a parameter for other indicators. For moving averages, use 1/2 of the cycle length for the optimum number of periods. For example, if you know that a security has a 40-day cycle, you may want to plot a 20-day moving average.

MESA Sine Wave Indicator

Description

The MESA Sinewave indicator was developed by recognized cycle specialist John Ehlers.  The MESA Sinewave indicator looks like a sinewave when the market is in a cycle mode and tends to wander when the market is in a trend mode.  The MESA Sinewave indicator anticipates cycle mode turning points rather than waiting for confirmation as is done with most oscillators.  The MESA Sinewave indicator has the additional advantage that trend mode whipsaw signals are minimized.

The Sine Wave indicator was introduced in the November 1996 issue of Technical Analysis of Stocks & Commodities magazine.

Interpretation

The MESA Sinewave indicator consists of two plots - one displaying the Sine of the measured phase angle over the time period parameter and the other the Sine of the phase angle advanced by 45 degrees (called the Lead Sine). Together, the crossings of the Sine and Lead Sine plots give clear advanced indication of cycle mode turning points.

When the MESA Sinewave indicator resembles an actual sine wave, this suggests the market is in a cycle mode. The indicator lines are not well structured when the market is in a trend mode. A buy signal is given when the Sine plot crosses above the Lead Sine plot. A sell signal is given when the Sine plot crosses below the Lead Sine plot. An obvious advantage that the MESA Sinewave indicator has over its “overbought/oversold” counterparts is that it enters and exits much more precisely without giving up a piece of the market’s movement by waiting for confirmation.

When the market is in a trend mode the MESA Sinewave indicator does not resemble a sine wave. In fact, the Sine and Lead Sine plots typically languish in a sideways pattern around zero, running somewhat parallel and distant from each other. The correct trading strategy in the trend mode is to trade the trend. Basic moving average crossovers are helpful for entering and exiting positions in this type of market.

The MESA Sinewave indicator is sensitive to using the correct time period parameter. You can use the Cycle Lines line study to estimate the best time period to use.