-- 模型没信号,帮忙修改
variable:dt:=0,kt:=0;
ma5:ma(close,5);
ma10:ma(close,10);
ma20:ma(close,20);
dtpl:=ma5>ma10 and ma10>ma20;
ktpl:=ma5<ma10 and ma10<ma20;
if close-enterprice>=20*mindiff and holding>0 then
begin
dt:=if(dtpl,1,0);
sell(holding>0,holding,market);
end
dt:=if(dt=1 and dtpl,1,0);
if dtpl and dt=0 then buy(holding=0,1,market);
if enterprice-close>=20*mindiff and holding<0 then
begin
kt:=if(ktpl,1,0);
sellshort(holding<0,holding,market);
end
kt:=if(kt=1 and ktpl,1,0);
if ktpl and kt=0 then buyshort(holding=0,1,market);