Rank: Advanced Member
Groups: Registered, Registered Users Joined: 9/26/2005(UTC) Posts: 185 Location: Brazil
|
This code was written by JOSE, as a reply to me in a different forum:
---8<-----------------
{ SMAs }
ma1:=Mov(C,4,S);
ma2:=Mov(C,5,S);
ma3:=Mov(C,6,S);
ma4:=Mov(C,7,S);
ma5:=Mov(C,8,S);
ma6:=Mov(C,9,S);
ma7:=Mov(C,10,S);
{ Highest SMA on last bar }
HiMa:=LastValue(Max(ma1,Max(ma2,Max(ma3,Max(ma4,Max(ma5,Max(ma6,ma7))
)))));
HiMa:=
If(HiMa=LastValue(ma1),ma1,
If(HiMa=LastValue(ma2),ma2,
If(HiMa=LastValue(ma3),ma3,
If(HiMa=LastValue(ma4),ma4,
If(HiMa=LastValue(ma5),ma5,
If(HiMa=LastValue(ma6),ma6,
ma7))))));
{ Lowest SMA on last bar }
LoMa:=LastValue(Min(ma1,Min(ma2,Min(ma3,Min(ma4,Min(ma5,Min(ma6,ma7))
)))));
LoMa:=
If(LoMa=LastValue(ma1),ma1,
If(LoMa=LastValue(ma2),ma2,
If(LoMa=LastValue(ma3),ma3,
If(LoMa=LastValue(ma4),ma4,
If(LoMa=LastValue(ma5),ma5,
If(LoMa=LastValue(ma6),ma6,
ma7))))));
{ Plot on price chart }
HiMa;LoMa
---8<-----------------
jose '-)
http://www.metastocktools.com
Thanks Jose
Bulli
|