結算日下一日
小弟想寫結算日下2日但
小弟參考
凱衛官網結算日範例程式
vars: pPosition(0), pMP(0), pEndTime(0);
array: pCDate(0);
pMP = marketposition;
if date <> date then begin //Set CloseDate
pCDate = pCDate;
if date >= _closedate() and pCDate = 0 then begin
pCDate = 1;
end else if Month(date) <> Month(date) then begin
pCDate = 0;
end;
if date >= 1081201 then pEndTime = 1330 else pEndTime = 1345;
end;
if pCDate = 0 and pCDate = 1 then begin //Day Bar CloseDate
setexitonclose;
pPosition = pMP;
if bartype = 1 then begin //Intra-Day
if time >= pEndTime then begin
sell("CloseDate(B)") this bar on Close;
buytocover("CloseDate(S)") this bar on Close;
pPosition = pMP;
end;
end else if bartype = 2 then begin //Day
if pPosition = 1 then begin
buy("B(D)") next bar at market;
end else if pPosition = -1 then begin
sellshort("S(D)") next bar at market;
end;
end;
end;
之後
仍然沒有頭緒..
請高手幫忙.
感恩
b大.. 請參考.. {:4_209:}
http://www.coco-in.net/thread-23562-1-1.html
mewmi 大 感恩感恩感恩感恩
頁:
[1]