小幫手您好
這是從書上複寫下來的語法,
在編譯時會顯示在最後一行出問題
但我實在找不出原因......
能否請小幫手幫我確認看看, 感激不盡~~
XS如下:
if barfreq<>"min" or barInterval<>1 then raiseRunTimeError("本腳本只適用1分K");
variable:barcount(0), openvol(0), H15(0), L15(0), _range(0);
if date<>date[1] then barcount=1 else barcount+=1;
input:txt("啟動後只觸發一次","觸發設定");
if barcount=15 then
//目前時間已來到09:15:00
begin
H15= highest(High, 15);
//前15分鐘的最高點
L15= lowest(Low, 15);
//前15分鐘的最低點
openvol = volume[14];
//第一根K bar的量
end;
if L15 <>0 then _range = H15/L15 -1;
condition1=false;
if close > H15 and _range >=0.01 and openvol/Getfield("成交量", "D")[1] > 0.03
then
begin
condition1=true;
retmsg= "Long"; //買進訊號
condition2=false;
if close < L15 and _range >=0.01 and openvol/Getfield("成交量", "D")[1] > 0.03
then
begin
condition2=true;
retmsg= "Short";
end;
if currenttime>= 091600 and
(close/Getfield("收盤價", "D")[1] -1 <=0.05 or
close/Getfield("收盤價", "D")[1] -1 >=-0.05 and
(condition1 or condition2)
and average(Getfield("成交量", "D")[1], 5)>1000 then ret=1;
2 評論