請問,日內(nèi)以來的開倉次數(shù),如何表達(dá)
作者:金字塔 來源:cxh99.com 發(fā)布時(shí)間:2015年02月09日
- 咨詢內(nèi)容:
如題,謝謝
- 金字塔客服:
用全局變量,開一次倉開倉次數(shù)加1,例如
VARIABLE:n=0;
if date<>ref(date,1) then n:=0;
if 開倉條件 then begin
buy();
n:=n+1;
end
n就是開倉次數(shù)
[此貼子已經(jīng)被作者于2015/1/29 9:42:07編輯過]
- 用戶回復(fù):
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; end if 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); end if 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
這樣寫,哪個(gè)地方錯(cuò)了,一筆交易都沒有
- 網(wǎng)友回復(fù):
把全部代碼貼出來,不要一直貼你認(rèn)為錯(cuò)誤的那一部分
- 網(wǎng)友回復(fù):
這就是全部了