Metastock
Formulas
- A
Click
here to go back to Metastock Formula
Index
IMPORTANT:
These formulas aren't my complete collection. For my complete
collection of instantly usable, profitable
and powerful MetaStock formulas Click
Here
|
Would
You Like To Use MetaStock To Its Full Potential? Discover the Amazingly
Simple Secret to Master Metastock Step-By-Step
- click
here
A
| A 1
| B
| B
1 | C
| C 1
| D
| D 1
| E
| F
| G
| H
| I
| J
| K
| L
| M
| M 1
| N
| O
| P
| R
| S
| S 1
| T
| U
| V
| W
| Z
|
LOW
Mx:=Mov(L,4,S);
L > Ref(L,-1) AND L>Mx AND
Ref(L,-1) < Ref(Mx,-1) AND
LLV(L,4 ) > LLV(L,10 ) AND
RSI(14)<50
HIGH
Mx:=Mov(H,4,S);
H < Ref(H,-1) AND H < Mx AND
Ref(H,-1) > Ref(Mx,-1) AND
HHV(H,4 ) < HHV(H,10) AND
RSI(14)>50
(Go
Top) |
Col
A: Peak(1,H,10)<=1.1*Peak(2,H,10)
AND Peak(1,H,10)>=0.9*Peak(2,H,10)
AND Trough(1,L,10)>=1.1*Trough(2,H,10)
AND Trough(1,L,10)<=0.9*Trough(2,H,10)
AND LLV(L,25)
Col B: Peak(1,H,5)<=1.1*Peak(2,H,5)
AND Peak(1,H,5)>=0.9*Peak(2,H,5)
AND Trough(1,L,5)>=1.1*Trough(2,H,5)
AND Trough(1,L,5)<=0.9*Trough(2,H,5)
AND LLV(L,25)
Col C: Peak(1,H,1)<=1.1*Peak(2,H,1)
AND Peak(1,H,1)>=0.9*Peak(2,H,1)
AND Trough(1,L,1)>=1.1*Trough(2,H,1)
AND Trough(1,L,1)<=0.9*Trough(2,H,1)
AND LLV(L,25)
Filter
colA=1 OR colB=1 OR colC=1
(Go
Top) |
A:Close
B:ADX(14){The higher the better}
C: PDI(14)<MDI(14)
D:If(H>Ref(H,-1) and Ref(H,-1)>Ref(H,-2) and
Ref(H,-2)>Ref(H,-3),1,0)
E:{Entry}LLV(L,3)-.125
F:{stop}HHV(H,3)
Filter:ColB>30 and ColC and ColD=1
(Go
Top) |
Here
is an exploration that pattern traders may find useful.
It tends to pick up two patterns: a two day hammer, that
is if you combined the open for day 1 and close for day
2, the resulting bar would be a hammer, and a pattern similar
to a Ross Hook, as I understand a Ross Hook.
Ref((C-L)/(H-L),-1)<=.30 AND
((C-L)/(H-L)) >= .70 AND
Ref(ATR(1),-1) >ATR(10) AND
ATR(1) >= ATR(10)
(Go
Top) |
Look
at these two oscillators in MSWIN, and compare them to Dahl.
Put a 21 day EMA on each, think of the 21 day ema as a trigger.
See what they tell you -- Dahl is long term, Ian is shortest
term.
Raschke Oscillator = Mov(Fml( "Raschke 3-10" ),16,E)
where "Raschke 3-10" = Mov(C,3,S) - Mov(C,10,S)
Ian Oscillator = (Mov(C,4,S)-Mov(C,9,S)) + (Mov(C,9,S)-Mov(C,17,S))
(Go
Top) |
{Functions
used in Middle Screen}
MiddleScreenBlue
:= Mov( Close, 34, E )
MiddleScreenYell := Mov( Open, 13, E )
{Functions
used in Lower Screen}
StochRed
:= Stoch( 9, 7 )
StochLagging : = Mov( StochRed, 7, S )
{
Main analysis section }
{BULLISH}
Cross( StochRed, StochLagging ) AND ( MiddleScreenYell >
MiddleScreenBlue )
{BEARISH}
Cross( StochLagging, StochRed ) AND ( MiddleScreenYell <
MiddleScreenBlue )
{
Breakout Notifier }
UpperSupportNow := Mov( OPEN, 10, E )
LowerSupportNow := Mov( CLOSE, 8, E )
PrevUpperSupport := Ref( Mov( OPEN, 10, E ), -1 )
PrevLowerSupportNow := ref( Mov( CLOSE, 8, E ), - 1 )
TRUE := 1
FALSE := 0
SignalledHigh := FALSE
SignalledLow :=FALSE
{
BULLISH }
IF ( ( L > UpperSupportNow ) AND ( Ref( L, -1 ) >
PrevUpperSupport ) AND
SignalledHigh = FALSE )
THEN
SignalledHigh := TRUE
IF ( SignalledHigh = TRUE )
THEN
SignalledLow :=FALSE
{BEARISH}
IF ( ( H < LowerSupportNow ) AND ( Ref( H, -1 ) >
PrevLowerSupport ) AND
SignalledLow = FALSE )
THEN
SignalledLow := TRUE
IF ( SignalledLow = TRUE )
THEN
SignalledHigh := FALSE
(Go
Top) |
{"Today
must make a five-day high and today the close must be below
the open."}
{Place the following in the MetaStock Explorer filter section.}
HIGH > Ref(HHV(HIGH,4),-1) AND CLOSE < OPEN
{or you can write it this way too ...}
HIGH > Ref(HIGH,-4)
AND HIGH > Ref(HIGH,-3)
AND HIGH > Ref(HIGH,-2)
AND HIGH > Ref(HIGH,-1)
AND CLOSE < OPEN
(Go
Top) |
ColA:
{Close}C;
ColB: {52-week High} HighestSince(1, (DayOfMonth()=08 AND
Month()=05
AND Year()=1998), H);
ColC: {52-week Low} LowestSince(1, (DayOfMonth()=08 AND
Month()=05 AND
Year()=1998), L);
{Choose one of these filters}
{Filter 1:} ColA >= (0.9*(ColB))
{Filter 2:} ColB >= 2*ColC
{If you want both the conditions to be satisfied in the
same query, just
join the two filters by the AND operator:}
Filter: (ColA >= (0.9*(ColB)) AND ColB >= ColC)
{One problem with the 52-wk High and 52-wk Low formula--every
day you've got
to change the values for dayofmonth(), Month() and Year()
functions. The
formula given above assumes that you would be running the
query on May 07,
1998. Change the values of the above functions accordingly.}
(Go
Top) |
((C-Ref(CLOSE,-7))/Ref(CLOSE,-7)*100)
(Go
Top) |
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));
(Go
Top) |
if
you want to identify directional movement by expressing
that the ADX "is rising" the most basic way to do it would
be:
ADX(14) > Ref(ADX(14),-1) -- Today's ADX is greater than
yesterday's ADX.
There is another aspect to the ADX that bears investigation,
though; namely the level of the ADX. There seems to be a
general consensus that an ADX over, say, 30 indicates a
stronger trend than lower ADX readings. So you could either
write ADX(14) > 30 -- or not, depending on your objectives.
You can stipulate that both conditions are true by joining
them with the word "and."
Also, I have found the following helpful: try using the
custom ADX formula posted on the MetaStock website. Wilder
wrote the original ADX in such a fashion that it rounds
the readings out to the nearest whole number. The "regular"
canned MetaStock ADX does this, while the custom ADX does
not. The non-rounded readings are just a shade more sensitive,
which can be helpful.
(Go
Top) |
{MetaStock
code written by Equis and published in the Oct99 TASC}
Periods:= Input("Enter time periods",1,100,14);
PlusDM:= If(HIGH>Ref(HIGH,-1) AND
LOW>=Ref(LOW,-1), HIGH-Ref(HIGH,-1),
If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1)
AND HIGH-Ref(HIGH,-1)>Ref(LOW,-1)-LOW,
HIGH-Ref(HIGH,-1), 0));
DIPlus:= 100 * Wilders(PlusDM,Periods) /
ATR(Periods);
MinusDM:= If(LOW<Ref(LOW,-1) AND
HIGH<=Ref(HIGH,-1), Ref(LOW,-1)-LOW,
If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1)
AND HIGH-Ref(HIGH,-1)<Ref(LOW,-1)-LOW,
Ref(LOW,-1)-LOW, 0));
DIMinus:= 100 * Wilders(MinusDM,Periods) /
ATR(Periods);
DIDif:= Abs(DIPlus - DIMinus);
DISum:= DIPlus + DIMinus;
ADXRaw:= 100 * Wilders(DIDif/DISum, Periods);
ADXRaw
(Go
Top) |
Metastock
users can reproduce the trend bars and entry signals shown
on the CWO chart using the Expert Advisor. Create a new
expert and under Symbols add a new entry with the following
condition :
ADX(14) > 20 AND ( Mov(C,15,S) > Mov(C,30,S)) AND
( Mov(C,5,S) > Mov(C,30,S)) AND Stoch(5,3) < 30 AND
Ref(Stoch(5,3) ,-1) >=30
Under Trends add the Bullish formula :
ADX(14) > 20 AND ( Mov(C,15,S) > Mov(C,30,S)) AND
( Mov(C,5,S) > Mov(C,30,S))
and the Bearish formula :
ADX(14) > 20 AND ( Mov(C,15,S) < Mov(C,30,S)) AND
( Mov(C,5,S) < Mov(C,30,S))
(Go
Top) |
Following
are the Bill William's Alligator indicators I put together.
Please read his book "Trading Chaos" and pick up a demo
of his
"Investor's Dream" software from his web site to see how
they are used.
Hope you find them useful.
originally from Gary Randall -- Brunswick, Maine, U.S.A.
----------------------------------------------
Chaos Blue BL
{Alligator Blue Balance Line - Jaw }
{13 bar smoothed average offset 8 bars }
Ref(Wilders(MP(),13),-8);
----------------------------------------------
Chaos Red BL
{Alligator Red Balance Line - Teeth }
{8 bar smoothed average offset 5 bars }
Ref(Wilders(MP(),8),-5);
----------------------------------------------
Chaos Green BL
{Alligator Green Balance Line - Lip }
{5 bar smoothed average offset 3 bars }
Ref(Wilders(MP(),5),-3);
----------------------------------------------
Chaos Gator
{ Chaos Alligator }
{ Plot as histogram }
green := Fml("Chaos Green");
red := Fml("Chaos Red");
blue := Fml("Chaos Blue");
If(green > red AND red > blue, green - blue,
If(blue > red AND red > green, green - blue,
0));
----------------------------------------------
Chaos AO
{ Chaos Awsome Oscillator - measures momentum }
( A very close approximation of MFI }
{ Plot as histogram }
Mov(MP(),5,S) - Mov(MP(),34,S);
----------------------------------------------
Chaos AO Signal Line
{ Chaos Awsome Oscillator Signal Line }
{ Plot as line over AO histogram }
Mov(Mov(MP(),5,S) - Mov(MP(),34,S),5,S)
----------------------------------------------
Chaos AC
{ Chaos Accelerator/Decelerator Oscillator }
{ Measures acceleration }
{ Plot as histogram }
Fml("Chaos AO") - Mov(Fml("Chaos AO"),5,S);
----------------------------------------------
Chaos Fractal
{ Chaos Fractal (simple version +1=Up, -1=Dn) }
High1 := Ref(HIGH,-2);
High2 := Ref(HIGH,-1);
High3 := Ref(HIGH,0);
High4 := Ref(HIGH,1);
High5 := Ref(HIGH,2);
Low1 := Ref(LOW,-2);
Low2 := Ref(LOW,-1);
Low3 := Ref(LOW,0);
Low4 := Ref(LOW,1);
Low5 := Ref(LOW,2);
Fractal :=
If((High3 > High1) AND (High3 > High2) AND (High3
> High4) AND (High3 >
High5), +1,0);
Fractal :=
If((Low3 < Low1) AND (Low3 < Low2) AND
(Low3 < Low4) AND (Low3 < Low5),
If(Fractal > 0, 0, -1), Fractal);
Fractal;
(Go
Top) |
from
Murray Richards . . .
Drag this to the chart and change it to a histogram and
plot green
AO oscillator Green
If( Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S),
>,Ref(Mov( ( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S),-1),(
Mov(( H+L)/2, 5, S)-
Mov(( H+L)/2, 34, S )),0)
Put in the same window and plot it red as a histogram
A Oscillator red
If( Mov( ( H+L)/2, 5, S)- Mov( ( H+L)/2, 34, S),
<,Ref(Mov( ( H+L)/2, 5, S)- Mov( ( H+L)/2, 34, S),-1),
Mov( ( H+L)/2, 5,
S)- Mov( ( H+L)/2, 34, S),0)
Acc
Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S)-
Mov(Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S) , 5, S)
Put in its on window as a histogram and plot red
AC Red
If( Fml( "Acc" )<Ref( Fml( "Acc" ),-1) ,Fml( "Acc" ),0
)
Put in the same window and plot green
AC green
If( Fml( "Acc" )<Ref( Fml( "Acc" ),-1) ,Fml( "Acc" ),0
)
Start a new expert and chose highlights
color red
Fml( "AC RED" )AND Fml( "A Oscillator red" )
Color green
Fml( "AC Green" ) AND Fml( "A Oscillator Green " )
Save as a template
(Go
Top) |
Original
formula based on L.B. Raschke's "Street Smarts"
book's Quick Indicator Articles. Re-written by Ton Maas.
{FUNCTIONS-IND-REFERENCE-INDEX:
FF=FASTLINE,SS=SLOWLINE,SETBARS=3DAYMOVAVE,
ENTRYADD=+1,EXITADD=+1}
{FUNCTIONS-VAR-REFERENCE-INDEX:
BBUY=(VAR),SSELL(VAR),CBUY(VAR),CSELL(VAR),FF(VAR),SS(VAR),
LXSTOP(VAR),SXSTOP(99999),MP(VAR)}
{FUNCTIONS-MISC-REFERENCE-INDEX:
AT0BBUY =BULLLONG
AT0SSELL =BEARSHORT
AT0CSELL =CLOSEBEARSHORT
AT0CBUY =CLOSEBULLLONG
AT0MP =MARKETPOSITION (-1=LONG,+1 SHORT)
AT0LXSTOP=CLOSELONGEXITLEVEL(STOPLOSS)
AT0SXSTOP=CLOSESHORTEXITLEVEL(STOPLOSS)}
{INDICATOR NAME : ANTI TRIGGER}
{THE FORMULA (+REQUIRED FUNCTIONS) FOR THE ANTI TRIGGER
INDICATOR}
AT0SETBARS:=3;
AT0FF:=Stoch(7,AT0SETBARS);
AT0SS:=Mov(Stoch(7,AT0SETBARS),10,E);
AT0ENTRYADD:=+1;
AT0EXITADD:=+1;
AT0CSELL:={use in expadv or systest}{for RT del the REF-function}
If(AT0FF>Ref(AT0FF,-1) AND AT0SS<Ref(AT0SS,-1),C+1,0);
AT0CBUY:={use in expadv or systest}{for RT del the REF-function}
If(AT0FF<Ref(AT0FF,-1) AND AT0SS>Ref(AT0SS,-1),C+1,0);
AT0BBUY:={use in expadv or systest}{for RT del the REF-function}
If(AT0CBUY>AT0SETBARS,H+AT0ENTRYADD,99999);
AT0SSELL:={use in expadv or systest}{for RT del the REF-function}
If(AT0CSELL>AT0SETBARS,L-AT0ENTRYADD,0);
AT0MP:={use in expadv or systest}If(AT0BBUY<99999, -1,If(AT0SSELL>0,1,0));
{AT0LXSTOP:=}{use in expadv or systest}{for RT del the REF-function}
{IF(REF(AT0MP,-1)<1 OR (REF(AT0BBUY,-1)<99999 AND
H>REF(AT0BBUY,-1)), L-AT0EXITADD,0);}
{AT0SXSTOP:=}{use in expadv or systest}{for RT del the REF-function}
{IF(REF(AT0MP,-1)>-1 OR (REF(AT0SSELL,-1)>0 AND
L<REF(AT0SSELL,-1)), H+AT0EXITADD,0);}
AT0MP
(Go
Top) |
Do
price pressures build up over the weekend that cause predictable
distortions in the stock market on Monday? If the market
is up or down a certain number of days in a row, what are
the chances it will follow the trend the next day? Is the
trend on Monday reversed on Tuesday? To find out, we loaded
our S&P 500 data back to 1980, and ran a test. The results
were this - the trend on Monday (either up or down) was
reversed 55% of the time, a fairly significant result. This
might tell us that the weekend causes an emotional buildup
that moves the market an excessive amount on Monday, which
is then corrected by Tuesday. Larger stocks, as represented
by the Dow Jones Industrial Average, reversed slightly less
- 54% of the time. Small stocks, as represented by the Russell
2000 (data back to 1990) showed the opposite pattern, going
with the trend 60% of the time.
In the futures markets, the US dollar (data back to 1990)
reversed 54% of the time, and the 30 year treasury bond
(data back to 1987) reversed 53% of the time.
In recent years, the pattern has been less pronounced. In
fact, if you study just the last two years, you get reversals
of 53% in the Dow, 52% in the S&P 100, a continuation
in the trend 50.5% of the time in the S&P 500 and a
continuation 54% of the time in the Russell 2000 . The US
dollar has reversed 58% of the time in the last two years,
the CRB index 54% of the time, while other futures have
shown continuation trends - 55% for gold, 54% for treasury
bonds, and 55% for crude oil.
Next, we studied every possible price trend for the five
day period. A nice Thursday trend emerged - if Monday and
Tuesday went one direction, and then Wednesday reversed
this trend, there was a 62% chance that Thursday would continue
this reversal (well represent this as XXOO, where X just
means one direction, not necessarily up or down, and O means
the other direction). If the first four days of the week
all moved in the same direction (XXXX), Friday had a 61%
chance of doing the same (XXXXX). And if Tuesday reversed
Monday, but was then reversed by Wednesday, and the trend
continued Thursday, there was a 63% chance that Friday would
continue the trend set Wednesday (XOXXX).
The MetaStock formulas for the Tuesday calculation are included
below. Formulas for the remaining days of the week build
on these formulas, and are too extensive to include here
(you need 2 formulas for Tuesday, 4 for Wednesday, 8 for
Thursday, and 16 for Friday).
To build an exploration that looks for stocks with a high
incidence of Tuesday reversal, simply put the formula "Tuesday
% occurrence. of XX vs. XO" in a column in the Explorer,
run an exploration on all of your securities, then sort
by the aforementioned formula.
======================
Formula "Tuesday XX Pattern"
{ Looks for XX pattern, returns +1 if it finds it }
If(Ref(DayOfWeek(),-2) = 5 {2 days ago was Fri} AND
Ref(DayOfWeek(),-1) = 1 {Yesterday was Mon}
AND
DayOfWeek() = 2 {Today is Tuesday}
AND { Either both days were up or down }
((Ref(CLOSE,-2) > Ref(CLOSE,-1) AND
Ref(CLOSE,-1) > CLOSE ) OR
(Ref(CLOSE,-2) < Ref(CLOSE,-1) AND
Ref(CLOSE,-1) < CLOSE )) ,
+1, { +1 if XX pattern }
0) { Otherwise 0 }
======================
Formula "Tuesday XO Pattern"
{ Looks for XO pattern, returns +1 if it finds it }
If(Ref(DayOfWeek(),-2) = 5 {2 days ago was Fri} AND
Ref(DayOfWeek(),-1) = 1 {Yesterday was Mon}
AND
DayOfWeek() = 2 {Today is Tuesday}
AND { Tuesday is opposite direction of Monday }
((Ref(CLOSE,-2) > Ref(CLOSE,-1) AND
Ref(CLOSE,-1) < CLOSE ) OR
(Ref(CLOSE,-2) < Ref(CLOSE,-1) AND
Ref(CLOSE,-1) > CLOSE )) ,
+1, { +1 if XO pattern }
0) { Otherwise 0 }
======================
Formula "Tuesday % occurrence. of XX vs. XO"
{ Gives the % occurrence of XX (that Tuesday goes the same
direction as Monday) }
Cum(Fml("Tuesday XX pattern"))/
(Cum(Fml("Tuesday XX pattern")) + Cum(Fml("Tuesday XO pattern"))
) * 100
======================
Note that unchanged days, either Monday or Tuesday, are
ignored in the calculations.
by John DeBry
(Go
Top) |
periods:=Input("ATR
Periods?",1,100,10);
TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;
Mov(TR,periods,S)
(Go
Top) |
prd1:=input("enter
ATR period",1,9999,7);
prd2:=(prd1*2)-1;
{max (absolute) of yesterday's close to today's high or
today's low}
myatr1:=Max(Abs(Ref(C,-1)-H),Abs(Ref(C,-1)-L));
{max of yesterday's close to today's high or today's low
or today's range}
myatr2:=Max(myatr1,H-L);
(Go
Top) |
For
Long:
HHV(H - 2.5*ATR(5),10)
For Short:
LLV(L + 2.5*ATR(5),10)
Furthermore, it may be beneficial to dynamically adjust
the number of lookback periods in the HHV() or the LLV()
function.
(Go
Top) |
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%
(Go
Top) |
This
exploration is designed to provide the average dollar price
volatility figure in column F. This will find this figure
for all stocks scanned. It is most useful to apply this
just to an exploration of a small group of stocks. It matches
the steps in Deels book The Strategic Electronic Day Trader.
Col A: day 1 HIGH - LOW
Col B: day 2 Ref((HIGH-LOW),-1)
Col C: Ref((HIGH-LOW),-2)
Col D: Ref((HIGH-LOW),-3)
Col E: Ref((HIGH-LOW),-4)
Col F: (H - L + (Ref(H,-1) - Ref(L,-1))
+ (Ref(H,-2) - Ref(L,-2))+(Ref(H,-3) - Ref(L,-3)) + (Ref(H,-4)
- Ref(L,-4))) / 5
(Go
Top) |
This
indicator plots the value on the chart display. It is useful
only as a quick method of attaching the volatility value
to the stock. Apply this with caution and make sure that
the new scale display is also included.
(H
- L + (Ref(H,-1) - Ref(L,-1)) + (Ref(H,-2) - Ref(L,-2))+(Ref(H,-3)
- Ref(L,-3)) + (Ref(H,-4) - Ref(L,-4))) / 5
(Go
Top) |
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))))
(Go
Top) |
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.
After applying the 5 35 5 MACD indicator to your chart,
use the following steps to create a histogram with vertical
line at zero.
-
Double
click the indicator to open the properties dialogue
box.
-
Select
the Color\Style tab and using the Style drop-down list,
select the histogram setting (second from the bottom).
-
Select
the Horizontal Lines tab and enter a value of zero (0)
for the horizontal line value. Click Add.
-
Click
OK
(Go
Top) |
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:
- Create
a composite security of the Advancing Issues - Declining
Issues. In Windows versions use The DownLoader to create
the composite or in the DOS versions use MetaStock's File
Maintenance to create the composite.
- In
MetaStock open the composite and plot the custom formula
ABS( C ) on it.
(Go
Top) |
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.
-
Create
a NEW chart of the advancing issues.
-
Create
a NEW chart of the declining issues.
-
Create
a NEW chart of the advance-decline composite.
-
Create
a NEW INNER WINDOW on the declining issues chart.
-
Delete
the volume plot on the advance-decline composite chart.
-
Copy
the volume from the advancing issues chart and paste
it into the new inner window on the declining issues
chart.
-
Drop
the custom formula, P-V on the advancing volume plot
in the declining issues chart, creating a new scale.
-
Copy
that plot to the empty inner window (where the volume
was) of the advance-decline composite.
-
Save
that chart as the adv-decl chart (perhaps advdecl.mwc).
This
will be the chart you load to do your study of the advance-decline
line with negative volume.
(Go
Top) |
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
(Go
Top) |
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.
-
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).
-
Dial/Data
also supplies this data in two files. Advances, number
and volume and Declines, number and volume. The tickers
are @*NAZ_K and @*NDZ_K.
-
CompuServe
supplies this data in 4 files. The tickers are NYSEI
(Advances)use the cusip 00000157 rather than the symbol;
NYSEJ (declines); NYUP (Advance volume) and NYDN (decline
volume).
After
the data has been collected follow these steps:
For
data from RTD or Dial Data
-
In
the DownLoader create a composite security of the Advances
/ Declines.
-
In
MetaStock open the composite.
-
Create
and plot the custom formula: C/V
-
This
gives you the Arms Index (TRIN).
For
data from CompuServe
-
In
the DownLoader create the two composites.
-
In
MetaStock open both composites.
-
Tile
the charts so they can both be viewed.
-
Drag
the plot of the Adv. Volume/Dec. Volume composite into
an inner window in the Adv. Issues/Dec. Issues chart.
-
Create
the custom formula: C/P
-
Plot
this formula on top of the Adv. Volume/Dec. Volume plot
(the Adv. Volume/Dec. Volume plot will turn a purplish
color to signify the formula will be plotted on it).
You
will know have the Arms Index (TRIN) plotted. You can drag
it to its own inner window if you prefer.
For
interpretation refer to Mr. Arms book, The Arms Index.
(Go
Top) |
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.
(Go
Top)
|
If
you have Metastock formulas you would like to share,
Please email to
We look forward to hearing from you!
To learn
more about how to use Metastock and its formula click
here.
copyright
2003 MetaStock Website Home
Metastock®
is a registered trademark of Equis International.
|