pkkd:ref(CROSS(ZIG(3,10),REF(ZIG(3,10),1)),1); //平空开多条件
pdkk:ref(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),1); //平多开空条件
if pkkd then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end
if pdkk then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
if holding>0 and c<ref(low,enterbars+1) then //多头止损
sell(1,holding,market);
if holding<0 and c>ref(high,enterbars+1) then //空头止损
sellshort(1,holding,market);