你好, 我用XS寫了第一分K開盤量警示, 語法如下, 警示觸發後並print出檔案, 但有個問題一直無法克服, 這警示的排程時間為08:55~09:10, 警示上的顯示只有第一個分K的計算, 但Print出來卻有很多檔案, 請問我要怎麼解決這件事, print資料請參考附件
value3 = average(getfield("Volume", "D")[1], 5);
Var: Targetfilename("");
if date <> date[1] then begin
value1=0;
end;
if time = 090000 and volume <> 0 and value1 = 0 then
begin
value1 = volume;
end
else if time = 090200 and volume <> 0 and value1 = 0 then
begin
value1 = volume;
end;
If value1 > value3 * 0.10
and value1 < value3 * 0.20
and value3 > 500
and getinfo("isrealtime")=1 //避免錯誤訊號
then begin
ret=1;
retmsg = "$大量";
Targetfilename = Text("D:\XQ\XQ2Line_beta-OpenV\Strategy\",
"$大量"," ",
Symbol," ",
SymbolName," ",
Numtostr(close,2)," ",
Numtostr(GetQuote("當日漲幅%"),1),"% ",
".txt");
Print(file(Targetfilename));
ret=1;
end;
3 評論