請問一下夜盤自動停損平倉為何無法平倉
看print出來的資料顯示只抓到日盤的數值,但是夜盤的數值都未顯示,請問該如何解決這問題
FIMTX*1.TF Date: 20231004 K棒時間 134100 電腦時間 194422 dnline 16246.834955 upline 16263.965045
FIMTX*1.TF Date: 20231004 K棒時間 134200 電腦時間 194422 dnline 16246.625901 upline 16263.974099
FIMTX*1.TF Date: 20231004 K棒時間 134300 電腦時間 194422 dnline 16246.033395 upline 16263.966605
FIMTX*1.TF Date: 20231004 K棒時間 134400 電腦時間 194422 dnline 16244.492427 upline 16264.307573
=============================================================
variable: upline(0), dnline(0);
upline = bollingerBand(close, 20, 2);
dnline = bollingerBand(close, 20, -2);
print(file("E:\test\test.log"), symbol,"Date:", NumToStr(Date, 0),
"K棒時間", NumToStr(time, 0), "電腦時間", NumToStr(currenttime, 0), "dnline", dnline, "upline", upline);
//3.判斷是否有部位
if (Time>084500 and time<134400) or (Time>150000 or Time<045900) then begin //這行有加沒加結果都一樣不會執行
if filled > 0 then begin
if low <= dnline then setposition(0,market);
end;
if filled < 0 then begin
if high >= upline then setposition(0,market);
end;
end;

不管目前部位多空都不會平倉,或者已經有多空部位後啟動策略也是不會平倉
1 評論