if filled = 0 and position = 0 and 進場條件 then setposition(2, c) // 進場單
if position<>0 and position = filled and C>停損價 then setposition(0, market); // 停損單1
在自動交易,現沖賣單 停損單條件寫上 position=filled,
若程式實際上委託單丟2張,實際成交到只有1張
會使得停損單, 因為 position不等於 filled,不會丟停損單?
還是只需要寫這樣就可了?
if position<>0 and C>停損價 then setposition(0, market); // 停損單2
謝謝回覆。
3 評論