Page 16                                                      

Same Direction

{It returns the number of periods the close is moving in the same direction.
A positive number indicates ascending close prices, a negative descending
ones and zero unchanged ones}

If(C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2),PREV+1,
If(C<Ref(C,-1) AND Ref(C,-1)<Ref(C,-2),PREV-1,
If(C>Ref(C,-1) AND Ref(C,-1)<=Ref(C,-2),1,
If(C<Ref(C,-1) AND Ref(C,-1)>=Ref(C,-2),-1,
0))))

This formula might be useful as a component of other indicators, systems or
explorations, rather than as a stand-alone indicator.
 

Zig Zag Validity

perc:=Input("Percent",2,100,10);
Z:=Zig(C,perc,%);
last:=ValueWhen(1,
( Z > Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2) )
OR
( Z < Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2) ),
Ref(Z,-1));
pc:=(C-last) * 100 / last;
pc:= Abs(pc);
SD:=(z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2)) OR (z<Ref(z,-1) AND
Ref(z,-1)<Ref(z,-2));
res:=If(pc>=perc ,1,0);
If(Alert(res,2) AND SD,1,res);

by Spyros Raftopoulos

Mick's Breakout Exploration

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.

regards mick (wintom)


Displace Indicator Forward

To displace an indicator forward, you use Ref(myInd,-p). The median and typical prices are built-in functions -- MP() is (H+L)/2 and typ() is (H+L+C)/3.

For MP, use

Period:= Input("What Period",1,250,10);
Disp:= Input("Forward Displacement",0,250,10);
EMA1:= Mov(MP(),Period,E);
EMA2:= Mov(EMA1,Period,E);
Difference:= EMA1 - EMA2;
ZeroLagEMA:= EMA1 + Difference;
Ref(ZeroLagEMA,-Disp)

from Bob Jagow



Gann Hi-Lo

colA
BUY
BarsSince(C< Fml("GANN-HiLo"))

colB
SELL
BarsSince(C> Fml("GANN-HiLo"))

filter
colA=1 OR colB=1

from Mike Arnoldi


Bollinger Bank Hook Up and Hook Down

I use the following indicators to show the price reversal of Bollinger Band penetration:

Name: Upper BB Hookdown
Formula:

UpperBB:= Mov(C,20,S) +(2*(Std(C,20)));
C < UpperBB AND Ref(C,-1) > Ref(UpperBB,-1);


Name: Lower BB Hookup
Formula:

LowerBB:= Mov(C,20,S) -(2*(Std(C,20)));
C > LowerBB AND Ref(C,-1) < Ref(LowerBB,-1);

from Jim Barone
 

Metastock % Bands Revised

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

{from HHP}

 

Mark Brown Band2 Study

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

{created by HHP from a Mark Brown system}


Modified 50 Day Moving Average


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

from Ton Maas ms-irb@planet.nl



ECO - R Krauz

The Robert Krauz article I read described the ECO as "a double smoothed ratio of the difference between the close(C) and open(O) of each bar, and the difference between the high(H) and low(L) prices for each bar" originally created by William Blau.

FWI my interpretation is:

{ECO[Ergodic Candlestick Oscillator]}
(MOV(MOV(C-O,5,E))26,E)/MOV(MOV(H-L,5,E))26,E))*100

J. Seed


Chandelier Exit 2

Here is the Fast Chandelier Exit in full as supplied to me. It is part of an exit strategy which you can adjust to your own trading style and comfort levels. from Ian Burgoyne

HHVDays:=Input("Days Since Trade Opened",1,300,1);

ATRDays:=Input("ATR Days",1,30,10);

ATRHighMult:=Input("ATR Multiplier From High",1,5,3.0);

ATRCloseMult:=Input("ATR Multiplier From Close",1,5,2.5);

HHVStop:= HHV(H,HHVDays) - ATRHighMult*ATR(ATRDays);

HighStop:= H - ATRHighMult*ATR(ATRDays);

CloseStop:= C - ATRCloseMult*ATR(ATRDays);

TodaysCalc:= If(HighStop > CloseStop, HighStop, CloseStop);

TodaysStop:= If(L <= PREV, TodaysCalc, If(HHVStop < PREV, PREV,
If(HHVStop >
C,PREV,HHVStop)));

HHVDays:=Input("Days Since Trade Opened",1,300,1);
ATRDays:=Input("ATR Days",1,30,10);
ATRHighMult:=Input("ATR Multiplier From High",1,5,3.0);
ATRCloseMult:=Input("ATR Multiplier From Close",1,5,2.5);
HHVStop:= HHV(H,HHVDays) - ATRHighMult*ATR(ATRDays);
HighStop:= H - ATRHighMult*ATR(ATRDays);
CloseStop:= C - ATRCloseMult*ATR(ATRDays);
TodaysCalc:= If(HighStop > CloseStop, HighStop, CloseStop);
TodaysStop:= If(L <= PREV, TodaysCalc, If(HHVStop < PREV, PREV,
If(HHVStop >C,PREV,HHVStop)));
TodaysStop

[from Ian Burgoyne}