警示未觸發

  •   258 
  • 最後發表   貓老大  2021 五月 05
貓老大 發文於   2021/03/22

小編您好,

我有以下警示程式片段

// 大盤漲跌家數穿越

var: UpUps (0), lastUpUps (0);

var: DwDws (0), lastDwDws (0);

 

if time = TSE_OPEN_TIME then

 begin

  UpUps = GetSymbolField("TSE.TW", "上漲家數", "D");

  DwDws = GetSymbolField("TSE.TW", "下跌家數", "D");

  lastUpUps = UpUps;

  lastDwDws = DwDws;

 end

else

 begin

  lastUpUps = UpUps;

  lastDwDws = DwDws;

  UpUps = GetSymbolField("TSE.TW", "上漲家數", "D");

  DwDws = GetSymbolField("TSE.TW", "下跌家數", "D");

 end;

 

PRINT (NumToStr (time, 0), "|", NumToStr (UpUps, 0), "|", NumToStr (DwDws, 0), "|", NumToStr (lastUpUps, 0), "|", NumToStr (lastDwDws, 0));

if UpUps > DwDws and lastUpUps < lastDwDws then

 begin

  AlertMsg = AlertMsg + " | ↑ 上漲家數穿越";

  ret = True;

  retmsg =  AlertMsg;

 end;

 

if UpUps < DwDws and lastUpUps > lastDwDws then

 begin

  AlertMsg = AlertMsg + " | ↓ 下跌家數穿越";

  ret = True;

  retmsg =  AlertMsg;

 end;

因為盤中應該出警示而未出,因此特意加了 PRINT去觀察,以下為PRINT的結果

100500 | 544 | 445 | 542 | 443 

100600 | 543 | 444 | 544 | 445   <--- 策略啟動

100700 | 543 | 444 | 543 | 444 

100800 | 543 | 444 | 543 | 444 

100900 | 543 | 444 | 543 | 444 

發現啟動後,似乎即時資料抓取一直都未更新,可否幫忙確認,謝謝。

 

 

排序方式: 標準 | 最新
XQ小幫手 發文於   2021/03/23

Hi 貓老大,

小幫手簡單使用指標去撰寫 GetSymbolField("TSE.TW", "上漲家數", "D"); 將其值畫在圖上是會更新的,

故請提供以下資訊,Mail 至 XQservice@XQ.com.tw,並附上此討論文章的連結網址,以利小幫手釐清問題的原因。

  • 有問題的策略雷達匯出檔案(*.DSRX)匯出時記得勾選包含自訂腳本 ← 雖然您有提供語法,不過需要查看雷達相關設定才能釐清。
  • Log資料夾(預設路徑:C:\SysJust\XQLite\LOG)壓縮檔案 ← 若語法與雷達設定小幫手釐清無誤,則會請相關人員查看此檔確認問題的原因為何。

貓老大 發文於   2021/03/23

Hi 小幫手,

 

已寄, 我測試的結果,盤後執行都沒有問題,但即時盤就會無法更新值,夜盤的內外盤資料也有奇怪的問題,從某一根K線後就沒有資料更新了,但切換視窗後回來,又會有資料了,滿奇怪的現象

小揚 發文於   2021/03/23

有這樣問題+1

指標畫圖 回測等等都沒問題

但是盤中 GetSymbolField("OTC.TW","均價") 素質都是0

不知如何解決 

小揚 發文於   2021/03/25

小編您好,

我有以下警示程式片段

// 大盤漲跌家數穿越

var: UpUps (0), lastUpUps (0);

var: DwDws (0), lastDwDws (0);

 

if time = TSE_OPEN_TIME then

 begin

  UpUps = GetSymbolField("TSE.TW", "上漲家數", "D");

  DwDws = GetSymbolField("TSE.TW", "下跌家數", "D");

  lastUpUps = UpUps;

  lastDwDws = DwDws;

 end

else

 begin

  lastUpUps = UpUps;

  lastDwDws = DwDws;

  UpUps = GetSymbolField("TSE.TW", "上漲家數", "D");

  DwDws = GetSymbolField("TSE.TW", "下跌家數", "D");

 end;

 

PRINT (NumToStr (time, 0), "|", NumToStr (UpUps, 0), "|", NumToStr (DwDws, 0), "|", NumToStr (lastUpUps, 0), "|", NumToStr (lastDwDws, 0));

if UpUps > DwDws and lastUpUps < lastDwDws then

 begin

  AlertMsg = AlertMsg + " | ↑ 上漲家數穿越";

  ret = True;

  retmsg =  AlertMsg;

 end;

 

if UpUps < DwDws and lastUpUps > lastDwDws then

 begin

  AlertMsg = AlertMsg + " | ↓ 下跌家數穿越";

  ret = True;

  retmsg =  AlertMsg;

 end;

因為盤中應該出警示而未出,因此特意加了 PRINT去觀察,以下為PRINT的結果

100500 | 544 | 445 | 542 | 443 

100600 | 543 | 444 | 544 | 445   <--- 策略啟動

100700 | 543 | 444 | 543 | 444 

100800 | 543 | 444 | 543 | 444 

100900 | 543 | 444 | 543 | 444 

發現啟動後,似乎即時資料抓取一直都未更新,可否幫忙確認,謝謝。

 

 請問這位大大有解決了嗎  我還是找不到解決辦法

XQ小幫手 發文於   2021/03/25

已收到 MeowBoss 的來信,待小幫手釐清後,在向您說明,謝謝。

小揚 發文於   2021/03/26
貓老大 發文於   2021/04/19

請問小幫手,此問題是否有任何進展?

XQ小幫手 發文於   2021/04/21

Hello 貓老大,

 

小幫手用您提供的腳本作測試後發現確實有您所說的情況。

目前已將此問題轉告知工程師。

若有進一步消息會在通知。

感謝。

XQ小幫手 發文於   2021/05/05

Hello 貓老大,

 

此問題已在接下來會更新的版本中修正。

感謝。

發表回覆
Close