METASTOCK FORMULAS
You visit formular pages no : since July, 1, 2002
Click one of the letters below to search for the name of a formula.
<A> <B> <C> <D> <E> <F> <G> <H> <I> <J> <K> <L> <M> <N> <O> <P> <Q> <R> <S> <T> <U> <V> <W> <X> <Y> <Z>

A

1 2 3 Ross Hook
1234's Sell
2 Day Hammer Exploration
21 Day Trigger
25x25 Bond System Metastock Format
5 Day High
52 Week Hi-Lo Exploration
7 Day Rate Of Change Ported From Super Charts
Adaptive Moving Average by Perry Kauffman
ADX And Trendlines
ADX Raw
ADX with Stochastic Signals
Alligator Indicators
Alligator Indicators
Alligator System Modifications
Anti Trigger- LB Raschke (For Metastock v6.5)
Are There Weekly Patterns in the Stock Market?
ATR Custom Indicator
ATR Modified
ATR Trailing Stop Loss
Automatic Support and Resistance
Average Dollar Price Volatility Exploration-Deel
Average Dollar Price Volatility Indicator-Deel
Average-Modified Method

B

Backdating Metastock Explorations
Barnes' Accelleration
Barnes' Adaptive Forecast
Barnes' Moving Average
BDPL Trend Filter
Bearish Engulfing Pattern
Better Bollinger Bands
Bianchi Approach
Biggest Losers
Binary Wave System Test for Metastock
Body Momentum
Bollinger Band Confirmation
Bollinger Band Histogram Karnish
Bollinger Band Hook Up and Hook Down
Bollinger Bands 2
Bollinger Bands Formula 7 Day
Bollinger Band Width
Bollinger Band Width 2
Bollinger Optimised Synergy System
Boomers Buy and Sell
Boomers Trading Signals
Bottom Reversal
BradCCI
Brown's Indicator
Bull Fear/ Bear Fear
Bull Fear/ Bear Fear with DX System
Building Metastock System Tests
Bullish Engulfing Pattern

C

Candle Code
Candle - Hanging Man/Hammer and CCI Trading System
Candle Shadow Support
CCI Spike Trading System
Chande and Kroll's R2 Indicator
Chandlier Exit
Chandelier Exit 2
Chandeleir Exit, version II
Changing Ways Accumulation/Distribution
Changing Ways Accumulation/Distribution
Channel Analysis
Channel Exit with Stop Loss
Cleaning out unwanted stocks from Metastock
Close Above Median Price
CMA
Coding Example
Collection from a Spanish Source
Common Metastock Bar Patterns
Congestion Index
Connors Raschke's Historical Volatility System
Consolidation Breakout, Downside
Consolidation Breakout, Upside
Consolidation Over 16 Weeks
Countback line for Metastock
Create a Gann Swing Expert
Creating Dynamic Vertical Lines
Cross Above 200 MA on Twice Average Volume
Crossing Below 200 Day MA on Double Average Volume
Customisable StochRSI from Nicholas Kormanik
Cyclical System

D

Dahl Oscillator
Dahl Variations
Dave's New System (DNS)
Days Since Crossover
Denvelope
Denvelope (RSI)
DEVSTOP
Displace Indicator Forward
Divergence Between Close and Indicator
Double Inside Day
Double Tops and Double Bottoms
Down 20% on Double Average Volume
DMTF Trading System
Dunnigan Trend
Dunn-Type 1
Dunn-Type 2
Dynamic Multiple Time Frame Indicator
Dynamic Zones

E

ECO - R Krauz
Elliot Oscillator
Elliot Wave Identification
EMA Cross System
End Point Moving Average
Enter 20 Days after MOV Signal
Equivalent to Wilders TR
Excel Confidence %
Excel Confidence %
Expansion Pivots Buy
Expansion Pivots Sell
Experimental Williams Trading System

F

FibboGatto
Fibonacci Ratios and Momentum
Fibonacci Trader- Dynamic Balance Point
Fibonacci Trader-Dynamic Balance Point Step
Fibonacci Trader - Fixed Balance Point
Fibonacci Trader- Fixed Balance Point- REVISED
Fibonacci Trader- Fixed Balance Point Step
Fibonacci Trader- Support and Resistance
Final Plot
Finding Trendiness
Forecast Oscillator
Forecast Oscillator System
Forecast Oscillator System Alternative
Formulas from Stocks and Commodities Magazine
Front Weighted 36 Day Moving Average
Front Weighted 36 Day Moving Average
Full Formula for RSI

G

Gain By %
Gann High Low
Gann Hi-Lo
Gann-Swing
Gann Swing HiLow Activator
Gann Swing Update
Gann-Trend
Gap 1 System
Gap 2 System
Gap 3 System
Gap Days
Gap Trading
Gap Up Formulas
Gap Up System with Delayed Exit
Gilligan's Island Buy
Gilligan's Island Sell
GRII
Guppy MMA Exploration from Trading Tactics, part 2
Guppy MMA Indicators
Guppy's MMA Long
Guppy MMA Oscillator
Guppy's MMA Short

H

Higher Closes
Higher Volume Exploration
Highest High Since Buy Signal
High Low
High Volume

I

Improved Chandeleir Exit
Instantaneous Trendline & Sinewave Indicator as described by John Ehlers
Instantaneous Trendline and Sinewave Indicator
INSYNC Index
Investor Preference Index

J

Jack Landis' Weighted Stochastic
Jeff Cooper 180's Buy
Jeff Cooper 180's Sell
Jeff Cooper Lizards Buy
Jeff Cooper Lizards Sell
Jeff Cooper Slingshots Buy
Jeff Cooper Slingshots Sell
Jeff Cooper Whoops Sell
Jim's Uptrender
John Hunt's Exploration for Metastock

K

Karnish Bollinger Band Histogram Trading System
Kauffman's Adaptive RSI
Krausz's Gann Swing HiLow Activator

L

Linear Regression Slope
Linking Metastock Updates to Excel Files
Lone Ranger
LookBack
LRS-ROC Indicator--another one
LSS Oscillator & Pivot Point

M

MACD Additions
MACD Crossover Buy Signal
MACD Crossover System test in MetaStock, an example of how to create
MACD Custom
MACD Histogram Divergence
MACD Offset
MACD Tops and Bottoms
Mark Brown Band2 Study
Market Pressure - Ultimate
Market Pressure-Ultimate
McClellan Oscillator
McClellan Summation Index
Metastock % Bands Revised
Metastock Adjustable Trading Bands
Metastock Automatic Trendline Formula
Metastock Custom Indicator Moving Averages
Metastock Expert Commentary by Michael Arnoldi
Metastock Formulas from Equis
Metastock SAR Exploration
Metastock-Stocks Closing Above 60 Day High
Mick's Breakout Exploration
Miesal Indicator
Mixed Balance Point Krause Update
Modified 50 Day Moving Average
Modified Williams %R Metastock Indicator
Money Flow Index
MovAvg Asymmetric Volatility Price Bands
Moving Average Channel
Moving Average Crossover---Bullish
Moving Average Crossovers
Moving Average Violated By %
MTF-Fixed Balance Point
MTF Tendency Update
Multipart Formulas
Mutated Variables, Volatility and a New Market Paradigm
My version of Tushar Chande's Vidya using the P variable

N

Natenberg's Volatility
NR4 Formula from Trading Tactics page 100

O

One Day Money Flow
Overbrought/Over Sold

P

Performance Daily
Performance Intra Day and Daily
Persistance of Money Flow
PFE Indicator
Plotting Forward Days
Presto's Magic Box (a tweaked version of the Darvis Box)
Price Action Indicator (PAIN)
Price and Volume Breakout
Pring's Daily KST Buy
Projected Range

Q

R

Rally Gap and Inside Day
Range High
Recursive Moving Trend Average
Recursive Moving Trend Average
Regression Asymmetric Volatile Price Band
Resistance and Support
Resistance and Support *F
ROC Moving Average System Test
RSI and Moving Averages
RSI Divergence
RSI Divergence Exploration
RSI Offset
Ruggerio's Trend

S

Same Direction
Setting up the ADX Template
Shark-32 System, Walter Downs
Shark Pattern
Shifted TSMA Indicator
Short term horizontal trading ranges
Sideways Channels Exploration
Signal Formulas
Sine Weighted Moving Average
Sine-Weighted Moving Average
SIROC Indicator From Elder
Slope of a Linear Regression Line
Special Trix
Stix Indicator
Stochastic and RSI System
Stochastic MA System
Stochastic Momentum
Stochastic Momentum Indicator
StochPVT Indicators
Stoch RSI
Stop Loss Indicator
ST Oscillator
Starc Band
Support and Resistance
Support and Resistance Levels
System Test Examples

T

TASC Trader's Tip: Volatility % Indicator (Dec '97)
Tema PV Binary Wave
Tema PV Binary Wave and Tema QStick Formulas--use of
Tema StochRSI Formula
Three inside Days
Tom Demark's Range Expansion Index
Trading the Trend 1
Trading the Trend 2
Trailing Stop Loss Indicator
Trending Bandini
True Range Formula
True Strength Index
TSF Optimised Trading System for Metastock
TSI and TSI Moving Average

U

Up 20% on Double Average Volume

V

Variable MA Formula- Updated
Vidya 21, 5
Vidya Explanation
Vidya using P variable, version I
Vidya with P variable, version II
Volatility % Indicator
Volatility % Indicator
Volatility Bands as a Long Term Strategy
Volatility Over 16 Weeks
Volume Accumulation Percentage
Volume Based Exploration

W

Weakness In A Strong Trend
Weekly Indicators
Weekly Pivot Point
Weekly Trix Moving Average Test
Wilders ATR From Equis
WillSpread by Larry Williams
Working with DMI
Writing Metastock Explorations
WRO and WSO Indicators

X

Y

Z

Zero Lag EMA
Zero Lag MACD
Zero Lag MACD Trigger Signal
Zig Zag Validity

Page 1

Guppy MMA Oscillator

by Jason Prestwidge

((Mov(CLOSE,3,E)+Mov(CLOSE,5,E)+
Mov(CLOSE,8,E)+Mov(CLOSE,10,E)+
Mov(CLOSE,12,E)+Mov(CLOSE,15,E))-
(Mov(CLOSE,30,E)+Mov(CLOSE,35,E)+
Mov(CLOSE,40,E)+Mov(CLOSE,45,E)+
Mov(CLOSE,50,E)+Mov(CLOSE,60,E)))*10;
(Mov((Mov(CLOSE,3,E)+Mov(CLOSE,5,E)+
Mov(CLOSE,8,E)+Mov(CLOSE,10,E)+
Mov(CLOSE,12,E)+Mov(CLOSE,15,E))-
(Mov(CLOSE,30,E)+Mov(CLOSE,35,E)+
Mov(CLOSE,40,E)+Mov(CLOSE,45,E)+
Mov(CLOSE,50,E)+Mov(CLOSE,60,E)),13,E))*10;0;

Candle Shadow Support

This is a custom - made Formula based on Candlesticks called CANDLE SHADOW SUPPORT - RESISTANCE (by John D. Kontessis) Based on extensive study of the following books "Japanese Candlestick Charting Techniques", S.Nison, 1991 "Beyond Candlesticks" S.Nison, 1994 "Tehcical Analysis" X.E. Kourouklis, METAPUBLICATIONS (in greek language only) As we all know, one of the most important components of a candlestick is its shadow. A candle's shadow tends to get longer as prices get closer to support-resistance levels, as well as when they reach points of change in Trend (e.g. pullbacks or entry in ranging periods). As prices reach a Support level (or when building a support) the candles' lower shadows get longer. Consequently, as prices reach a Resistance Level (or when building a resistance) the candles' upper shadows get longer. The obvious problem that an analyst faces is that such subtle changes are difficult to discern and evaluate by naked eye only.

This problem can be easily solved by using the following two Formulas in Metastock's Indicator Builder. After Opening the "Indicator Builder", choose "New" and name the Formula : "CandleShadow Resistance ", enter the following :

ShadowResistance:=If(OPEN<CLOSE,(HIGH-CLOSE),(HIGH-OPEN));
Mov(ShadowResistance,3,S); {for not so short-term results, use:
Mov(ShadowResistance,10,w)}
and press "ok".

Now let's build the second Formula: After Opening the "Indicator Builder", choose "New" and name the Formula : "CandleShadow Support", enter the following :

ShadowSupport:=If(CLOSE>OPEN,(OPEN-LOW),(CLOSE-LOW)); Mov(ShadowSupport,3,S); {for not so short-term results, use: Mov(ShadowSupport,10,w)} and press "ok".

So far we have built two Formulas, who, after measuring the shadows of the candles in our chart, they "draw" a 3-Day Mov.Average of the size of the shadows (or alternatively a 10day weighted Mov.Average). The first Formula "CandleShadow Resistance" measures the upper shadow and the second Formula "CandleShadow Support" measures the lower shadow. You can always experiment with the type of Mov.Averages (simple, weighted, exponential etc) and the periods used so as to achieve the best "optical" results. Now let's see these Formulas at work. In an UPTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a weakness of the uptrend.(bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a strength of the uptrend. (bullish signal). In a DOWNTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a strength of the downtrend. (bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a weakness of the downtrend. (bullish signal). At your disposal for any questions or comments. John D.

Kontessis

http://users.otenet.gr/~kontesis
www.delphi.com/kontessis
http://groups.yahoo.com/group/greekanalysts  



Common Metastock Bar Patterns


BAR - 3 Higher Highs
H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3)

BAR - 3 Lower Lows & Reversal H
L>Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND
Ref(L,-3)<Ref(L,-4)

BAR - 3 Lower Lows
L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3)

BAR - 5 Lower Lows
L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND
Ref(L,-3)<Ref(L,-4) AND Ref(L,-4)<Ref(L,-5)

BAR - Expansion Buy
If(C > Ref(HHV(C,42),-1) AND H-L >= Ref(HHV((H-L),9),-1),1,0)

BAR - Expansion Sell
If(C < Ref(LLV(C,42),-1) AND (H-L) >= Ref(HHV((H-L),9),-1),1,0)

BAR - Fractal-down
If(LOW < Ref(LOW, -1),1,0) AND If(LOW < Ref(LOW, -2),1,0) AND If(LOW <
Ref(LOW,+1),1,0) AND If(LOW < Ref(LOW,+2),1,0)

BAR - Fractal-up
(If(HIGH > Ref(HIGH, -1),1,0) AND If(HIGH > Ref(HIGH, -2),1,0) AND If(HIGH
> Ref(HIGH, +1),1 ,0)AND If(HIGH > Ref(HIGH,+2),1,0))

BAR - Gap Down
GapDown()

BAR - Gap Up
GapUp()

BAR - H > Yesterday's H
H>Ref(H,-1)

BAR - Highest Bars Ago
HighestBars(CLOSE)

BAR - Highest High Value Bars Ago
HHVBars(CLOSE,50)

BAR - Inside Day + Day 3
Ref(Fml("BAR - Inside Day"),-3)

BAR - Inside Day
HIGH < Ref(HIGH,-1) AND LOW > Ref(LOW,-1)

BAR - Lizard Buy
If(O >= L + ((H-L) * .75) AND C >= L + ((H-L) * .75) AND L <
Ref(LLV(L,9),-1),1,0)

BAR - Lizard Sell
If(O <= L + ((H-L) * .25) AND C <= L + ((H-L) * .25) AND H >
Ref(HHV(H,9),-1),1,0)

BAR - Narrow Range 4
HIGH - LOW < Ref(LLV(H-L,3),-1)

BAR - Narrow Range 7
HIGH - LOW < Ref(LLV(H-L,6),-1)

BAR - O > Yesterday's C
O>Ref(C,-1)

BAR - Outside Day & > C
Outside() AND C>Ref(C,-1)

BAR - Outside Day
HIGH > Ref(HIGH,-1) AND LOW < Ref(LOW,-1)

BAR - Pivot Buy
If(H-L > Ref(HHV((H-L),9),-1) AND ((L <= Mov(C,50,S)) OR Ref(L,-1) <=
Ref(Mov(C,50,S),-1))
AND C > Mov(C,50,S),1,0)

BAR - Pivot Sell
If(H-L > Ref(HHV((H-L),9),-1) AND ((H >= Mov(C,50,S)) OR Ref(H,-1) >=
Ref(Mov(C,50,S),-1))
AND C < Mov(C,50,S),1,0)

BAR - Reaction Day with Volume
ReactionWithVol()

BAR - Reaction Day
Reaction()

BAR - Surprise Day Down
O<Ref(C,-1) AND C>O AND C<Ref(C,-1)

BAR - Surprise Day Up
O>Ref(C,-1) AND C<O AND C>Ref(C,-1)

BAR - Trough Value - 5
Trough(1,CLOSE,5)

BAR - Typical Price
Typical()

(from Walter Lake}

Miesal Indicator

"It's a short term timing tool. It's not worth using for long term
investors. Some have also suggested using periods of 25 or 50 days, though I
use only 10 days. Others have suggested it's very useful when used
in conjunction with Welles Wilder's RSI."

Sum(If(C > Ref(C,-1), +1, If(C < Ref(C,-1), -1, 0)),10)

Entry/Exit signal
buy:
Fml("CCIF-P")>Ref(Fml("CCIF-P"),-1) AND
Cross(Fml("CCIF-P"),-100) OR
Cross(Fml("CCIF-P"),100)

sell:
Fml("CCIF-P")<Ref(Fml("CCIF-P"),-1) AND
Cross(100,Fml("CCIF-P")) OR
Cross(-100,Fml("CCIF-P"))
{horizontal lines @ -100 & +100}

where:
{"CCIF-P" is}
(CCI(8)+CCI(13)+CCI(21))/3

{from Mike Arnoldi}

Mixed Balance Point Krause Update

I have updated some of the code since my last post concerning the TASC
articles written by Robert Krausz. The code now plots on the proper days
(instead of 1 day ahead) and they should also be more efficient to
calculate. These are named different so you should delete the old code after
you have installed the new. I will
also post a follow up with a graphic to show how these plot. Note: the
formulas on the Equis web page WILL NOT calculate for missing days
(Holidays).

from Adam Hefner.
VonHef@email.msn.com


MTF-Fixed Balance Point

name: MTF-Fixed Balance Point

{Multiple Time Frame
"Fixed Balance Point" 4/23/99}

Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
Wt:=If(Dw=1,
{then}(Ref(HighestSince(1,Dw=1,H),-1)+
Ref(LowestSince(1,Dw=1,L),-1) +
Ref(C,-1))/3,
{else}0);
DwP:=ValueWhen(1,Wt>0,Wt);
Dwp


name: MTF-Fixed Balance Point Step

{Multiple Time Frame
"Fixed Balance Point Step" 4/23/99}

Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
Wt:=If(Dw=1,
{then}(Ref(HighestSince(1,Dw=1,H),-1)+
Ref(LowestSince(1,Dw=1,L),-1) +
Ref(C,-1))/3,
{else}0);
DwPs:=(ValueWhen(1,Wt>0,Wt)+
ValueWhen(2,Wt>0,Wt)+
ValueWhen(3,Wt>0,Wt)+
ValueWhen(4,Wt>0,Wt)+
ValueWhen(5,Wt>0,Wt))/5;
Dwps
------------------------------------------------

name: MTF-Dynamic Balance Point

{Multiple Time Frame
Dynamic Balance Point 4/23/99}
dt:=DayOfWeek();
dc:=If(Dt=1,BarsSince(Ref(dt,-1)=1)+1,
If(Dt=2,BarsSince(Ref(dt,-1)=2)+1,
If(Dt=3,BarsSince(Ref(dt,-1)=3)+1,
If(Dt=4,BarsSince(Ref(dt,-1)=4)+1,
BarsSince(Ref(dt,-1)=5)+1))));
DBC:=If(dc=5,
{then}(Ref(HighestSince(5,dt,H),-1)+
Ref(LowestSince(5,dt,L),-1)+
Ref(CLOSE,-1))/3,
{else}(Ref(HighestSince(4,dt,H),-1)+
Ref(LowestSince(4,dt,L),-1)+
Ref(CLOSE,-1))/3);
DBC
------------------------------------------------

name: MTF-Dynamic Balance Point Step

{Multiple Time Frame
Dynamic Balance Point Step 4/23/99}
Dr:= FmlVar("MTF-Dynamic Balance Point","DBC");
Dsc:=(ValueWhen(1,Dr,Dr)+
ValueWhen(5,Dr,Dr)+
ValueWhen(10,Dr,Dr)+
ValueWhen(15,Dr,Dr)+
ValueWhen(20,Dr,Dr))/5;
Dsc
--------------------------------------------------

name: MTF-S&R

{Multiple Time Frame
"Weekly Support & Resistance" 4/23/99}

Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
Wt:=If(Dw=1,
{then}(Ref(HighestSince(1,Dw=1,H),-1)+
Ref(LowestSince(1,Dw=1,L),-1) +
Ref(C,-1))/3,
{else}0);
Wh:=If(Dw=1,
{then}Ref(HighestSince(1,Dw=1,H),-1),
{else}0);
Wl:=If(Dw=1,
{then}Ref(LowestSince(1,Dw=1,L),-1),
{else}0);
Wr:=ValueWhen(1,Wh>0,Wh)-ValueWhen(1,Wl>0,Wl);
DwP:=ValueWhen(1,Wt>0,Wt);
RR1:=DwP+(Wr*.5);
RR2:=DwP+(Wr*.618);
SR1:=DwP-(Wr*.5);
SR2:=DwP-(Wr*.618);
SR2;
SR1;
RR1;
RR2;
---------------------------------------

name: MTF-Tendency

Mt:=If(DayOfWeek()=1,
Ref(C,-1)- FmlVar("MTF-Fixed Balance Point","DWP"),
0);
If(Mt>0,1,If(Mt<0,-1,0))
---------------------------------------



Weekly Indicators

MetaStock Weekly Indicators

I had basically put the weekly indicators on daily charts thing on the back
burner for the time being, but someone mentioned the subject in an off list
e-mail, and I decided that maybe I should post these two
indicators. They look right to me, but double check them. Remember, they
plot the previous weeks value beginning the first trading day of the
following week, and that value remains constant throughout that
week. These are designed for backtesting.....so if you just gotta know on
this Friday evening what the weekly value of the indicator is going to be
for the following week, simply look a weekly chart.

Stochastic: The %K and %K slowing can be coded to accommodate more
parameters by using the user Input function, but when you do this the %D
always calculates using the default value of the %K slowing, giving
erroneous values. So I just left it as is. Youcan plug in your own
values...I just used the MetaStock default values as a starting point. I
made the %K D as two separate indicators so that you can plot the %D a
different color and/or dashed. The Momentum indicator uses the Input
function just fine.


{`Wkly Stoch 5 per %K, slowing=3, no %D}

{start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
yestClo:=If(sw>0,Ref(C,-1),0);

{lowest low last 5 weeks}
LLow:=(ValueWhen(1,sw>0,
Ref(LowestSince(5,sw>0,L),-1)));

{highest high last 5 weeks}
HHigh:=(ValueWhen(1,sw>0,
Ref(HighestSince(5,sw>0,H),-1)));


{5 per %K, lowing=3}
y:=(ValueWhen(1,sw>0,(yestClo-LLow))+
ValueWhen(2,sw>0,(yestClo-LLow))+
ValueWhen(3,sw>0,(yestClo-LLow)))/

((ValueWhen(1,sw>0,HHigh)+
ValueWhen(2,sw>0,HHigh)+
ValueWhen(3,sw>0,HHigh))-

(ValueWhen(1,sw>0,LLow)+
ValueWhen(2,sw>0,LLow)+
ValueWhen(3,sw>0,LLow)))*100;
y;


=====================
{`Wkly Stoch 3 per %D of a 5 per %K, slowing=3}

{start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
yestClo:=If(sw>0,Ref(C,-1),0);

{lowest low last 5 weeks}
LLow:=(ValueWhen(1,sw>0,
Ref(LowestSince(5,sw>0=1,L),-1)));

{highest high last 5 weeks}
HHigh:=(ValueWhen(1,sw>0,
Ref(HighestSince(5,sw>0,H),-1)));


{5 per %K, slowing=3}
y:=(ValueWhen(1,sw>0,(yestClo-LLow))+
ValueWhen(2,sw>0,(yestClo-LLow))+
ValueWhen(3,sw>0,(yestClo-LLow)))/

((ValueWhen(1,sw>0,HHigh)+
ValueWhen(2,sw>0,HHigh)+
ValueWhen(3,sw>0,HHigh))-

(ValueWhen(1,sw>0,LLow)+
ValueWhen(2,sw>0,LLow)+
ValueWhen(3,sw>0,LLow)))*100;

{This plots the 3 period %D (ma) of the above.}
z:=(ValueWhen(1,sw>0,y)+ValueWhen(2,sw>0,y)+
ValueWhen(3,sw>0,y))/3;
z
========================

{`Wkly Momentum for DAILY Chart }

{This plots WEEKLY Momentum on DAILY charts. -Ken 4/16/99}

n:=Input("Periods",1,20,10);
{start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);

(ValueWhen(1,sw>0,Ref(C,-1))/
ValueWhen(n+1,sw>0,
Ref(C,-1)))*100


from  Ken


M odified Williams %R Metastock Indicator

by Rajat Bose

Periods := Input("Time Period", 3,50,5);
NumDev := Input("No. of Standard Deviations", 1,5,2);

(100*(C-BBandBot(C, Periods, S, NumDev))/((( BBandTop(C, Periods, S,
NumDev))-(BBandBot(C, Periods, S, NumDev)))))

{All I have done here is to substitute High and Low of any bar with that of
Bollinger Band Top and Bollinger Band Bottom. I have tested it on various
time periods (for Bollinger Bands) using 2 standard deviations. It sometimes
gives an early indication of reversals than the Williams %R of the same
period. Divergences have also been somewhat better. However, the structure
shows that most of its properties are similar to those of the Williams %R
or, for that matter, of any other overbought-oversold indicator.}

Guppy MMA Indicators

(Note this is not the same as the formula given in Trading Tactics. Daryl Guppy)


Try MMA (Multiple Moving Averages). The shorter ones are closer to the
action and the longer ones tell you about the trend. I use two indicators
like this:

Name: MMA Long Term
--------
Mov(C,40,E);
Mov(C,45,E);
Mov(C,50,E);
Mov(C,55,E);

Name: MMA Short Term
--------
Mov(C,5,E);
Mov(C,8,E);
Mov(C,11,E);
Mov(C,14,E);


In the current market I like taking short momentum trades where the MMA
Short is bouncing up off a slowly rising MMA Long Term. The exit at the top
of the bubble is indicated by MMA Short turning down after a good separation
from the underlying MMA Long.

from Jeff Lederman.

{Suggestion: Create a single TEMPLATE with all the above indicators, giving
SHORT and LONG MMAs separate colours; e.g., RED for the SHORTs and BLUE for
the LONGs.}

G ann Swing Update

This is an update to Gann-Swing indicators I had posted several months
back. Most of the code has been improved and I have modified the swing
definition slightly.

Gann Weekly Expert Instructions

1. First create a new expert and name it whatever you want.
2a. under "trends" tab put this code for bullish:
ut:=FmlVar("GANN-Trend","TDV");
uplot:=If(BarsSince(Ut=1)<
BarsSince(Ut=-1),1,0);
uplot=1;
2b. and this for bearish:
dt:=FmlVar("GANN-Trend","TDV");
dplot:=If(BarsSince(dt=1)>
BarsSince(dt=-1),1,0);
dplot=1;
Then click on the "ribbon" option and turn off "Display Vertical Lines", I
also turn off
the corner option.
3a. Under highlights tab create a new and call it "HiLo Change", choose
color, and enter this code:
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);
HLv<>Ref(HLv,-1);
3b. Create new and call it "Up-Trend", choose color, and enter this code:
ut:=FmlVar("GANN-Trend","TD");
uplot:=If(BarsSince(Ut=1)<
BarsSince(Ut=-1),1,0);
uplot=1;
3c. Create new and call it "Down-Trend", choose color, and enter this code:
dt:=FmlVar("GANN-Trend","TD");
dplot:=If(BarsSince(dt=1)>
BarsSince(dt=-1),1,0);
dplot=1;
4a. Under "Symbols" tab create new and call it " UpSwing", enter this code:
FmlVar("GANN-Swing","SD2")=1;
then under graphic choose "Buy Arrow", choose color (Dark Green), and small
size, then pick "Above Price Plot".
4b. Create new and call it "DownSwing", enter this code:
FmlVar("GANN-Swing","SD2")=-1;
then under graphic choose "sell arrow", choose color (Dark Red), and small
size, then pick "Below Price Plot".
As for the HiLo ....just plot it as a regular indicator and choose the last
"style" option under "color/style" tab.

Note: For daily bar charts ribbon use these formulas:

2a. ut:= FmlVar("GaW-Trend","TDV") ;
uplot:=If(BarsSince(Ut=1)<
BarsSince(Ut=-1),1,0);
uplot=1;

2b. dt:= FmlVar("GaW-Trend","TDV") ;
dplot:=If(BarsSince(dt=1)>
BarsSince(dt=-1),1,0);
dplot=1;

from Adam Hefner.

------------------------------------------------------
name: GANN-HiLo

{HiLo 4/27/99}
Lb:=Input("Look-Back Periods?",2,10,3);
HLd:=If(CLOSE>Ref(Mov(H,Lb,S),-1),
{then}1,
{else}If(CLOSE<Ref(Mov(L,Lb,S),-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}Mov(H,Lb,S),
{else}Mov(L,Lb,S));
HiLo;
------------------------------------------
name: GANN-Swing

{Gann-Swing 4/27/99}
{Market swing is defined as:
Up = 2 higher highs,
Down = 2 lower lows.}
Us:=BarsSince(Sum(H>Ref(H,-1),2)=2);
Ds:=BarsSince(Sum(L<Ref(L,-1),2)=2);
Hc:=HighestSince(1,Us=0,H);
Lc:=LowestSince(1,Ds=0,L);
Sd1:=If(Us=0,
{then}If((L<>Lc) AND (Ref(L,-1)<>Lc),
{then}1,
{else}0),
{else}If(Ds=0,
{then}If((H<>HC) AND (Ref(H,-1)<>Hc),
{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;
--------------------------------------------
name: GANN-Trend

{Gann-Trend 4/27/99}
{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
------------------------------------------
name: GaW-Swing

{Weekly Swing 4/27/99}
{Market swing is defined as:
Up = 2 higher highs,
Down = 2 lower highs }
{Weekly High/Low}
Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
Wh:=If(Dw=1,
{then}Ref(HighestSince(1,Dw=1,H),-1),
{else}0);
Wl:=If(Dw=1,
{then}Ref(LowestSince(1,Dw=1,L),-1),
{else}0);
Hv1:=ValueWhen(1,Wh>0,Wh);
Hv2:=ValueWhen(2,Wh>0,Wh);
Hv3:=ValueWhen(3,Wh>0,Wh);
Lv1:=ValueWhen(1,Wl>0,Wl);
Lv2:=ValueWhen(2,Wl>0,Wl);
Lv3:=ValueWhen(3,Wl>0,Wl);
Us:=BarsSince((Hv1 > Hv2) AND (Hv2 > Hv3));
Ds:=BarsSince((Lv1 < Lv2) AND (Lv2 < Lv3));
Hc:=Ref(HighestSince(1,Us=0 AND Ref(Us,-1)>0,H),
-1);
Lc:=Ref(LowestSince(1,Ds=0 AND Ref(Ds,-1)>0,L),
-1);
{Swing direction Calculation}
Sd1:=If(Us=0 AND Dw=1,
{then}If((Lv1<>Lc) AND (Lv2<>Lc),
{then}1,
{else}0),
{else}If(Ds=0,
{then}If((Hv1<>Hc) AND (Hv2<>Hc),
{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
-------------------------------------------
name: GaW-Trend

{Weekly Trend 4/27/99}
{Swing Direction}
Sd:= FmlVar("GaW-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



Stop Loss Indicator

periodsshort:=Input("periods if short",1,50,10); periodslong:=input("periods
if long",1,50,10);

HHV(H,periodsshort)-atr(periodsshort);{stop loss level for short positions}
LLV(L,periodslong)+ATR(periodslong);{stop loss level for long positions}

{by Eric Kendall}

Gap Up Formulas

The MetaStock formulas to calculate these percentages are shown below. The
first input is the minimum gap (e.g., 1%), and the second input is the gap
increment (e.g., 1%, which would give you a range of 1-2%). To calculate
gaps down, change the percentage to a negative.

Formula to determine whether the closing price is equal to or exceeds the
opening price on a gap day:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

{ Gap percentage }
Gap := (OPEN - Ref(CLOSE,-1))/Ref(CLOSE,-1)*100;

NumGaps := If(LookingForGapUp, Cum(Gap >= MinGap AND Gap < MinGap +
GapIncrement), If(LookingForGapDown, Cum(Gap <= MinGap AND Gap > MinGap -
GapIncrement),0));

If(LookingForGapUp, Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement,
If(CLOSE >= OPEN, +1,0),0)),

If(LookingForGapDown, Cum(If(Gap <= MinGap AND Gap > MinGap - GapIncrement,
If(CLOSE <= OPEN, +1, 0),0)), 0))/NumGaps*100;

Formula to determine whether the daily range crosses the previous day’s
close on a gap day:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

{ Gap percentage }
Gap := (OPEN - Ref(CLOSE,-1))/Ref(CLOSE,-1)*100;

NumGaps := If(LookingForGapUp, Cum(Gap >= MinGap AND Gap < MinGap +
GapIncrement), If(LookingForGapDown, Cum(Gap <= MinGap AND Gap > MinGap -
GapIncrement),0));

If(LookingForGapUp, Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement,
If(LOW <= Ref(CLOSE,-1), +1,0),0)),

If(LookingForGapDown, Cum(If(Gap <= MinGap AND Gap > MinGap - GapIncrement,
If(HIGH >= Ref(CLOSE,-1), +1, 0),0)), 0))/NumGaps*100;

Formula to determine whether the following day’s open continues the gap
trend:

MinGap := Input("Minimum gap to consider (%)",-10000,10000,1);
GapIncrement := Input("Gap Increment (%)",0,100,1);

LookingForGapUp := MinGap >= 0; LookingForGapDown := MinGap < 0;

GapYesterday := (Ref(OPEN,-1) - Ref(CLOSE,-2))/Ref(CLOSE,-2)*100;

NumGapsthruYesterday := If(LookingForGapUp, Cum(GapYesterday >= MinGap AND
GapYesterday < MinGap + GapIncrement), If(LookingForGapDown,
Cum(GapYesterday <= MinGap AND GapYesterday > MinGap - GapIncrement),0));

If(LookingForGapUp, Cum(If(GapYesterday >= MinGap AND GapYesterday < MinGap
+ GapIncrement, If(OPEN > Ref(CLOSE,-1), +1,0),0)),

If(LookingForGapDown, Cum(If(GapYesterday <= MinGap AND GapYesterday >
MinGap - GapIncrement, If(OPEN < Ref(CLOSE,-1), +1, 0),0)),
0))/NumGapsthruYesterday*100;

{by Jon DeBry}

Page 2

Fibonacci Trader-Dynamic Balance Point Step

DPS:=(ValueWhen(1,FmlVar("FT-DBP","DBC"),
FmlVar("FT-DBP","DBC"))+
ValueWhen(5,FmlVar("FT-DBP","DBC"),
FmlVar("FT-DBP","DBC"))+
ValueWhen(10,FmlVar("FT-DBP","DBC"),
FmlVar("FT-DBP","DBC"))+
ValueWhen(15,FmlVar("FT-DBP","DBC"),
FmlVar("FT-DBP","DBC"))+
ValueWhen(20,FmlVar("FT-DBP","DBC"),
FmlVar("FT-DBP","DBC")))/5;
DPS;
{created by Adam Hefner 9-1-99}

MACD Crossover System test in MetaStock,
an example of how to create


Enter Long:
Mov(C,5,E) > Mov(C,13,E)
AND Mov(C,13,E) > Mov(C,40,E)

Close Long:
Cross(Mov(C,13,E),Mov(C,5,E))

Now you can play with these combinations on both the enter long and close long side. For example,
keep the same Enter Long but change the Close Long to =

Cross(Mov(C,40,E) ,Mov(C,5,E) )

This will keep you in the trade longer. You may want to enter when the 5 crosses above the 13 and not wait for the 40 OR, you may just want to use the 5 cross above the 40 and forget about the 13.

(created by David Evans)

 

Trending Bandini

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) AND
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)

{created by Brookelise}

 

Elliot Oscillator

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

 

GRII

This is a long formula so I broke it up into four pieces. GRII is derived from formulas 1, 2, and 3.

This is a nifty momentum oscillator that I've used for about five years to help me determine the direction of a given market when I have evidence that the market is about to turn.

test
formula
1 GRIIF1 tsf(C,9)-ref(tsf(C,9),-1)

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

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

4 GRII (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))))

(written by Eddie Kwong)

 

SPECIAL TRIX

This is my own version of the well-known indicator, TRIX. I have had much better results with this than the canned version that comes with every charting program.

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

(created by Eddie Kwong)

 

{Fibonacci Trader - Fixed Balance Point}
{NOTE: under Color/Style options, change
plot to last "style" option}

{Fixed Balance Point Calculation}
FBC:=If(DayOfWeek()=1 AND Ref(DayOfWeek(),-1)
<5,
{then}(HighestSince(2,DayOfWeek()=1,H)+
LowestSince(1,DayOfWeek()=1,L)+
CLOSE)/3,
{else}If(DayOfWeek()=5,
{then}(HighestSince(1,DayOfWeek()=1,H)+
LowestSince(1,DayOfWeek()=1,L)+
CLOSE)/3,
{else}0));
{Fixed Balance Point Plot}
FBP:=ValueWhen(1,FBC>0,FBC);
FBP

{created by Adam Hefner}

Gann Swing HiLow Activator

I was only able to implement Krausz's Gann Swing HiLow Activator in Metastock, because it's simply the average of the last three bars High (stop for short position or long entry) or Low (stop for long position or short entry) plotted one period forward:

Ref(Mov(L,3,S),-1) or Ref(Mov(H,3,S),-1)

(from Thorsten Buhmann in Germany)

 

Tema PV Binary Wave

Use of Tema PV Binary Wave and Tema QStick Formulas in MetaStock, from "JimG"

There are really two different ways to use these formulas. Since the Binary Wave is a smoothed addition of several technical indicators that each give +1 when bullish, 0 when neutral and -1 when negative, it makes sense that a positive number is bullish and rising numbers are bullish. Similarly negative numbers and falling numbers are bearish.

The QStick is really a candlestick type indicator, but can be read as bullish or bearish in same way as the Binary Wave.

The two traditional ways to play them are to buy on a rise from a negative peak and sell on a fall from a positive peak, or to buy on a zero cross over to the upside and sell on a zero crossover to the downside. Of course you can optimize and find various buy and sell levels as long as you understand what is bearish and what is bullish.

My own MetaStock system tests alerts on the BW crossing a moving average of itself and buys or sells on a confirmation of Qstick turning positive or negative respectively. Having said that, I don't make my buy an sell decisions from the indicators or the system test. I do use the system test as an initial screen and use a buy signal as a flag to move the stock to my watch list. I make all buying and selling decisions based on the trend channels. Over the years, I've found that works best for me.

Ruggerio's Trend
Ruggiero's rules for trend mode quoting his table 4.9:

1. If ADX crosses above 25, then the market is trending.
2. If ADX crosses below 20, then the market is consolidating.
3. If ADX crosses below 45 from above, then the market is consolidating.
4. If ADX rises from below 10 on 3 out of 4 days, then the market will start
to trend.
5. If a trend is based on rule 4, it remains in effect until the 5 day
difference in ADX is less than 0.

Ruggiero employs a 14 day ADX but that is based on T-Bonds data. He suggests employing the above rules as a filter. I make the indicator take the value +1 if trending, a -1 if consolidating according to the above criteria but I guess the zero is for the grey area
in between. Anyway according to definition: If a market is not trending it must be consolidating. However the zero may contain additional useful information. Ruggiero suggests tweaking the threshold values.

periods:=Input("Periods?",1,63,14);
If((ADX(periods)>25 AND (BarsSince(Cross(45,ADX(periods))) >
BarsSince(Cross(ADX(periods),25)))) OR (ADX(periods) > 10 AND
Ref(ADX(periods),-4)<10 AND (ADX(periods)-Ref(ADX(periods),-5)>0)), 1,
If(ADX(periods)<20 OR ((BarsSince(Cross(45,ADX(periods))) <
BarsSince(Cross(ADX(periods),25))) AND ADX(periods) < 45),-1,0))

Metastock Automatic 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.

Mike Helmacy www.techanalysis.com

Those who know me have found out I vacillate between the VERY complicated and the very simple. I have been following a few stocks (medium volatility, but good %% moves both up and down over a 2-5 week time frame) and tracking them with about 15 templates on which most of the formulas that I have acquired reside. I wanted to track those that did best and those that were not as effective. I also tracked those formulas that were late in showing turns in momentum vs those that caught the turn close on. In this regard, I was looking for finding stocks at intermediate term lows and highs, NOT for indicators that identified stocks that had begun their run in any direction and were destined to continue. As a result, I came up with a very simple indicator that showed a HIGH degree of accuracy in "turn-calling", but it did NOT give me indication of the strength or duration of the new move, only that it probably would occur. I believe that I have finally discovered that any signal of a change in momentum will NEVER give you a sense of strength or duration BY ITS VERY NATURE, and that only signals that identify stocks WITHIN a momentum trend (ie..already established) are able to do that. My momentum trend change indicator is derived from an intermediate trend indicator I've used for some time in MSWIN 6.0...

PDI(34) - MDI(34)

My new formula is...........

((PDI(8) - MDI(8)) - (PDI(21) - MDI(21))) + (PDI(13) - MDI(13))

Try it......I think you'll like it......and it's the same coding in WOW, I believe..........BW Chan I have posted an update to the RMTA and TOSC formula's, the first formulas had an "Absolute Value" that wasn't called for in the article ( I had mistaken the "[" "]" to mean "|" "|"). The new formulas seem to plot exactly as the old......but I wanted the code to match the math in the article. Thanks go out to William Golson for the help.

 

{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;

{TOSC}

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

TOSC:=RMTA-Mov(C,lb,E);

TOSC;

Best wishes, Adam Hefner e-mail: VonHef@itlnet.net

Is the name of an article in the December issue of TASC, written by Dennis Meyers. In it he describes what he calls " The Recursive Moving Trend Average" . I wont go into all the article right now, but here is my translation of his math (for Metastock 6.5) :

{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*Abs(C+Bot-Ref(Bot,-1)));
RMTA;

He then explains how to make an oscillator by subtracting an Exponential MA form the Recursive MA...... again here is the code:

{TOSC}
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*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
TOSC;

Here is the code for System Testing;
Buy Long:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+
(Alpha*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
Cross(tosc,(0-Abs(ent)))

Sell short:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+
(Alpha*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
Cross((0+Abs(ent)),tosc1)

Opt1 is the look- back periods, of 3 to 30, and Opt2 is the entry value of the oscillator, 0 to 5.
Now, after all the hours spent on figuring out the code, I have discovered that the RMTA plots very similar to the DEMA, oh well............

Adam Hefner. e-mail: VonHef@itlnet.net

Market Pressure - Ultimate

This is the basic calculation:
If toadies close is greater than yesterdays close and
toadies volume is greater than yesterdays volume, write down toadies volume * close, otherwise,
If toadies close is less than yesterdays close and
toadies volume is less than yesterdays volume, write down todays volume as a negative number * close, otherwise write down 0.

Then add up the past 7 days and * 4, add this to
the past 14 days total and * 2, add this to
the past 28 days total.
Plot this grand total in your chart for each new trading day.

Simple Interpretation:
Market Pressure - Ultimate can show divergences with the instrument it is plotted against.
It may show signs of support and resistance when the indicator hits areas of support/resistance on its own graph.
Comparing rates of change/moving averages of the indicator against that of the instrument may reveal accumulation/distribution pressures.

Metastock code for 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)


Changing Ways Accumulation/Distribution

This is the calculation for the first formula (Todays Change):
Todays close - yesterdays close

This is the main formula, incorporating the first calculation:
If todays change (1st formula) is greater than a 7 day exponential moving average of todays change and todays close is greater than yesterdays close, write down todays close + todays volume, otherwise,
If todays change is less than a 7 day exponential moving average of todays change and todays close is less than yesterdays close, write down the negative value of todays close + todays volume, otherwise write down 0.

Then add up all the days values and keep a cumulative running total for each new trading day.

Simple Interpretation:
Changing Ways Accumulation/Distribution can show divergences against the instrument.
When compared against volume activity, it can show what impact a day of high turnover had on the share price for the coming periods. This is to say that if a day had high volume and there was little movement in the indicator alongside this, then you can suggest that all the volume for that day was absorbed into the price and there is less likelihood of buying/selling pressure in that day taking hold in the market in future trading days.

Metastock code for 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)

Page 3

Front Weighted 36 Day Moving Average

This indicator requires 3 sub calculations and then the totalling of all 3 to get the final indicator:

This is the basic calculation:
Take the closing prices of your instrument 34 days ago - 26 days ago (inclusive), multiply each daily value by 0.01 and write each value down.
Then take the closing prices of your instrument 25 days ago - 18 days ago (inclusive), multiply each daily value by 0.02 and write each value down.
Then take the closing prices of your instrument 25 days ago - 18 days ago (inclusive), multiply each daily value by 0.02 and write each value down.
Then take the closing price of your instrument 17 days ago and multiply by 0.03 ad write the value down.
Then take the closing price of your instrument 16 days ago - 8 days ago (inclusive), multiply by 0.031 and write each value down.
Then take the closing price of your instrument 7 days ago - 6 days ago (inclusive), multiply by 0.006 and write each value down.
Then take the closing price of your instrument 5 days ago - 1 day ago (inclusive), multiply by 0.07 and write each value down.
Then take the closing price of your instrument today, multiply by 0.079 and write this value down.

Finally, add up all the values that you wrote down and plot the value on the chart, repeat this for every new trading day.

Simple Interpretation:
Front Weighted 36 Day Moving Average is similar to all other moving averages. The interpretation is just as with all others, the trend is up when prices are above the moving average and the trend is down when prices are below the moving averages. This particular variation attempts to weight the data at the front more than that at the back, with a sliding scale for each trading days value.

Metastock code for Front Weighted 36 Day Moving Average:

Fml( "1FrontWeighted36BarMA1" ) +
Fml( "2FrontWeighted36BarMA2" ) +
Fml( "3FrontWeighted36BarMA3" )

Where Fml( "1FrontWeighted36BarMA1" ) =
0.01 * Ref(P,-34) +
0.01 * Ref(P,-33) +
0.01 * Ref(P,-32) +
0.01 * Ref(P,-31) +
0.01 * Ref(P,-30) +
0.01 * Ref(P,-29) +
0.01 * Ref(P,-28) +
0.01 * Ref(P,-27) +
0.01 * Ref(P,-26) +
0.02 * Ref(P,-25) +
0.02 * Ref(P,-24) +
0.02 * Ref(P,-23) +
0.02 * Ref(P,-22) +
0.02 * Ref(P,-21) +
0.02 * Ref(P,-20) +
0.02 * Ref(P,-19) +
0.02 * Ref(P,-18)

Where Fml( "2FrontWeighted36BarMA2" ) =
0.03 * Ref(P,-17) +
0.031 * Ref(P,-16) +
0.031 * Ref(P,-15) +
0.031 * Ref(P,-14) +
0.031 * Ref(P,-13) +
0.031 * Ref(P,-12) +
0.031 * Ref(P,-11) +
0.031 * Ref(P,-10) +
0.031 * Ref(P,-9) +
0.031 * Ref(P,-8) +
0.006 * Ref(P,-7) +
0.006 * Ref(P,-6) +
0.07 * Ref(P,-5) +
0.07 * Ref(P,-4) +
0.07 * Ref(P,-3) +
0.07 * Ref(P,-2)

Where Fml( "3FrontWeighted36BarMA3" ) =
0.07 * Ref(P,-1) +
0.079 * P

Excel Confidence %

This is the calculation:

Take todays volume * 50 and find the square root of that number. Then divide 2.5 by your result. Then take the result of dividing by 2.5 and * todays close. Write this figure down.
Then plot a 10 day moving average of this figure. This is the fundamental calculation which we shall call a.

Take the value for a and take it away from the lowest value of itself over the past 5 days. Add up these results for the past 3 days. This number is called b.

Now take the highest value for a over the past 5 days and subtract the lowest value for a, also over the past 5 days. Call this number c.

Finally, divide b by c and multiply the answer by 100. (phew!)

Simple Interpretation:
Excel Confidence % should oscillate between 0 and 100, usually at the extreme ends of the scale. A value of 0 indicates no confidence in the market going up, whilst 100 indicates perfect confidence in the market going up. Although this obviously isn't the holy grail of indicators, it does offer some insight into what the market is thinking and how one can measure investor sentiment.
You might like to add a slower version of this (just increase the 3 day and 5 day calculations to something you believe to be appropriate - try 7 & 15) and trade the crossovers, as with stochastics.
You can also just trade the values ie 90 or higher, buy, 10 or lower, sell.

Metastock code for Excel 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


Lone Ranger

This is the calculation:

There are 2 calculations needed for this.
For the first, just take the highest value of the close in the past 3 days (including todays close) and take this away from the lowest value of the cose in the past 3 days. Call the result of this a.

Then divide a by volume. Subtract the result of this by the value of a divided by volume 5 days ago.

Finally, multiply this number by -1.

Simple Interpretation:
This is a short term indicator which will show short term divergences against the market instrument. You can also use it to compare its rate of change against that of the market.
Extreme lows or highs in the indicator may be a signal of similar instances in the market, however you would want to define a time period to make use of this function.

Metastock code for Lone Ranger:

(( Fml( "Z Range" ) / V) -
Ref((Fml( "Z Range" ) / V),-5)) * -1

Where Fml( "Z Range" ) = (HHV(c,3) - LLV(c,3))

Three inside Days

Inside days suggest a volatility compression and often preceede strong breakouts. Search returns 1 for ok and 0 for not ok

  • Inside()
  • Inside()-1
  • Inside()-2

 

NR4 Formula from Trading Tactics page 100

Column A
Std(Log(C/Ref(C,-1)),5)/Std(Log(C/Ref(C,-1)),99)
Column B
HIGH-LOW<Ref(LLV(H-L,3),-1)
Column C
HIGH<(Ref(HIGH,-1)AND LOW>Ref(LOW,-1))
Column D
HIGH
Column E
LOW
Filter
colA<.5 AND (colB= 1 OR colC= 1)

Price and Volume Breakout

Shows stocks where the price increased 5% and the volume is 50% above a 50-day moving average. Rank results by % change in price, then check the volume.

  • CLOSE
  • Ref(CLOSE,-1)
  • ROC(CLOSE,1,percent)
  • VOLUME
  • Mov(VOLUME,50,EXPONENTIAL)
  • ((VOLUME - Mov(VOLUME,50,EXPONENTIAL)) /Mov(VOLUME,50,EXPONENTIAL)) * 100
  • **When(colC >= 5) AND When(colD >= colE*1.5)

Bottom Reversal

These are a collection of bottom signals. The search returns 1 for Ok and 0 for not ok.

  • CLOSE
  • EngulfingBull()
  • MorningDojiStar()
  • MorningStar()
  • WhiteSoldiers()

 

Gap Days

Shows stocks which have gapped up or down on the open compared to yesterdays price. The search returns 1 for Ok and 0 for not ok.

  • GapUp()

Higher Closes

Shows stocks which have closed higher on successive days.

  • CLOSE
  • CLOSE -1
  • CLOSE -2
  • **When(colA,>,colB) AND When(colB,>,colC)

Moving Average Crossover---Bullish

This is a10 and 30 day moving average crossover search. Results close to 0 pinpoint the crossover.

  • CLOSE
  • Mov(CLOSE,30,EXPONENTIAL)
  • ((CLOSE-Mov(CLOSE,30,EXPONENTIAL)) /Mov(CLOSE,30,EXPONENTIAL)) * 100
  • ((CLOSE-Mov(CLOSE,10,EXPONENTIAL)) /Mov(CLOSE,10,EXPONENTIAL)) * 100
  • **When(colA > colB)

 

MACD Crossover Buy Signal

Shows those stocks where an MACD crossover has been signalled.The search returns 1 for Ok and 0 for not ok.

  • CLOSE
  • MACD()
  • Ref(MACD(),-1)
  • Mov(MACD(),9,EXPONENTIAL)
  • Ref(Mov(MACD(),9,EXPONENTIAL),-1)
  • ((MACD() - Mov(MACD(),9,EXPONENTIAL)) /Mov(MACD(),9,EXPONENTIAL)) * 100
  • **Cross( MACD(), Mov(MACD(),9,EXPONENTIAL))

 

Performance Daily

Stocks sorted on % gains over 1, 2, 3, 4, and 5 days. Rank results for the selected day. Good for finding breakout stocks.

  • CLOSE
  • ROC(CLOSE,1,percent)
  • ROC(CLOSE,2,percent)
  • ROC(CLOSE,3,percent)
  • ROC(CLOSE,4,percent)
  • ROC(CLOSE,5,percent)

Rally Gap and Inside Day

Finds stocks which have rallied, gapped upwards, and then had an inside day.

Usually leads to a resumption of the rally. The search returns 1 for Ok and 0 for not ok.

  • RallyWithVol()
  • Inside()
  • GapUp()

 

Range High

Looks for out of range move where the close equals the high. Suggests more buying pressure.

The search returns 1 for Ok and 0 for not ok.

  • BigWhite()
  • CLOSE

 

High Volume

Displays those where volume is above the 100 day moving average.

The search returns 1 for Ok and 0 for not ok.

  • VOLUME
  • Mov(VOLUME,100,EXPONENTIAL)
  • ((VOLUME - Mov(VOLUME,100,EXPONENTIAL))
  • /Mov(VOLUME,100,EXPONENTIAL)) * 100
  • When(colA,>,colB)

Collection from a Spanish Source

They are contributed by Patrick who notes "my limited Spanish suggests that they are simply a random collection made by the web owner, who points out that there is as yet 'no Holy Grail' in technical analysis! For the past few days I have been using them by substituting the for 'number' given to each formula, the complete formula that particular number represents. In this way, each becomes independent." We have included all 80 of them, complete with the orginal Spanish cover note.
A continuación se ofrecen una serie de fórmulas que puede utilizar con el programa Metastock recogidas de la red y cuya utilidad Vd. debe valorar. Se ruega encarecidamente a todos aquellos que tengan fórmulas que puedan resultar útiles las envíen a jomaba@interbook.net para su publicación en esta página. Muchos dicen que el Santo Grial no existe.¿Y si es mentira?

1 DAILY CLOSE VS HIGH AND LOW WAVE if((C-L)/(H-L),>,.66 ,1, if((C-L)/(H-L),<,.38,-1,0))
2 PRICE OSCILLATOR WAVE if(ref(oscp(3,15,S,%),-1),<,0,1,0)
3 VOLUME OSCILLATOR WAVE if(oscv(1,50,S,%),>,50,1,0)
4 WEEKLY PRICE OSCILLATOR WAVE if(fml(#17),>,ref(fml(#17),-1),1, if(fml(#17),<,ref(fml(#17),-1),-1,0))
5 VOLATILITY WAVE if(ref(fml(#27),-1),<,90,1,0)
6 LONG BINARY WAVE fml(#1) + fml(#2) + fml(#3) + fml(#9)
7 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))
8 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))
9 VOLATILITY DIFFERENCE WAVE if(fml(#11),>=,1.00,1,0)
10 LONG BINARY II fml(#1) + fml(#3) + fml(#9) + fml(#24)
11 VOLATILITY DIFFERENCE mov(H-L,1,S)/mov(H-L,20,S)
12 HI LOW WAVE - DAILY if(H,>,ref(hhv(H,100),-1),1,if(L,<,ref(llv(L,100),-1),-1,0))
13 WEEKLY HIGH LOW WAVE if(H,>,ref(hhv(H,40),-1),1, if(L,<,ref(llv(L,40),-1), -1,0))
14 PERCENT ABOVE\BELOW MOVING AVG (oscp(1,30,E,%))
15 WEEKLY PRICE OSCILLATOR mov(oscp(10,20,S,%),10,S)
16 MACD WAVE MACD/trigger Binary Wave if(macd(), >, mov(macd(),9,E), {bullish} +1, {bearish} -1)
17 WEEKLY OSC SEGMENT mov(oscp(43,86,S,%),43,S)
18 HISTORICAL VOLATILITY (std(log(C / ref(C,-1)),10)*sqr(365)) /(std(log(C / ref(C,-1)),50)*sqr(365))
19 RELATIVE STRENGTH C/P
20 CLOSE REL TO HIGH LOW (C-L)/(H-L)
21 GAP IDENTIFICATION if(L,>,ref(H,-1),1, if(H,<,ref(L,-1),-1,0))
22 AVG VOLUME mov(V,50,S)
23 MOVE WAVE 20-unit m.a. Binary Wave if(C, >, mov(C,20,E), {then bullish} +1, {else bearish} -1)
24 STOCHASTIC VALUE WAVE if(ref(stoch(14,3),-1),<,65,1, if(stoch(14,3),<,65,1,0))
25 ROC WAVE 12-ROC price Binary Wave if(roc(C,12,%), >, 0, {then bullish} +1, {else bearish} -1)
26 STOCH WAVE 5- Stochastic Binary Wave if(stoch(5,3), >, 50, {then bullish} +1, {else bearish} -1)
27 ATR RATIO atr(10)/atr(50)/100
28 BINARY WAVE Composite Wave of above fml("MACD Wave") + fml("MOVE Wave") + fml("ROC Wave")+ fml("STOCH Wave")
29 WEEKLY OPEN CLOSE WAVE if(C,>,O,1,if(C,<,O,-1,0))
30 SHORT BINARY WAVE fml(#31) + fml(#32) + fml(#33)
31 SHORT OPEN CLOSE WAVE if((C-L)/(H-L),<,.38,1,0)
32 SHORT PRICE OSCILLATOR WAVE if(ref(oscp(3,15,S,%),-1),>,0,1,0)
33 SHORT VOLUME WAVE if(oscv(1,50,S,%),>,0, if(V,>,ref(V,-1),1,0),0)
34 O.B.V. Good example of if() func cum( if( C, >, ref(C,-1), +V, if( C, <, ref(C,-1), -V, 0) ))
35 SINE WAVE 5-unit standing sine wave sin( cum(5) )
36 STOCHASTIC Example of hhv() function ( sum( C - llv(L,5), 3 ) / sum( hhv(H,5) - llv(L,5), 3) ) * 100
37 Median price (hhv(H,10)-C)-(C-llv(L,10))/(hhv(H,10)-llv(L,10))
38 Future MACD---Dr. Trieber (C-(( 11.607*(mov(C,26,E)))-(10.607*(mov(C,12,E))) -(12.536*(mov(macd(),9,E)))))
39 Fraction (32nd's) int(C)+((frac(C)/0.03125)/100)
40 Summation Noise Indicator (Adam White) (sum(abs(C-ref(C,-1)),14)-sum(abs(mov(C,10,S)-ref(mov(C,10,S),-1)),14))/
sum(abs(C-ref(C,-1)),14)
41 Chaikin Money Flow sum(((((C-L)-(H-C))/(H-L))*V),21)/sum(V,21)
42 Linear Regression ((15*(sum(cum(1)*C,10))-(sum(cum(1),10)*(sum(C,10))))
/((10*sum(pwr(cum(1),2 ),10))-pwr(sum(cum(1),2),10))
-pwr(sum(cum(1),10),2))
43 Smoothed Tick Momemtum Line-TASC 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)
44 Bull Power (for Elderray) H-mov(C,13,E)
45 Bear Power (for Elderray) L-mov(C,13,E)
46 13-Period Moving Average (for Elderray) mov(C,13,E)
47 RSI Binary Wave (using 30/70 xover) if(rsi(10),>,30,if(ref(rsi(10),-1),<,30,+1,if(rsi(10),<,70,if(ref(rsi(10),- 1),>,70,-1,0),0)),0)
48 Trendscore...Tushar Chande (TASC) 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)
49 KST-Martin Pring (One formula) (mov(roc(C,10,%),10,S))+(2*(mov(roc(C,15,%),10,S)))+
(3*(mov(roc(C,20,%),10,S)))+(4*(mov(roc(C,30,%),15,S)))/10
50 Dual Oscillator B-Wave +1 buy, -1 sell if(fml("dual osc 1"),>,fml("dual osc 2"),if(ref(fml("dual osc 1"),-1),<,
ref(fml("dual osc 2"),-1),+1,if((fml("dual osc 1")),<,fml("dual osc 2"),
if(ref(fml("dual osc 1"),-1),>,ref(fml("dual osc 2"),-1),-1,0),0)),0)
51 Dual Osc 1 mov(C,2,S)-mov(C,10,S)
52 Dual Osc 2 mov((H+L+C)/3,5,S)-mov((H+L+C)/3,20,S)
53 R Squared pwr(corr(cum(1),C,5,0),2)
54 Slope of Linear Regression Line ((5*(sum(cum(1)*C,5)))-(sum(cum(1),5)*(sum(C,5))))/
((5*sum(pwr(cum(1),2),5))-pwr(sum(cum(1),5),2))
55 RWI for today's high (H-ref(L,-16))/(mov((H-L),16,S)*sqr(16))
56 RWI for today's low (ref(H,-16)-L)/(mov((H-L),16,S)*sqr(16))
57 Momemtum roc(mov(C,10,E),10,%)
58 Volume Binary Wave if(V,>,ref(mov(V,20,E),1),1,if(V,<,ref(mov(V,10,E),1),-1,0))
59 MACD w/SAR if(macd(),>,mov(macd(),9,E),{macd is above trigger}if(sar(.02,.2),
<,C,{buy long}+2,{stop shorts}+1),{macd < trigger}if(sar(.02,.2),>,
C,{sell short}-2, {stop longs}-1))
60 Oscillating OBV mov(obv(),20,E)-obv()
61 Overreaction Index if(ref(std(C,3),-3),>,4,+1,0)+if(C,<,(sar(.015,.15)),-1,+1)
62 Modified MACD tsf(C,12)-tsf(C,26)
63 RVI w/simple moving average (TASC) 100*mov(if(C,>,ref(C,-1),std(C,10),0),14,S)/(mov(if(C,>,ref(C,-1),
std(C,10),0),14,S)+mov(if(C,<,ref(C,-1),std(C,10),0),14,S))
64 Upper Bollinger Band mov(C,20,S)+(2*(std(C,20)))
65 Lower Bollinger Band mov(C,20,S)-(2*(std(C,20)))
66 Middle Band mov(C,20,S)
67 %B (TASC) (C-(mov(C,20,S)-(2*(std(C,20)))))/(mov(C,20,S)+(2*(std(C,20)))-
mov(C,20,S)-(2*(std(C,20))))
68 Band Width (TASC) (mov(C,20,S)+(2*(std(C,20))))-(mov(C,20,S)-(2*(std(C,20))))/mov(C,20,S)
69 Volume % above/below 10 day MA (V-mov(V,10,S))/mov(V,10,S)
70 # of STD's of volume (V-mov(V,20,S))/std(V,20)
71 Morris' RSI w/volume (TASC) 100-(100/(1+(mov(if(roc(C,1,$),>,0,roc(C,1,$)*V,0),14,S)/
mov(if(roc(C,1,$), <,0,-roc(C,1,$)*V,0),14,S))))
72 Custom A/D Oscillator cum(if(C,>,ref(C,-2),1,if(C,<,ref(C,-2),-1,0)))
73 Empty Candlestick if(C,>,o{then empty},+1,0)
74 Filled Candlestick if(C,<,o{then filled},+1,0)
75 Doji if(C,=,o{then doji},+1,0)
76 Bearish engulfing lines if(fml(#28),=,+1,if(ref(fml(#27),-1),=,+1,if(C,<=,ref(O,-1),if(O,>=,
ref(C,-1),-1,0),0),0),0)
77 Bullish engulfing lines if(fml(#27),=,+1,if(ref(fml(#28),-1),=,+1,if(C,>=,ref(O,-1),if(O,<=,
ref(C,-1),+1,0),0),0),0)
78 Engulfing Line Binary wave fml(#30)+fml(#31)
79 Largest negative change in close llv(roc(C,1,$),40)
80 Choppiness Index (TASC) ((log(sum(atr(1),14)/(hhv(if(H,>=,ref(C,-1),H,ref(C,-1)),14)-llv(if(L,<=,
ref(C,-1),L,ref(C,-1)),14)))/log(10))/(log(14)/log(10)))*100

Page 4

Denvelope

In the Oct issue of "Futures" there is an article written by Dennis McNicholl called "Better Bollinger Bands". In his
article he describes how in a trending market the center band of the B.B. will shift away from the "mean" value of
the price, and that the two outer bands will shift outward to such an extent that the envelope loses its utility as a
volatility gauge (these are his words... not mine).  As usual "Futures" only posted the TradeStation code,
so this is my conversion from it. He called the Indicator "Denvelope", and it runs the bands much closer.....
similar to "Standard Error Bands".
{Denvelope}
{Better Bollinger Bands}
Lb:=Input("Look-Back Period ?",3,100,20);
De:=Input("Band Deviation ?",.5,3,2);
Alp:=2/(Lb+1);
Mt:=Alp*CLOSE+(1-Alp)*PREV;
Ut:=Alp*Mt+(1-Alp)*PREV;
Dt:=((2-Alp)*Mt-Ut)/(1-Alp);
mt2:=Alp*Abs(C-Dt)+(1-Alp)*PREV;
ut2:=Alp*mt2+(1-alp)*PREV;
dt2:=((2-Alp)*mt2-ut2)/(1-Alp);
But:=Dt+de*dt2;
Blt:=Dt-de*dt2;
But;
Dt;
Blt;

Best wishes, Adam Hefner e-mail: VonHef@itlnet.net

Metastock Formulas from Equis

The following collection of formulas appears at http://www.equis.com/customer/support/
and is a selection of those more useful for Australian conditions. New free Metastock
formulas are added regularly.

Adaptive Moving Average by Perry Kauffman

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

 

Average-Modified Method

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))))

 

Investor Preference Index

This indicator was discussed in the December 1997 Technical Analysis of Stocks & Commodities magazine, page 19. The article was written by Cyril V. Smith Jr.

"This indicator, a long - term stock market investment tool, compares the performance of the S&P 500 to the New York Stock Exchange index to measure sentiment. The theory is that investors have a preference for certain types of investments, blue chips versus mid-cap, during phases of a bull market."

To plot this in MetaStock for Windows, follow these instructions. When complete, if you save this as a chart, you will simply need to load the chart and it will recalculate using the newest data.

  • Open a chart of the S&P 500.
  • Open a chart of the New York Stock Exchange index.
  • Drag the S&P 500 price plot into the NYSE chart.
  • Drop the indicator listed below on the plot of the S&P 500. The plot will turn a different color when you are pointing at it.
  • The resultant plot is the Investor Preference Index.

Formula: Investor Preference Index:

(Sum(Mov(ROC(Log(C),24,%)-ROC(Log(P),24,%),15,S)-Mov(ROC(Log(C),24,%)-ROC(Log(P),24,%),38,S),54)+1)*100

System test:

Enter Long

C=HHV(C,26)

Close Long

Fml("Investor Preference Index")<97.6 AND ROC(Fml("Investor Preference Index"),2,$)<=(-.04)

 

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))

WillSpread by Larry Williams

The Larry Wiliams' indicator named WillSpread is quite easy to plot in MetaStock for Windows version 6.5.
Using version 6.5 of MetaStock for Windows, please follow these steps.

    • Plot the underlying commodity.
    • Drag the Spread Indicator from the indicator quick list to this commodity chart.
    • Select either Tbonds or Tbills as the security to use to spread. I recommend you plot this in a new inner window.
    • Drag the Price Oscillator from the indicator quick list and drop it on the SPREAD plot, not the price plot. The parameters Mr. Williams' uses are 7 and 11 time period exponential moving averages. You also want to use "points" as the method. This plot is the WillSpread indicator.
    • At this point, you may change the Spread Indicator plot's color to match the background of the chart, or perhaps move the WillSpread indicator to a separate inner window.

If you save this first effort as a template, perhaps named WillSpread, you are able to apply this template to any commodity you wish and the indicator will be automatically calculated against that commodity.

You may also use the "Next Security" function within MetaStock for Windows to view each of your commodities by setting the options for next security to "Keep line studies". If you apply this template to the first commodity in your futures folder, you may then use the right arrow to move down the folder contents. Each new commodity will have the WillSpread calculated as it is loaded.

Formulas from Stocks and Commodities
Magazine

The following collection of formulas are taken from Stocks and Commodities magazine.  A subscription soon pays for itself. This is a selection of those more useful for Australian conditions. Others are available from http://www.equis.com/customer/support/

1996 August TASC Trader's Tips

Connors & Raschke's Historical Volatility System

Here is the Connors and Raschke's historical volatility system exploration in August 1996 TASC Trader's Tips translated for MetaStock.

COLUMN FORMULAS

Column A : Vol ratio

std(log(C/ref(C,-1)),5)/std(log(C/ref(C,-1)),99)

Column B : NR4 day

if(HIGH-LOW,<,ref(llv(H-L,3),-1),1,0)

Column C : Inside

if(HIGH,<,ref(HIGH,-1),if(LOW,>,ref(LOW,-1),1,0),0)

Column D : High

HIGH

Column E : Low

LOW

FILTER FORMULA

Formula:

when(colA,<,0.5) AND (when(colB,=,1) OR when(colC,=,1))

1997 October TASC Traders Tip

Volatility Bands as a Long Term Strategy

This article "Volatility Bands As A Long Term Strategy", by Ahmet Tezel, Ph.D., and Suzan Koknar-Tezel, M.S., which appears in this issue introduces two different volatility band trading systems. One system uses bands based on moving averages and the other is based on bands which use regression. To plot the Moving Average Asymmetric Volatility Price Bands in MetaStock for Windows, simply plot Bollinger Bands using 11 periods and 1.7 standard deviations. Then click your right-mouse button while the cursor is over the lower band and choose properties. Change the standard deviations to 2. This plot will now appear exactly as the bands discussed in the article.

To plot the Regression Asymmetric Volatility Price Bands in Metastock for Windows, simply plot Standard Error Bands using 21 periods, 1 for standard errors, and 1 for the smoothing periods. Then click your right-mouse button while the cursor is over the lower band and choose properties. Change the standard errors to 1.5.

To recreate the systems in MetaStock for Windows, choose System Tester from the Tools menu. Next choose New and enter the following trading rules and stop conditions. After entering this information, choose Options and change the trade delay to 1, then change the Trade Price to Open. If you have MetaStock 6.5 enter the first set of formulas. MetaStock 6.5 allows variables which will allow you to change the periods when testing much more easily.

Formulas for MetaStock 6.5

MovAvg Asymmetric Volatility Price Bands

SIGNAL FORMULAS

Enter Long:
Periods := 11;
UpperBand := BBandTop(CLOSE,Periods,S,1.7);

BuySignal1 := Sum(CLOSE > UpperBand,3) = 3;

BuySignal2 := CLOSE > UpperBand AND Ref(LOW,-1) > Ref(upperband,-1);

BuySignal3 := LOW > UpperBand AND Ref(CLOSE,-1) > Ref(upperband,-1);

BuySignal4 := CLOSE > UpperBand AND CLOSE > 1.4 * LLV(LOW,Periods + 1) AND Mov(VOLUME,3,S) > 2000 {assuming volume in 100's otherwise use 200000} AND Mov(HIGH,3,S) > UpperBand AND Mov(HIGH - LOW,3,S) > Mov(HIGH - LOW,Periods,S);

BuySignal1 OR BuySignal2 OR BuySignal3 OR BuySignal4

Close Long:
Periods := 11;
LowerBand := BBandBot(CLOSE,Periods,S,2);

SellSignal1 := Sum(CLOSE < LowerBand,3) = 3;

SellSignal2 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND Sum(CLOSE < LowerBand,2) = 2;

SellSignal3 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND HIGH < LowerBand;

SellSignal1 OR SellSignal2 OR SellSignal3

STOPS
Maximum Loss: LONG ONLY

10.00 Percent

Regression Asymmetric Volatile Price Band

SIGNAL FORMULAS

Enter Long:
Periods := 21;
UpperBand := STEBandTop(CLOSE,Periods,1) ;

Sum(CLOSE > UpperBand,3) = 3 AND LinRegSlope(CLOSE,21) > 0 AND ROC(Correl(CLOSE,Cum(1) ,21,0),2,$) >= .2

Close Long:
Periods := 21;
LowerBand := STEBandBot(CLOSE,Periods,1.5) ;

SellSignal1 := Sum(CLOSE < LowerBand,3) = 3;

SellSignal2 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND HIGH < LowerBand;

SellSignal1 OR SellSignal2

STOPS

Maximum Loss: LONG ONLY

10.00 Percent

1997 November TASC Traders Tip

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.

1997 December TASC Trader's Tip

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 6.5

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.

 

1998 February TASC

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)))

 

1998 May TASC Trader's Tip

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))