請問:試跑了以下語法,發現3035.TW在2024/8/9 09:01分時BCost的價格突然變成”0”,BOut的價格突然變成”346.7871”,而觸發出場條件出場,2376.TW在2025/4/14 09:01也發生同樣的情況,請問這會是什麼原因造成的?
//=======主頻率=======
if barfreq<>"D" then raiseRunTimeError("限用日頻率");
//=======宣告區=======
setBackBar(500);
Var:BCost(0),Bout(0);
//=======進場區=======
if position=0 and filled=0 and condition1
then begin
setposition(1,market);
BCost=C;
BOut=C*0.9;
end;
//=======出場區=======
if filled>0 and C<BOut then setposition(0,market);
print(file("C:\print\[ScriptName] .log"),Date,FormatTime("HH:mm:ss", CurrentTime),symbol,C,BCost,BOut);
20240809.000000 09:00:00 3035.TW 273.000000 273.000000 245.700000
20240809.000000 09:01:00 3035.TW 270.000000 0.000000 346.787100
20240809.000000 09:02:00 3035.TW 270.500000 270.500000 243.450000
20240809.000000 09:03:00 3035.TW 269.500000 269.500000 242.550000
3 評論