請問執行策略雷達如何不讓print指令重複觸發執行

  •   152 
  • 最後發表   hs80205  2023 十一月 23
hs80205 發文於   2023/11/20

如題,策略雷達設定 k 棒內單次觸發,程式符合條件時觸發通知,XQ執行均正常,但唯獨 print指令會不斷重複執行,程式碼如下,請問是否有撰寫錯誤,請協助指導,謝謝。

var:intraBarPersist c0(0);   

var:price_change(0); 

if time=093000 or date<>date[1] then c0=0;

if time > 093000 then begin

    if isLastBar and c0=0 and condition1 and condition2 and condition5 and condition6 and condition20 and condition25 then begin

// ----print資訊----

price_change = 100 * ((close - GetField("參考價", "D")) / GetField("參考價", "D")); // 計算當日漲跌幅

print(file("D:\XQ2Line_beta-1\1\Strategy"),"漲跌幅:"+numtoStr(price_change, 2)+"%"); // 拋出當日漲跌幅

        ret=1;

        c0=1;

    end;

end;

 

XQ小幫手 發文於   2023/11/23

Hello hs80205,

 

小幫手看起來您的print函數應該有被 intrabarpersist 的變數給限制,當天應該只會在 093000 以後觸發和印出一次。

麻煩您提供 策略匯出檔勾選(包含)警示腳本、XQ Log 並告知問題發生的日期時間來檢驗。

Log資料夾(預設路徑:C:\SysJust\XQLite\LOG)直接壓縮後提供即可。

您可以直接將檔案上傳,如果檔案過大的話也可以保存到雲端後將連結Mail至客服信箱 XQservice@XQ.com.tw 且務必附上 討論文章連結網址(小幫手才能盡早處理)。

感謝。

發表回覆
Close