Can any body interpret this code.I want to learn metastock programming
For Buy Signal:-
a1:=MACD()-Mov(MACD(),9,E)>Ref(MACD()-Mov(MACD(),9,E),-1) AND Ref(MACD()-Mov(MACD(),9,E),-1)<Ref(MACD()-Mov(MACD(),9,E),-2);
a2:=MACD()-Mov(MACD(),9,E)<Ref(MACD()-Mov(MACD(),9,E),-1) AND Ref(MACD()-Mov(MACD(),9,E),-1)>Ref(MACD()-Mov(MACD(),9,E),-2);
b1:=ValueWhen(1,a1,Ref(MACD()-Mov(MACD(),9,E),-1))>ValueWhen(2,a1,Ref(MACD()-Mov(MACD(),9,E),-1)) AND ValueWhen(1,a1,C)<ValueWhen(2,a1,C);
b2:=ValueWhen(1,a2,Ref(MACD()-Mov(MACD(),9,E),-1))<ValueWhen(2,a2,Ref(MACD()-Mov(MACD(),9,E),-1)) AND ValueWhen(1,a2,C)>ValueWhen(2,a2,C);
state1:=If(BarsSince(b1)<BarsSince(b2),1,0);
a:=state1>Ref(state1,-1);
b:=state1<Ref(state1,-1);
state:=If(BarsSince(a)<BarsSince(b),1,0);
state>Ref(state,-1)