This was posted on a forum and I am looking to use it in esignal. Is there an easy way to convert?? Thanks for your help.
'Gann HiLo' MetaStock Indicator code.
HLd:=If(CLOSE>Ref(Mov(H,2,S),-1),
{then}1,
{else}If(CLOSE<Ref(Mov(L,2,S),-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}Mov(H,2,S),
{else}Mov(L,2,S));
HiLo;
'Gann HiLo' trading system, MetaStock Expert code.
{Highlights: Buy}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=1
{Highlights: Sell}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=0
{Symbol: Buy}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=1 AND Ref(X,-1)=0
{Symbol: Sell}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=0 AND Ref(X,-1)=1
Edit: include Indicator.
'Gann HiLo' MetaStock Indicator code.
HLd:=If(CLOSE>Ref(Mov(H,2,S),-1),
{then}1,
{else}If(CLOSE<Ref(Mov(L,2,S),-1),
{then}-1,
{else}0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,
{then}Mov(H,2,S),
{else}Mov(L,2,S));
HiLo;
'Gann HiLo' trading system, MetaStock Expert code.
{Highlights: Buy}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=1
{Highlights: Sell}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=0
{Symbol: Buy}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=1 AND Ref(X,-1)=0
{Symbol: Sell}
HLd:=If(CLOSE>Ref(Mov(H,3,S),-1),1,If(CLOSE<Ref(Mov(L,3,S),-1),-1,0));
HLv:=ValueWhen(1,HLd<>0,HLd);
HiLo:=If(HLv=-1,Mov(H,3,S),Mov(L,3,S));
Buy:=Cross(C,HiLo);
Sell:=Cross(HiLo,C);
X:=If(BarsSince(Buy)<BarsSince(Sell),1,If(BarsSinc e(Buy)>BarsSince(Sell),0,1));
X=0 AND Ref(X,-1)=1
Edit: include Indicator.
Comment