Metastock
Formulas
- M
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 |
{These
MetaStock MACD indicator formulas allow user input for parameters
when run}
mp1:=Input("Short MA",1,377,13);
mp2:=Input("Long MA",1,377,34);
Mov(C ,mp1 ,E )- Mov(C ,mp2 ,E )
MACD signal line
mp1:=Input("Short MA",1,377,13);
mp2:=Input("Long MA",1,377,34);
mp3:=Input("Signal MA",1,377,89);
Mov( (Mov(C ,mp1 ,E )- Mov(C ,mp2 ,E )),mp3,E)
MACD - Signal Line
mp1:=Input("Short MA",1,377,13);
mp2:=Input("Long MA",1,377,34);
mp3:=Input("Signal MA",1,377,89);
(Mov(C,mp1,E)-Mov(C,mp2,E))-(Mov((Mov(C,mp1,E)-Mov(C,mp2,E)),mp3,E))
(Go
Top) |
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))
(Go
Top) |
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.
(Go
Top) |
The
Input() Function(MSK-man. p.271-273) cannot be used directly
in the Explorer (MSK-man. p.351). It is reserved to be used
in a custom indicator. However, the custom indicator's default
value can be used in an exploration.
Since you have created a {faulty} custom indicator, than
just re-code it. By referencing the Input() Function using
the fml() CALL Function
(MSK-man.p.226-227 and 208-209 and 212), you can still use
its {by you at design time} assigned Default value.
Custom Indicator :
Name: MACDcustom
Formula:
MAprd:=Input( "Periods", 5 {Minimum}, 30 {Maximum}, 14 {Default}
);
YourTrig:=Mov( MACD(), MAprd, E );
MACD();
YourTrig
When creating the exploration just click the function button
and look under the Custom Indicators heading for both of
the above custom indicator functions, and "Open" each of
them one by one, to paste them into your column TABs (MSK-man.
p.347-348) .
Exploration:
Name: MACD crosses my Trigger
Columns:
Cola:
Name: Close
Formula:
C
Colb:
Name: MACD
Formula:
FML( "MACDcustom , MACD" )
Colc:
Name: MACDTrigger
Formula:
FML( "MACDcustom , YourTrig" )
Filter:
Formula:
Colb > Colc
{or
FML( "MACDcustom , MACD" ) > FML( "MACDcustom , YourTrig"
)
}
(Go
Top) |
This
explorer looks for stocks exhibiting extreme divergence
from the MACD Histogram. In his book "Trading for
a Living", Alexander Elder argues that divergence from the
MACD Histogram gives the strongest signals in the whole
of technical analysis.
ColA:
md
:= MACD();
mdhist
:= md - Mov(md,9,E);
Correl(((Sum(Cum(1)*(
mdhist ),100))-(Sum(Cum(1),100)*
Sum((
mdhist ),100)/100))/((Sum(Power(Cum(1),2),100))-
(Power(Sum(Cum(1),100),2)/100)),((Sum(Cum(1)*C,100))-(Sum(Cum(1),100)*
Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))-(Power(Sum(Cum(1),100),2)/100)
),12,0)
Filter
Column:
colA
and colA <-0.8
The
above formula can also be combined with a volatility buy
signal and a volume signal. The following addition is then
made.
ColB:
The volatility buy signal
H
> Ref(C,-1) + 1.8 * Ref( ATR(10),-1)
ColC:
Volume 10% above the average of the previous 10 days
V
> 1.1 * Ref( Mov(V,10,E),-1)
Filter
Column:
colA
AND colB AND colC AND colA <-0.80
Initial
tests with this system have been encouraging.
(Go
Top) |
(MACD()*10
+50) {offset the MACD to 50}
(Go
Top) |
QUESTION:
As you know, MACD is always bottoming or topping before
crossing its trigger line. However, the MACD signal comes
always a bit late compared to price movement. Is there any
way to calculate the MACD first derivative function to identify
MACD tops/bottoms, that could be use by the Explorer or
the System Tester?
ANSWER:
One way to do what you want would be using the 'Rate of
Change' function.
For
example:
RocPeriods:=1;
ROC(MACD(),RocPeriods,$)
or
for the MACD histogram you would have
RocPeriods:=1;
ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$)
If
that is to noisy, you could smooth it a bit with: RocPeriods
:= 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD(),RocPeriods,$)
, MovAvePeriod,E) {the 3 just 'magnifies' the line on the
plot but doesn't affect the calculation} or for the MACD
histogram:
RocPeriods
:= 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$)
, MovAvePeriod,E)
Another
way to do what you want would be to look for peaks and troughs
using the 'Peak' and 'Trough' functions. I'm working on
code to identify divergences using this method.
QUESTION:
As you know, MACD is always bottoming or topping before
crossing its trigger line. However, the MACD signal comes
always a bit late compared to price movement. Is there any
way to calculate the MACD first derivative function to identify
MACD tops/bottoms, that could be use by the Explorer or
the System Tester?
ANSWER:
One way to do what you want would be using the 'Rate of
Change' function.
For
example:
RocPeriods:=1;
ROC(MACD(),RocPeriods,$)
or
for the MACD histogram you would have
RocPeriods:=1;
ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$)
If
that is to noisy, you could smooth it a bit with:
RocPeriods
:= 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD(),RocPeriods,$)
, MovAvePeriod,E) {the 3 just 'magnifies' the line on the
plot but doesn't affect the calculation} or for the MACD
histogram: RocPeriods := 1; MovAvePeriod :=1; ; Mov(3 *
ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$) , MovAvePeriod,E)
Another
way to do what you want would be to look for peaks and troughs
using the 'Peak' and 'Trough' functions. I'm working on
code to identify divergences using this method.
(Go
Top) |
{Name:
%Bands}
Pds:= Input("EMA Periods?",1,1000,21);
Pct:= Input("Percentage Bands?",0.1,10,5);
MA:= Mov(C,Pds,E);
TBnd:= MA*(1+Pct/100);
LBnd:= MA*(1-Pct/100);
MA;TBnd;LBnd;
{Name: %BandsCount}
Pds:= Input("EMA Periods?",1,1000,21);
Pct:= Input("Percentage Bands?",0.1,10,5);
MA:= Mov(C,Pds,E);
TBnd:= MA*(1+Pct/100);
LBnd:= MA*(1-Pct/100);
IUp:= (H > TBnd) * Ref((H <= TBnd),-1);
CntUp:= IUp + BarsSince(IUp=1) * (H > TBnd);
IDn:= (L < LBnd) * Ref((L >= LBnd),-1);
CntDn:= IDn + BarsSince(IDn=1) * (L < LBnd);
CntUp; -CntDn;
EXPERT
{Name: %Bands}
Symbols tab.
{Name: %BandUp}
FmlVar("% BandsCount","CNTUP") >= 1
{Graphic: Dot, Small, Green, Above price plot}
Symbols tab.
{Name: %BandDn}
FmlVar("% BandsCount","CNTDN") >= 1
{Graphic: Dot, Small, Magenta, Below price plot}
(Go
Top) |
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)
(Go
Top) |
The
McClellan Oscillator, developed by Sherman and Marian McClellan,
is a market breadth indicator that is based on the smoothed
difference between the number of advancing and declining
issues on the New York Stock Exchange. The McClellan Oscillator
is one of the most popular breadth indicators. Buy signals
are typically generated when the McClellan Oscillator falls
into the oversold area of -70 to -100 and turns up. Sell
signals are generated when the oscillator rises into the
overbought area of +70 to +100 and then turns down.
Extensive coverage of the McClellan Oscillator is provided
in their book Patterns for Profit .
To plot the McClellan Oscillator, create a composite security
in The DownLoader™ of Advancing Issues minus Declining
Issues. Open a chart of the composite in MetaStock™
and plot this custom indicator.
Mov(CLOSE,19,EXPONENTIAL) - Mov(CLOSE,39,EXPONENTIAL)
(Go
Top) |
The
McClellan Summation Index is a market breadth indicator
developed by Sherman and Marian McClellan. It is a long-term
version of the McClellan Oscillator and its interpretation
is similar to that of the McClellan Oscillator except that
it is more suited to major trend reversals.
For more extensive coverage of the index refer to the book
Patterns for Profit, by Sherman and Marian McClellan.
McClellan suggests the following rules for use with the
summation Index:
Look for major bottoms when the Summation Index falls below
-1300.
Look for major tops to occur when a divergence with the
market occurs above a Summation Index level of +1600.
The beginning of a significant bull market is indicated
when the Summation Index crosses above +1900 after moving
upward more than 3600 points from its prior low (e.g. the
index moves from -1600 to +2000).
The summation index is plotted by adding the Cum function
to the McCllellan Oscillator.
The
formula is Cum(Mov(C,19,E) - Mov(C,39,E)).
(Go
Top) |
I
found a problem with the %Bands formulas posted yesterday.
No matter what optional parameters are entered for EMA length
or % bandwidth, the Expert appears to read only the default
values. As a result, when using other than default parameters,
the coloured dots appear in inappropriate places. If the
coloured dots are considered unnecessary the Expert can
simply be detached.
Alternatively, below is a hard-coded version. There is no
screen to enter optional parameters. Instead, plot the %Bands
formula,then right-click on one of the bands, select '%Bands
Properties', then the 'Formula' tab, and change the parameters
in the first two lines of the %Bands formula; click 'OK'.
Or make the change in the Formula Editor. The values need
to be entered only once, in the %Bands formula; the %BandsCount
formula and the Expert will take their values from that.
For regular use, get the display to your liking, then create
a template.
{NAME: %Bands}
Pds:= 21; {ENTER EMA LENGTH}
Pct:= 2.5; {ENTER PERCENT BANDWIDTH}
MA:= Mov(C,Pds,E);
TBnd:= MA*(1+Pct/100);
LBnd:= MA*(1-Pct/100);
MA; TBnd; LBnd;
{NAME: %BandsCount}
{USE WITH %BANDS FORMULA}
TBnd:= FmlVar("%Bands","TBND");
IUp:= (H > TBnd) * Ref((H <= TBnd),-1);
CntUp:= IUp + BarsSince(IUp=1) * (H > TBnd);
LBnd:= FmlVar("%Bands","LBND");
IDn:= (L < LBnd) * Ref((L >= LBnd),-1);
CntDn:= IDn + BarsSince(IDn=1) * (L < LBnd);
CntUp; -CntDn;
EXPERT
{Name: %Bands}
Symbols tab.
{NAME: %BandUp}
FmlVar("%BandsCount","CNTUP") >= 1
Graphic tab: Dot, Small, Green, Above price plot
Symbols tab.
{NAME: %BandDn}
FmlVar("%BandsCount","CNTDN") >= 1
Graphic tab: Dot, Small, Magenta, Below price plot
(Go
Top) |
Using
the default values used in the formulas, I have found that
these upper and lower bands provide effective risk control
while trading. The upper band can be used as the extreme
point to get rid of shorts and vice versa. In fact, prices
tend to remain above both the bands while the market is
in a strong uptrend, and prices remain below the bands in
a downtrend. During short-term range-bound markets, they
tend move between the bands. I have found this idea in Tushar
Chande's "New Technical Trader". Since you have studied
ATR so thoroughly, it would be be very nice if you could
comment on them. Can be made into a template for easier
usage.
Upper Band
Prd1:=Input("ATR Period",5,20,5);
Prd2:=Input("Period for Highest High Value",5,20,10);
(HHV(LLV(L,Prd1)+ATR(Prd1),Prd2))
Lower Band
Prd1:=Input("ATR Period",5,20,5);
Prd2:=Input("Period for Lowest Low Value",5,20,10);
(LLV(HHV(H,Prd1)-ATR(Prd1),Prd2))
(Go
Top) |
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.
(Go
Top) |
periods1:=Input("Periods
of ROC",2,50,12);
periods2:=Input("Smoothing
Period",1,50,1);
Input("horizontal
line 1",-50,50,5);
Input("horizontal
line 2",-50,50,-5);
Mov(ROC(C,periods1,%),periods2,S);
(Go
Top) |
Review
of : <symbol>
as of <date>
TODAY'S CLOSE WriteVal(CLOSE,2.3)
TOMORROW's
PROJECTED HIGH
WriteIf(C<O, "WRITEVAL(-L+ (H+2*L+C)/2,25.2)")
WriteIf(C>O, "WRITEVAL(-L+ (2*H+L+C)/2,25.2)")
WriteIf(C=O, "WRITEVAL(-L+ (H+L+2*C)/2,25.2)")
PROJECTED LOW
WriteIf(C<O, "WRITEVAL(-H+ (H+2*L+C)/2,25.2)")
WriteIf(C>O, "WRITEVAL(-H+ (2*H+L+C)/2,25.2)")
WriteIf(C=O, "WRITEVAL(-H+ (H+L+2*C)/2,25.2)")
BOLLINGER BANDS
CLOSING PRICE:WRITEVAL(C,2.3)
BOLLINGERBAND TOP:
WRITEVAL( BBandTop(C,21,E,2),13.3)
21 DAY MOVING AVERAGE:
WRITEVAL(MOV(C,21,E),13.3)
BOLLINGERBAND BOTTOM:
WRITEVAL( BBandBOT(C,21,E,2),13.3)
(Go
Top) |
{cola:BUY:
this means: label column A as "BUY" and then enter the following
formula:}
Cross(L,(SAR(.02,.2)))
{colb:SELL:
this means: label colum B as "SELL" and then enter the following
formula:}
Cross(SAR(.02,.2),H)
{enter
the following in the filter section:}
cola=1
or colb=1
{where
the AF=0.02 which you can change. try doing a sys test by
replacing the numbers with opt1 & opt2}
(Go
Top) |
To
find the securities that have closed above their high today
(the last trading day in the database) for the first time,
I have written this MetaStock Explorer.
ColA: {Close) C
ColB: {Previous 60-day High} Ref(HHV(H,60), -1)
ColC: {Current 60-day High} HHV(H,60)
ColD: {Volume} V
Filter: (colA>colB) AND (Ref(C,-1)<Ref(HHV(H,60),
-1)) AND
(H=HHV(H,60))
This formula does two things:
1) It lists only those securities which have met the required
conditions only on the last trading day.
2) The new 60-day high must have taken place only on the
last trading day.
from Rajat Bose
{Stocks Closing Above 60 Day Highs}
{closing above the 60-day high of the close}
close>ref(hhv(close,60),-1)
if you want those that are {closing above the 60-day intraday
high}
close>ref(hhv(high,60),-1)
(Go
Top) |
This
is a MetaStock formula that I have had good success with.
Copy and paste this into the Explorer filter.
C>Ref(C,-1) AND C>Ref(C,-2) AND C>Ref(C,-3) AND
C>Ref(C,-4) AND
Ref(C,-1)<=Ref(C,-2) AND
Ref(C,-1)<=Ref(C,-3) AND
Ref(C,-1)<=Ref(C,-4) AND
Ref(C,-2)<=Ref(C,-3) AND
Ref(C,-2)<=Ref(C,-4)
AND
Ref(C,-3)<=Ref(C,-4)
This formula will pick up all stocks that have closed up
either the same as the previous day or below the previous
day for 3 days, then on the 4th day closes up higher than
the previous 3 days close. The reason that I specified that
the first 3 days close was the same as or less than the
previous days close was that it would pick up all stock
in an up trend if it was just the 4th day closing higher
than the 3 previous you would get hundreds of returns on
the search. It will pick up stock that was in a trading
range or consolidating, then breaking out of the range.
The reason that I had the 4th day higher than the 3 previous
was because it would otherwise pick stock in a downtrend
with no significant increase in the close on day 4. Once
I have a short list, I check it with Daryl's 3 day countback
line and sometimes run a 10/30 moving average. If the stock
breaches the previous day's close on the open, I will enter
the trade and put a trailing stop loss into play.
(Go
Top) |
"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
(Go
Top) |
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).
(Go
Top) |
N:=50;
TN:=Mov(C,N,S);
sOneA:=((n-1)/2)*C+
((n-3)/2)*Ref(C,-1)+
((n-5)/2)*Ref(C,-2)+
((n-7)/2)*Ref(C,-3)+
((n-9)/2)*Ref(C,-4)+
((n-11)/2)*Ref(C,-5)+
((n-13)/2)*Ref(C,-6)+
((n-15)/2)*Ref(C,-7)+
((n-17)/2)*Ref(C,-8)+
((n-19)/2)*Ref(C,-9);
sOneB:=((n-21)/2)*Ref(C,-10)+
((n-23)/2)*Ref(C,-11)+
((n-25)/2)*Ref(C,-12)+
((n-27)/2)*Ref(C,-13)+
((n-29)/2)*Ref(C,-14)+
((n-31)/2)*Ref(C,-15)+
((n-33)/2)*Ref(C,-16)+
((n-35)/2)*Ref(C,-17)+
((n-37)/2)*Ref(C,-18)+
((n-39)/2)*Ref(C,-19);
sOneC:=((n-41)/2)*Ref(C,-20)+
((n-43)/2)*Ref(C,-21)+
((n-45)/2)*Ref(C,-22)+
((n-47)/2)*Ref(C,-23)+
((n-49)/2)*Ref(C,-24)+
((n-51)/2)*Ref(C,-25)+
((n-53)/2)*Ref(C,-26)+
((n-55)/2)*Ref(C,-27)+
((n-57)/2)*Ref(C,-28)+
((n-59)/2)*Ref(C,-29);
sOneD:=((n-61)/2)*Ref(C,-30)+
((n-63)/2)*Ref(C,-31)+
((n-65)/2)*Ref(C,-32)+
((n-67)/2)*Ref(C,-33)+
((n-69)/2)*Ref(C,-34)+
((n-71)/2)*Ref(C,-35)+
((n-73)/2)*Ref(C,-36)+
((n-75)/2)*Ref(C,-37)+
((n-77)/2)*Ref(C,-38)+
((n-79)/2)*Ref(C,-39);
sOneE:=((n-81)/2)*Ref(C,-40)+
((n-83)/2)*Ref(C,-41)+
((n-85)/2)*Ref(C,-42)+
((n-87)/2)*Ref(C,-43)+
((n-89)/2)*Ref(C,-44)+
((n-91)/2)*Ref(C,-45)+
((n-93)/2)*Ref(C,-46)+
((n-95)/2)*Ref(C,-47)+
((n-97)/2)*Ref(C,-48)+
((n-99)/2)*Ref(C,-49);
sOne:=sOneA+sOneB+sOneC+sOneD+sOneE;
yTwo:=TN+(6*sOne)/((N+1)*N);
yTwo
(Go
Top) |
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.}
(Go
Top) |
The
MFI (Money Flow Index) can be used in place of the OBV (On
Balance Volume) and Chaikin Oscillator to confirm Bollinger
Bands.
From Stocks & Commodities magazine, v. 12:8 (321-324):
SIDEBAR: The Money Flow Index
"The money flow index (MFI) is a volume-weighted form of
the relative strength index (RSI). Instead of using up closes
versus down closes, the MFI compares today's average price
to yesterday's average price and then weighs the average
price by volume to calculate money flow (MF). The ratio
of the summed positive and negative money flows are then
normalized to be on a scale of zero to 100."
Here are the MetaStock formulas for the Money Flow Index:
Positive Money Flow:
sum ( if ( typ( ) ,> ,ref ( typ ( ) ,-1 ) ,V * typ (
) ,0 ) , PERIODS)
Negative Money Flow:
sum ( if ( typ( ) ,< ,ref ( typ( ) ,-1) ,V * typ ( )
* -1 ,0 ) , PERIODS)
Money Flow Ratio:
fml ( "Positive Money Flow" ) / fml ( "Negative Money Flow"
)
Money Flow Index:
100 - ( 100 / ( 1 + fml ( "Money Flow Ratio" ) ) )
NB:The time periods are controlled by PERIODS in the Positive
& Negative Money Flow formulas.
(Go
Top) |
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
(Go
Top) |
"The
MetaStock moving average function has an option for displacing
the mov both vertically and horizontally. most of the time,
I prefer to use a mov channel in place of Bollinger Bands."
from
L. and G. Issen
"I
use moving average, instead of Bollinger Bands, creating
three indicators in the following way, and saving them in
a template:
Mov(C,
28,S) displaced +10%
Mov(C,
28,S) displaced - 10%
Mov(C,
28,S)
28
days is the basic span of time. Like the 10% +/-, this should
be adjusted for each security and for the particular condition
you are waiting for (buy/sell). When I see a buying opportunity
ahead, I just draw another trio of faster MAs (keeping the
slow on the chart) and use them, with other indicators/oscillators,
to time the entry. Same process to exit the market."
(Go
Top) |
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)
(Go
Top) |
What
follows is a simple example using a moving average crossover
system for MetaStock, employing 10 and 30 day exponential
averages. These are just examples and profitability is dubious.
Custom indicator which gives 1 for longs and -1 for shorts--
Indicator Name: Position
MASwitch:=If(Mov(C,10,E)>Mov(C,30,E),1,If(Mov(C,10,E)<Mov(C,30,E),-1,0));
If(BarsSince(MASwitch=1) <BarsSince(MASwitch=-1),1,-1)
Custom indicator for cumulative open Equity curve without
trading costs--
Indicator name: Equity
Cum(If(Ref(Fml("Position"),-1)=1,C-Ref(C,-1),Ref(C,-1)-C))
You can make several such equity lines and then just add
them by using a yet another custom indicator, e.g.,
Indicator name: TotalEquity
Fml("Equity1")+Fml("Equity2")
(Go
Top) |
200
dma violated by 100%
enter short
c>=(mov(c,200,s)*2)
200 dma violated by 50%
enter short
c>=(mov(c,200,s)*1.5)
200 dma w/i 1 pt
enter long
c>=mov(c,200,s)+1
exit long
((if ((c<=prev(llv(c,15)-.5, 1)),1,0)) + (if
((c<=.75*hhv(c,10)),1,0)))>=1
enter short
c<=mov(c,200,s)-1
exit short
c>=hhv(llv(c,15), 15)+.5
200 dma w/i 3pts
enter short
c<=mov(c,200,s)-3
exit short
c>=hhv(llv(c,15), 15)+.5
21 d reversal w di
enter long
c>prev(hhv(c,21),1) and adx(1)>adx(14) and
(pdi(9)>mdi(14))
exit long
c<prev(llv(c,21),1) and (pdi(14)<mdi(9))
enter short
c<prev(llv(c,21),1) and adx(1)>adx(14) and
(pdi(9)<mdi(14))
exit short
c>prev(hhv(c,21),1) and (pdi(9)>mdi(14))
(Go
Top) |
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))
(Go
Top) |
{Multiple
Time Frame - Tendency 5/23/99}
{This will plot 1 for Bullish
-1 for Bearish}
dw:=DayOfWeek();
Fw:=If(dw<Ref(dw,-1),1,0);
Mt:=If(Fw=1 AND Ref(dw,-1)<>5,
{then}Ref(C,-1)- FmlVar("MTF-Fixed Balance Point","DWP"),
{else}If(dw=5,
{then}C-((HighestSince(1,Fw=1,H)+
LowestSince(1,Fw=1,L)+C)/3),
{else}0));
If(Mt>0,1,If(Mt<0,-1,0));
(Go
Top) |
QUESTION:
I've got a specific question. I use WOW and MetaStock. Suppose
I've got some indicator that ranges from 0 to 100 and I
have a system that says "buy when the indicator goes above
90 and hold until it goes below 10 and then sell" or something.
Notice that if the indicator is between 10 and 90 that you
don't know whether that's a hold or a don't hold unless
you know whether it last crossed 90 or 10. So far so good.
Now suppose I want to combine the signal from this system
with another indicator/system so that I can say something
like "buy when system #2 says buy only if system #1 is in
"hold the stock" mode." This may take the form of another
indicator that is "1" when the system is in hold mode and
"0" when it is in don't hold mode. This seems like a general
problem that must come up often but it is not obvious to
me how to code it. I'll bet other people could benefit from
the answer as well.
Bob Anderton
ANSWER:
Thanks to all of you for the great help and input to the
question of how to deal with combining the indicators in
a system when one of them gives a signal by crossing. There
were two responses, one can be seen in #3310 from Larry
on the Yahoo! MetaStock board (thanks Mike) which is answering
a slightly different question. That solution seems like
what one would use if one wanted to look for system 2 signalling
a buy the same day as system 1 signalling a buy by crossing
a value. What I actually wanted to do was have a way of
looking for system 2 signalling a buy during anytime that
system 1 was saying hold because its last signal had been
a buy.
This was addressed very nicely by Paul in message #3311.
I took his idea to make the following indicator:
If(BarsSince(Cross(Fml("Indicator1"),90))<BarsSince(Cross(10,Fml("Indicator1"))),1,0)
This makes a new indicator that is 1 when the last signal
is a buy and 0 when the last signal was a sell. Imagine
that this is a really long term indicator. Now you can look
for your short term indicator #2 to signal a sell and just
AND it with this new indicator being = 1, meaning that the
first indicator was in hold mode.
This is a big step forward for me. I'd never used this BARSSINCE
function before(which is PERIODSSINCE for WOW) and this
was key to being able to do this I think.
(Go
Top) |
Mutated
Variables, Volatility and a New Market Paradigm by Walter
T. Downs, Ph.D.
In
MetaStock for Windows 6.0 or higher, use the Expert Advisor
to create highlights, which will show when contraction and
expansion phases are present. First, choose Expert Advisor
from the tools menu in MetaStock. Create a new Expert with
the following highlights:
Expert
name: New Market Paradigm
HIGHLIGHTS
Name:
Contraction
Condition:
BBandTop(CLOSE,28,SIMPLE,2)< Ref(BBandTop(CLOSE,28,SIMPLE,2),-1)
AND
BBandBot(CLOSE,28,SIMPLE,2)>Ref(BBandBot(CLOSE,28,SIMPLE,2),-1)
Color:
Blue
Name:
Expansion
Condition:
BBandTop(CLOSE,28,SIMPLE,2)> Ref(BBandTop(CLOSE,28,SIMPLE,2),-1)
AND
BBandBot(CLOSE,28,SIMPLE,2)<Ref(BBandBot(CLOSE,28,SIMPLE,2),-1)
Color:
Red
Click
OK to save the changes to the Expert. Open a chart and then
click your right-mouse button while pointing at the chart
heading. Choose Expert Advisor and then choose Attach from
the chart shortcut menu. Choose the New Market Paradigm
Expert and then click the OK button. The price bars in the
chart will be highlighted blue during a contraction phase
and red in an expansion phase.
(Go
Top) |
Vidya{P}
Periods:=Input("length of MA",5,100,20);
K:=Stdev(P,5)/Mov(Stdev(P,5),20,S);
A:=(2/(Periods+1));
Vidya:=A*K*(P)+(1-A*K)*Ref(P,-1);
Vidya;
Tar(SZ)an Long
C-(((462*Mov(C,34,E))-(420*Mov(C,13,E))+(490*(Mov(Mov(C,13,E)-Mov(C,34,E),89,E))))/42)
Tar(SZ)an Short
(C-(((325*Mov(C,26,E))-(297*Mov(C,12,E))+(351*Mov(Mov(C,13,E)-Mov(C,26,E),9,E))))/28)*2
(Go
Top) |
The
following formulas were constructed using interpretation
from Technical Analysis of Stocks & Commodities
Magazine June 1994, article "The Market Facilitation
Index", by Gary Hoover.
Taken
from Stocks & Commodities, V. 12:6 (253-254): The Market
Facilitation Index by Gary Hoover
"Applying
technical analysis to developing trading signals begins
with the investigation of price movement and often incorporates
volume studies to improve trading accuracy. The Market Facilitation
Index (MFI) is one indicator that synthesizes both price
and volume analysis. The MFI is the ratio of the current
bar's range (high-low) to the bar's volume.
The
MFI is designed to gauge the efficiency of price movement.
The efficiency is measured by comparing the current bar's
MFI value to the previous bar's MFI value. If the MFI increased,
then the market is facilitating trade and is more efficient,
implying that the market is trending. If the MFI decreased,
then the market is becoming less efficient, which may indicate
a trading range is developing that may be a trend reversal…."
Range:
High-Low
MFI:
Fml("Range") / Volume
Efficiency:
If(Fml("MFI"),>,Ref(Fml("MFI"),-1),1, If(Fml("MFI"),<,Ref(Fml("MFI"),-1),-1,
If(Fml("MFI"),=,Ref(Fml("MFI"),-1),0,0)))
Where:
+1 = increase
-1 = decrease
0 = unchanged
Market
Facilitation Comparison:
If(V,>,Ref(V,-1),If(Fml("MFI"),>,Ref(Fml("MFI"),-1)
,1,If(Fml("MFI"),<,Ref(Fml("MFI"),-1),2,0)),If(V,<
,Ref(V,-1),If(Fml("MFI"),>,Ref(Fml("MFI"),-1),3,If( Fml("MFI"),<,Ref(Fml("MFI"),-1),4,0)),0))
Where:
1 = +,+
2 = +,-
3 = -,+
4 = -,-
(Go
Top) |
In
the August 1996 Stocks & Commodities, an article by
Thom Hartle titled "The Market Facilitation Index" showed
how to color bars to identify chart patterns based on changes
in the market facilitation index and volume. Here is how
to do this in MetaStock 6.0's new Expert Advisor.
The
first step is to create a new expert by choosing Expert
Advisor from MetaStock's Tool menu, and then choose New
from the Expert Advisor. Name the expert "Market Facilitation
Index", enter any notes you like and then click on the Highlights
tab. Enter the following Highlights by choosing New, the
color and then entering the following formulas:
Green
Bar (Green Bar)
ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) > 0
Fade
Bar (Blue Bar)
ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) < 0
Fake
Bar (Dk Gray Bar)
ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) < 0
Squat
Bar (Red Bar)
ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) > 0
After
you have entered the four highlights click OK to finish
editing the expert's properties. You can now right-click
on the heading or background of any chart. Next select Expert
Advisor and then Attach from the Chart shortcut menu. Attach
the market facilitation index expert, and it will highlight
the four market facilitation patterns that were discussed
in Hartle's article. Note: You can save a chart as a template
with this expert attached, and then any time you apply the
template to a chart the market facilitation index expert
will automatically attach to the chart.
--
Allan J. McNichol, Equis International
(Go
Top) |
The
following formulas were taken from the article, "The
Cumulative Market Thrust Line", by Tushar Chande, in
the December 1993 issue of Technical Analysis of Stocks
& Commodities.
Taken
from Stocks & Commodities, V. 11:12 (506-511): The Cumulative
Market Thrust Line by Tushar S. Chande, PhD.
"STOCKS
& COMMODITIES contributor Tushar Chande originally introduced
the concept of market thrust in August 1992 as a method
by which to overcome the limitations of the Arms index.
Since then, variations have been suggested on the theme
and here, Chande offers the variation of a cumulative market
thrust line, in which market thrust is cumulated to calculate
a volumetric advance-decline line by including the effect
of up and down volume."
Composite
securities are created from 4 separate files. Advances,
Declines, Upvolume, Downvolume. The article side bar presupposes
the user has these four files.
Reuters
Trend Data (RTD) supplies this data in two files. The tickers
are X.NYSE-A (Advances, number and volume) and X.NYSE-D
(Declines, number and volume). To use these two files, you
must utilize two different custom formulas and the indicator
buffer in MetaStock™ for DOS.
CompuServe
supplies this data in 4 files. The tickers are NYSEI (Advances);
NYSEJ (declines); NYUP (Advance volume) and NYDN (decline
volume).
Dial/Data
supplies this data in two files. Advances, number and volume
and Declines, number and volume. The tickers are @*NAZ_K
and @*NDZ_K.
For
the Windows versions of MetaStock:
For
RTD and Dial Data:
#1:
C * V
#2: 100 * ( ( P - ( C * V ) ) / ( ( P + ( C * V ) ) ) )To
plot it:
-
Load
advances, plot formula #1.
-
Load
declines.
-
Drag
the plotted formula #1 from the advances in to the declines
chart.
-
Plot
the thrust indicator formula (#2) directly on top of
the plotted formula #1 in the declines chart.
For
CompuServe data:
#1:
C
#2: 100 * ( ( P - C ) / ( ( P + C ) ) )
To
plot it:
-
Create
a composite of the Advances * Up Volume
-
Create
a composite if the Declines * Down Volume
-
Load
advances composite , plot formula #1.
-
Load
declines composite.
-
Drag
the plotted formula #1 from the advances in to the declines
chart.
-
Plot
the thrust indicator formula (#2) directly on top of
the plotted formula #1 in the declines chart.
**
To create the cumulative thrust oscillator line perform
the same steps as above except change formula #2 to:
Cum(100*(P-C)/(P+C))
for CompuServe data
Cum(100*(P-(C*V))/(P+(C*V))) for RTD and Dial Data
**
To create the cumulative market thrust line, the formula
is:
Cum(P-C)
for CompuServe data
Cum(P-(C*V)) for RTD and Dial Data
You
now have the thrust indicator plotted exactly as the article
discusses.
(Go
Top) |
The
KST indicator was developed by Martin J. Pring. The name
KST comes from "Know Sure Thing". The KST is constructed
by summing four smoothed rates of change. For more interpretation
refer to Martin Pring's article "Summed Rate of Change
(KST)" in the September 92 issue of TASC.
The following formulas are MetaStock formulas for the KST.
Daily KST Simple Moving Average
(Mov(Roc(C,10,%),10,S)*1)
+ (Mov(Roc(C,15,%),10,S)*2) + (Mov(Roc (C,20,%),10,S)*3)
+ (Mov(Roc(C,30,%),15,S)*4)
Long-Term
Monthly KST Simple Moving Average
(
(Mov(Roc(C,9,%),6,S)*1) + (Mov(Roc(C,12,%),6,S)*2) + (Mov(Roc(C
,18,%),6,S)*3) + (Mov(Roc(C,24,%),9,S)*4) ) / 4
Intermediate
KST Simple Moving Average
(Mov(Roc(C,10,%),10,S)*1)
+ (Mov(Roc(C,13,%),13,S)*2) + (Mov(Roc (C,15,%),15,S)*3)
+ (Mov(Roc(C,20,%),20,S)*4)
Intermediate
KST Exponential Moving Average
(Mov(Roc(C,10,%),10,E)*1)
+ (Mov(Roc(C,13,%),13,E)*2) + (Mov(Roc (C,15,%),15,E)*3)
+ (Mov(Roc(C,20,%),20,E)*4)
Long-Term
KST Exponential Moving Average
(Mov(Roc(C,39,%),26,E)*1)
+ (Mov(Roc(C,52,%),26,E)*2) + (Mov(Roc (C,78,%),26,E)*3)
+ (Mov(Roc(C,109,%),39,E)*4)
Short-Term
KST Weekly Exponential Moving Average
(Mov(Roc(C,3,%),3,
E)*1) + (Mov(Roc(C,4,%),4, E)*2) + (Mov(Roc(C,6,%),6, E)*3)
+ (Mov(Roc(C,10,%),8, E)*4)
(Go
Top) |
The
Mass Index was designed to identify trend reversals by measuring
the narrowing and widening of the range between the high
and low prices. As the range widens the Mass Index increases;
as the range narrows the Mass Index decreases.
The
MASS Index appeared in the June 92 Technical Analysis
of Stocks & Commodities article "The Mass Index",
by Donald Dorsey.
Taken
from Stocks & Commodities, V. 10:6 (265-267): The Mass
Index by Donald Dorsey
"Range
oscillation, not often covered by students of technical
analysis, delves into repetitive market patterns during
which the daily trading range narrows and widens. Examining
this pattern, Donald Dorsey explains, allows the technician
to forecast market reversals that other indicators may miss.
Dorsey proposes the use of range oscillators in his mass
index."
The
following is the MetaStock formula for
Sum(Mov(
( H - L ) ,9 ,E) / Mov(Mov( ( H - L ) ,9 ,E) ,9 ,E ) ,25
)
(Go
Top) |
Ref(Mov(C,12,E),-1)+((C-(Ref(Mov(C,12,E),-1)))
/ (C/(Ref(Mov(C,12,E),-1))*125))
(Go
Top) |
The
interpretation for the Modified Volatility Index was taken
from the article Modifying The Volatility Index,
by S. Jack Karczewski, in the April 1995 issue of TASC.
The Volatility Index (VIX) is the implied volatility of
a group of Standard & Poors 100 index options. It is
updated by the CBOE.
This
formula assumes you can get the VIX information downloaded
from some data vendor, such as Dial Data, Telescan, or DBC
Signal.
The
custom formula you should create is the Modified VIX:
(
( ( P - Mov( P ,15 ,E ) ) / Mov( P ,15 ,E ) ) * ( 100 *
33 * 2 ) ) * ( Sqrt( 252 ) / Sqrt( 15 ) / C )
The
steps to get the actual charts are:
For
the Windows versions of MetaStock:
1
- Open the chart of the OEX
2 - Open the chart of the VIX.
3 - Drag the plot of the OEX into the chart of the VIX.
4 - Plot the formula for the Modified VIX directly on top
of the OEX plot.
You
now have a plot of the Modified VIX.
**For
interpretation of the Modified VIX refer to Mr. Karczewski's
article.
(Go
Top) |
Mov(((ROC(C,12.8,%))+(ROC(C,19.2,%))),10,W)
(Go
Top) |
Frequently
we get requests for a formula that would take only one day
of the week and average them for several weeks. For example
construct a moving average of only the Fridays. This can
be done in MetaStock™ for Windows by using the following
formula.
The
following MetaStock formula is for a moving average of the
Friday of every week, if you want it calculated on any other
day you would substitute a 1 for Monday, 2 for Tuesday,
3 for Wednesday, and 4 for Thursday. The number of day you
wanted would replace the two 5's already in the formula.
This moving average is currently a 6 week or 6 Friday moving
average. If you wanted to change it to another periodicity
you would change the 30 to the number of weeks or specific
days multiplied by 5. In other words if you wanted a 4 day
moving average of Friday you would change the 30 to 4*5
or 20.
Mov(If(DayOfWeek(
)=5,C,Peak(1,If(DayOfWeek( )=5,C,0),1)),30,S)
(Go
Top) |
MACD
Crossover System
To create the 2/20-Day EMA Breakout System
by David Landry in MetaStock for Windows, choose System
Tester from the Tools menu. Now choose new and enter the
following system test rules and options:
Signal
Formulas |
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.
(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.
|