MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

CandleCode II and Candle Strength Index by Viktor Likhovidov
Here is the formula from this months TASC called Candle code this is only using 1 formula
not like the one in TASC which is broken up into several smaller ones.

CandleCode II

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

Candle Strength Index

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

Source / From: TOP