可以請問以下有關當日13點強制平倉的語法那邊有問題,因為今日沒有觸發強制平倉的訊號,(自動交易中心的策略部位是選自動執行有部位商品及庫存異動時自動同步數值),主頻率為1分K,標的為昨日由選股中心選出後執行策略進場。
var: hasPosition(false) ,x(0);
hasPosition = position <> 0 and filled <> 0 and filledAvgPrice > 0;
if time >= 090000 and time < 093000 then x = getField("Low","D");
if currentTime >=090500 and currentTime<=091000 then begin
if position=0 and filled=0 and condition1
and (condition3 or condition4)
then begin setposition(1,market);
end;
end;
if position>0 and filled>0 then begin
if close>=value3*D2 then begin setposition(0,market); //value3為當日開盤價,D2為停利1.02%
end else if close<=filledAvgPrice*0.99 then begin setposition(0,market);
end else if time >= 093100 and close cross Under x then begin setposition(0,market);
end else if hasPosition and (time = 130000 or currentTime = 130000) then begin setPosition(0, market);
end;
end;
end;
6 評論