資料輸出的問題

  •   118 
  • 最後發表   阿狗QAZ  2023 一月 13
阿狗QAZ 發文於   2023/01/11

 

if getfielddate("Date") <> getfielddate("Date")[1] then value1 = volume; //開盤第一根成交量

if currentTime >= 090100 and currentTime <= 093000 then begin

    value2 = getbarOffset(date, 090100);

    condition1 = volume = highest(volume, value2) ;

    condition2 = volume > value2 ;    

    condition3 = GetField("量比", "1") > 1 ;

    condition4 = GetField("Volume", "D") > 200;

    condition5 = GetField("Volume", "D")[1] > 500    ;

    condition6 = GetField("high","1") > GetField("high","1")[1] ;

    condition7 = GEtField("HIGH","D") >= GEtField("open","D")*1.012 ;

    condition8 = GetField("買進特大單量") > (GetField("成交量") * 0.1) ;//特大單比重大於10趴

    condition9 = (GetField("買進特大單量")+GetField("買進大單量"))*4 >= GetField("成交量") ;//主力力道大於25趴

    condition10 = GetInfo("IsRealTime") = 1 ;

    if
      condition1 and condition2 and condition3 and condition4 and condition5 and condition6 and condition6 and condition7 and condition8 and condition9 and condition10
      then begin

             ret = 1;

             print (file("C:\Users\jim\Downloads\破高.txt"),Symbol,SymbolName,"時間=", NumToStr(Date, 0), "成交=", NumToStr(Close, 2), "量=", GetField("量比", "1"), "漲幅=",GetQuote("PriceChangeRatio"));  

         end;

    end;

為什麼輸出的文字檔都一堆重複的是哪裡錯嗎?

XQ小幫手 發文於   2023/01/13

Hello 阿狗QAZ,

 

小幫手不知道您的雷達是怎麼設定的,所以無法確定問題原因。

 

不過您的腳本中可以注意以下幾點:

condition1 = volume = highest(volume, value2+1);  //這裡應該是 value2 + 1 才對

condition2 = volume > value2 ;  //value2是距離 090100 的K棒偏移量,直接跟成交量比是不是有哪裡錯了?

 

print (Symbol,SymbolName,"時間=", NumToStr(Date, 0), "成交=", NumToStr(Close, 2), "量=", GetField("量比", "1"), "漲幅=",GetQuote("PriceChangeRatio"));

裡面的"時間"印出來的是日期,"量"印出來的是量比。

小幫手會建議您在print的時候將 time 和 currenttime 一併印出,這樣會比較容易判斷。

 

若還是有問題的話,麻煩您提供 策略雷達匯出檔勾選(包含)警示腳本、發生問題的商品和日期時間 以及 XQ Log 來檢驗。

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

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

感謝。

發表回覆
Close