--
LH2:=VALUEWHEN(HIGH<REF(HIGH,2) AND REF(HIGH,1)<REF(HIGH,2),REF(HIGH,2));
LL2:=VALUEWHEN(LOW>REF(LOW,2) AND REF(LOW,1)>REF(LOW,2),REF(LOW,2));
FLAG:=IF(CLOSE>LH2,2,IF(CLOSE<LL2,1,0));
FLAG1:=VALUEWHEN(FLAG<>0,FLAG);
tt:=time0-timetot0(dynainfo(207));
if REF(FLAG1=2,1) then sellshort(1,0,market);
if REF(FLAG1=2,1) and ((islastbar and tt<=10) or not(islastbar)) then buy(holding=0,1,market);
if REF(FLAG1=1,1) then sell(1,0,market);
if REF(FLAG1=1,1) and ((islastbar and tt<=10) or not(islastbar)) then buyshort(holding=0,1,market);
必须使用固定轮询模,时间间隔设置为1秒
[此贴子已经被作者于2014/12/23 9:34:22编辑过]