bbdcd 發表於 13-1-23 12:41

結算日下一日

小弟想寫結算日下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;

之後
仍然沒有頭緒..

請高手幫忙.
感恩


mewmi 發表於 13-1-24 19:30

b大.. 請參考.. {:4_209:}

http://www.coco-in.net/thread-23562-1-1.html

bbdcd 發表於 13-1-25 07:41

mewmi 大 感恩感恩感恩感恩
頁: [1]
查看完整版本: 結算日下一日