小幫手 您好
最近一直在測試 卻發現setposition(filled, market) 刪單交易指令都不執行
可否幫我看看問題在哪邊?
if hasPosition then begin
if c<filledAvgPrice*0.96 then begin
setposition(0);
alert("停利賣出"+numToStr(c,2)+"成本"+numToStr(filledAvgPrice,2));
end;
if hasPosition and c>filledAvgPrice*1.04 then begin
setposition(0);
alert("停損賣出"+numtostr(c,2)+"成本"+numToStr(filledAvgPrice,2));
end;
if CurrentTime>131000 and hasPosition then setposition(0);//開始平倉
if CurrentTime>131600 and CurrentTime<131800 then setposition(filled, market);//刪單
if CurrentTime>132200 and hasPosition then setposition(0,market);//市價清空部位
end;
1 評論