zh1:=STKINDI(\'\',\'kk.jc\',0,7,-1);//周线3日均线上穿8日均线
zh2:=STKINDI(\'\',\'kk.sc\',0,7,-1);//周线3日均线下穿8日均线
r1:=STKINDI(\'\',\'kk.jc\',0,6,-1);//日线3日均线上穿8日均线
r2:=STKINDI(\'\',\'kk.sc\',0,6,-1);//日线3日均线下穿8日均线
if zh1 and r1 then
buy(holding=0,1,market);
if zh2 then
sell(holding>0,holding,market);
if r2 THEN
sell(holding>0,holding,market);
if zh2 and r2 then
buyshort(holding=0,1,market);
if zh1 THEN
sellshort(holding<0,1,market);
if r1 THEN
sellshort(holding<0,1,market);