交易策略写好K线缩小源码如下:请帮忙解决
input:mm1(4,4,5,1);
input:mm2(4,2,5,1);
input:mm3(5,4,6,1);
input:mm5(200,170,260,10);
input:mm6(7,6,10,1);
runmode:0;
variable:ema12=c,ema26=c,dea=0;
if day<>ref(day,1) then begin
ema12:=c;
ema26:=c;
dea:=0;
end
ema12:=ema12*11/13+c*2/13;
ema26:=ema26*25/27+c*2/27;
diff:ema12-ema26;
dea:=dea*4/5+diff/5;
dea1:dea;
macd:2*(diff-dea),colorstick;
input:shou(2,1,5,1);
TYP:= (HIGH + LOW + CLOSE)/3;
cci:=(TYP-MA(TYP,6))/(0.015*AVEDEV(TYP,6));
开多1:count(diff>ref(diff,1),mm1)=mm1;
开多2:count(macd>ref(macd,1),mm2)=mm2;
开多3:count(diff>dea1,mm3)=mm3;
开多:开多1 AND 开多2 AND 开多3;
开空1:count(diff<ref(diff,1),mm1)=mm1;
开空2:count(macd<ref(macd,1),mm2)=mm2;
开空3:count(diff<dea1,mm3)=mm3;
开空:开空1 AND 开空2 AND 开空3;
平多1:=count(macd<ref(macd,1),mm4)=mm4;
平多2:=cci>mm5;
平空1:=count(macd>ref(macd,1),mm4)=mm4;
平空2:=cci<-mm5;
平多:平多1 or 平多2 or CLOSE<=(ENTERPRICE-mm6);
平空:平空1 or 平空2 or CLOSE>=(ENTERPRICE+mm6);
IF HOLDING>0 AND 平多 THEN SELL(1,0,MARKET);
IF HOLDING>0 AND TIME=151200 THEN SELL(1,0,MARKET);
IF HOLDING<0 AND 平空 THEN SELLSHORT(1,0,MARKET);
IF HOLDING<0 AND TIME=151200 THEN SELLSHORT(1,0,MARKET);
IF HOLDING=0 AND 开多 AND TIME<150900 THEN BUY(1,1,MARKET);
IF HOLDING=0 AND 开空 AND TIME<150900 THEN BUYSHORT(1,1,MARKET);
开空1:count(diff<ref(diff,1),mm1)=mm1;
类似只有冒号的这些地方,全都改为冒号等号
开空1:=count(diff<ref(diff,1),mm1)=mm1;