今天跑自動交易 放空智原突然自己進出場 以下是我出場條件 完全沒有達到卻1秒內進出請問是LAG造成讓她讀不到庫存的關係嗎?
vars:MaxPo(0);
if close>=200 and close<300 then MaxPo=-3;
value3 = floor(MaxPo / 3);
if position=0 then SetPosition(MaxPo,close);//進場指令
if close >= 200 and close < 300 and position <0 and filled<0 then begin
if close <= filledavgprice * 0.985 and position = MaxPo then SetPosition(MaxPo-value3,market);
if close <= filledavgprice * 0.97 and filled = MaxPo-value3 then SetPosition(MaxPo-(2 * value3),market);
if close <= filledavgprice * 0.935 and filled = MaxPo-(2 * value3) then SetPosition(0,market);//出場減碼
end;
if filled<=-1 and currentTime>130900
or close>=FilledAvgPrice*1.025
or price_change >= 7.8
or close<FilledAvgPrice*0.93
or price_change <= -8.5 then SetPosition(0,market);
圖1是智原突然同時間進出場導致直接賠1檔
圖2是已經放空的股票達到減碼條件卻因為進場額度上限達到出不了場 麻煩小編回答處理一下 謝謝
20 評論