if date<>ref(date,1) then n:=0; if 開倉條件 then begin buy(); n:=n+1; end
n就是開倉次數
[此貼子已經被作者于2015/1/29 9:42:07編輯過]
用戶回復:H10:=REF(HHV(H,5),1);L10:=REF(LLV(L,5),1);VARIABLE:m=0;if date<>ref(date,1) then m:=0; if h>h10 and holding<=entervol*1 and (m=0 or m=1) and time>091600 and time<150000 then begin sellshort(1,0,market); buy(1,1,market); m:=m+1; endif l<l10 and holding<=entervol*-1 and (m=0 or m=1) and time>091600 and time<150000 then begin sell(1,0,market); buyshort(1,1,market); m:=m+1; end if L<ENTERPRICE-20 and enterbars>0 then begin sell(1,entervol,market); endif h>ENTERPRICE+20 and enterbars>0 then begin sellshort(1,entervol,market); end if time>=151000 then begin sellshort(1,0,market); sell(1,0,market); m:=0; end 這樣寫,哪個地方錯了,一筆交易都沒有