取消或是再加一檔

  •   79 
  • 最後發表   Johnny66  2023 十月 24
Johnny66 發文於   2023/10/17

你好

Q1

if position = -1 and filled <> -1 and currenttime > TimeAdd(_time, "M", 2) then setposition(filled, market);   //如果沒有完全成交且超過2分鐘則取消未成交單}<><><><>以上是否正確

Q2

if position = 0 and filled <> 0 and currenttime > TimeAdd(_time, "M", 2) then......

同檔位2分鐘後未能平倉,再加一檔,該如何寫法

謝謝

XQ小幫手 發文於   2023/10/24

Hello Johnny66,

 

網站上有教學區,裡面有XS語法的基礎和應用可以閱覽。

 

1.小幫手不知道您的 _time 為什麼變數如何運算的,是否為 intrabarpersist,故無法確定。

如果是在條件符合進場時用 _time 保存當下的currenttime,且該變數為 intrabarpersist 的話就應該是正確的。

您可以將相關數值印出確認。

 

2.您可以使用 addspread 函數來計算調整檔位後的價格。

發表回覆
Close