TN:=1;
//M1:TIME0-TIMETOT0(DYNAINFO(207)),LINETHICK0;//剩余秒数
abb1:=(time0-timetot0(dynainfo(207)))<=TIME0-20 OR NOT(ISLASTBAR);
IF TN=1 AND abb1 THEN begin
if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END
if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);TN:=TN+1; END
end
abb2:=(time0-timetot0(dynainfo(207)))<=TIME0-40 OR NOT(ISLASTBAR);
IF TN=2 AND abb2 THEN begin
if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END
if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END
abb3:=(time0-timetot0(dynainfo(207)))<=TIME0-60 OR NOT(ISLASTBAR);
IF TN=3 AND abb3 THEN begin
if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END
if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END
end
abb4:=(time0-timetot0(dynainfo(207)))<=TIME0-80 OR NOT(ISLASTBAR);
IF TN=4 AND abb4 THEN begin
if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END
if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END
abb5:=(time0-timetot0(dynainfo(207)))<=TIME0-100 OR NOT(ISLASTBAR);
IF TN=5 AND abb5 THEN begin
if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END
if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END
end
30分钟K图表上,轮询模式中 间隔1秒轮询1次