小幫手您好,我的程式是自己選中的股票在開盤時買進,買進後同時掛【均價漲幅為2%】時賣出的委託單,當衝成功後結束執行。但這幾天測試的時候,出現了低於均價賣出成交、虧損的情況,想請教一下小幫手程式上是否有哪裡寫錯的情況。
if FilledRecordCount<>0 and filled=0 then condition10=dateadd(FilledRecordDate(FilledRecordCount), "D", 1)<=date else condition10=True;
// 底倉進場 //
If CurrentTime >= 090000 Then Begin
if position=0 and filled=0 and close[1]>0 and condition10 then SetPosition(1,market);
End;
// 當衝2限價 //
if Position > 0 or Filled>0 and close>FilledAvgPrice then begin
value1=FilledAvgPrice*1.02;
value2=AddSpread(value1, 1);
SetPosition(0, value2, label:="委買金額");
end;
4 評論