ma1:ma(c,10);
ma2:ma(c,30);
ma3:ma(c,60);
t1:cross(c,ma1);
p1:cross(ma1,c);
t2:cross(c,ma2);
p2:cross(ma2,c);
t3:cross(c,ma3);
p3:cross(ma3,c);
sell(p2 and holding>0,30%,market);
buy(t3 and holding=0,60%,market);
sell(p3 and holding>0,60%,market);
if t1 then
begin
sellshort(holding>0,10%,market);
buy(holding=0,10%,market);
end
if p1 then
begin
sell(holding>0,10%,market);
buyshort(holding=0,10%,market);
end
if t2 then
begin
sellshort(holding>0,30%,market);
buy(holding=0,30%,market);
end
if p2 then
begin
sell(holding>0,30%,market);
buyshort(holding=0,30%,market);
end
if t3 then
begin
sellshort(holding>0,60%,market);
buy(holding=0,60%,market);
end
if p3 then
begin
sell(holding>0,60%,market);
buyshort(holding=0,60%,market);
end