//LINETHICK0
diff:=stkindi('','macd.diff',0,5);
dea:=stkindi('','macd.dea',0,5);
macd:=stkindi('','macd.macd',0,5);
k:=stkindi('','kdj.k',0,5);
d:=stkindi('','kdj.d',0,5);
m1:=MA(CLOSE,5);
m4:=MA(CLOSE,40);
diff3:=stkindi('','macd.diff',0,17);
dea3:=stkindi('','macd.dea',0,17);
macd:=stkindi('','macd.macd',0,17);
k3:=stkindi('','kdj.k',0,17);
d3:=stkindi('','kdj.d',0,17);
m31:=MA(CLOSE,5);
m34:=MA(CLOSE,40);
VARIABLE:a1=0,a3=0,b1=0,b3=0,c1=0,c3=0,MX=0,MX3=0;
//开空
if cross(dea,diff) then a1=1;
if cross(D,K) then b1=1;
IF cross(M4,M1) and cross(M34,M31) THEN MX=1;
if a1=1 and b1=1 AND MX=1 then c1=1;//h两个指标同向交叉
if cross(dea3,diff3) then a3=1;
if cross(D3,K3) then b3=1;
if a3=1 and b3=1 then c3=1;//3分钟两个指标同向交叉
IF C1=1 AND C3=1 THEN buyshort(holding=0,1,market);//开空
IF CROSS(K3,D3) THEN sellshort(1,holding,market);
//if then buy(holding=0,1,market);//开多
//if cross(D,K) then sell(1,holding,market);
if cross(dea3,diff3) then a3=1;
if cross(D3,K3) then b3=1;
if a3=1 and b3=1 then c3=1;//3分钟两个指标同向交叉
红色部分,你是要赋值的吧?赋值只能用:或者:=。
单独的=号代表比较判断的意思。例如c1=1。意思是C1是否等于1。