我这样把它分别分开来写你看看可以吗?
//开多条件
kdtj:= L1>ref(L1,60) and gg2 and open >HEE4+10;
//开多
IF kdtj THEN
BEGIN
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
buy(holding=0,1,THISCLOSE);
END
//平多条件
pdtj:= h1<ref(h1,60) AND OO<REF(OO,60) and gg2 and OPEN >HEE4;
//平多
IF pdtj THEN
BEGIN
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
SELL(holding>0,holding,THISCLOSE);
END
//开空条件
kktj:={ h1<ref(h1,60) AND }OO<REF(OO,60) {and gg2 and open <LEE4-10};
IF kktj THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
BUYSHORT(holding=0,1,THISCLOSE);
END
//平空条件
pktj:= {L1>ref(L1,60) AND }OO >ref(OO,60) {and gg2 and open<LEE4 };
//平空
IF pktj THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
END