-- 作者:victior
-- 发布时间:2011/11/29 21:51:13
-- [求助]求助,这个如何限制只开一手
模型如下,9:59:00这个时间开的仓位如何才能固定只开一手呢?其他时间的开仓都固定了一手,就是这个位置不行啊?
ss:=REFDATE(CLOSE,date,092900); if time=095900 then begin buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,0,market); end ss:=REFDATE(CLOSE,date,095900); if time=101300 then begin sellshort(holding<0 and C>=ss-17.03,0,market); sell(holding>0 and C<=ss+17.03,0,market); buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,1,market); end ss:=REFDATE(CLOSE,date,101300); if time=105900 then begin sellshort(holding<0 and C>=ss-17.03,0,market); sell(holding>0 and C<=ss+17.03,0,market); buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,1,market); end ss:=REFDATE(CLOSE,date,105900); if time=112800 then begin sellshort(holding<0 and C>=ss-17.03,0,market); sell(holding>0 and C<=ss+17.03,0,market); buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,1,market); end ss:=REFDATE(CLOSE,date,112800); if time=135900 then begin sellshort(holding<0 and C>=ss-17.03,0,market); sell(holding>0 and C<=ss+17.03,0,market); buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,1,market); end ss:=REFDATE(CLOSE,date,135900); if time=142900 then begin sellshort(holding<0 and C>=ss-17.03,0,market); sell(holding>0 and C<=ss+17.03,0,market); buy(holding=0 and C<=ss+17.03,1,market); buyshort(holding=0 and C>=ss-17.03,1,market); end
if time=145800 then begin sellshort(holding<0 ,0,market); sell(holding>0 ,0,market); end
|