有排除特定行業的寫法 請問有無 (選定 )特定行業的寫法?

  •   324 
  • 最後發表   N 核函數  2019 十一月 14
N 核函數 發文於   2019/11/10

在XQ的點點滴滴看到這篇好文,請問一下

https://xstrader.net/%e9%81%b8%e8%82%a1%e5%b8%b8%e7%94%a8%e8%aa%9e%e7%9a%84%e5%b0%8d%e6%87%89%e7%a8%8b%e5%bc%8f%e9%9b%86%e4%ba%8c/


有排除特定行業的寫法



Q:請問有無 (選定 )特定行業的寫法?

排序方式: 標準 | 最新
XQ小幫手 發文於   2019/11/13

 Hi N核函數

您好,依照第七點"排除特定行業"的寫法

您可以控制condition1的結果,達到您的目的

如下修改,若您想增加業種別,請再input跟if的判斷新增您要選取的類別

settotalbar(1);

input:exclude_1(0, "挑選XQ建築");
input:exclude_2(0, "挑選XQ金融");
input:exclude_3(0, "挑選XQ航運");

variable: XQ_group (callfunction("XQ_類股"));


condition1 = false;
if exclude_1 = 1 and XQ_group = "建材營造" then condition1 = true;
if exclude_2 = 1 and XQ_group = "金融保險" then condition1 = true;
if exclude_3 = 1 and XQ_group = "航運業" then condition1 = true;
if condition1 = true then ret = 1;

outputfield(1, XQ_group, 0, "XQ 類股");

以上說明,謝謝。

N 核函數 發文於   2019/11/14

感謝XQ團隊的用心

發表回覆
Close