GLOBALVARIABLE:zs=0,bj=0;
if bj=0 and c<tenterprice-50 then tsell(1,0,mkt);
if TOPENPROFIT>0 and vol>ref(ma(vol,5),1)*2 and bj=0 then begin
tsell(1,33%,mkt),pertrader;
bj:=1;
end
if bj=1 and c<tenterprice-20 then tsell(1,0,mkt);
if TOPENPROFIT>0 and vol>ref(ma(vol,5),1)*2 and bj=1 then begin
bj:=2;
tsell(1,50%,mkt),PERTRADER;
end
if c<tenterprice and bj=2 then tsell(1,0,mkt);
if timetot0(dynainfo(207))>timetot0(closetime(0))-5 then begin
bj:=0;
tsell(1,0,mkt);
end