請求下面三個案例的 XS 語法

  •   212 
  • 最後發表   kes  2022 七月 05
kes 發文於   2022/06/29

我需要下面三個案例的 XS 語法

案例一:
條件A:kd 在 20 以下並且黃金交叉
條件B:MACD 柱狀體由負翻正
請列出結果的個股

案例二:
條件A:日線 RSI 往上穿越 50
條件B:60 分 K 線 RSI 往上穿越 60
請列出結果的個股

案例三:
條件A:擁有股票期貨的個股
請列出結果的個股

XQ小幫手 發文於   2022/07/05

Hello kes,

 

您的問題在內建的範例腳本以及教學區都可以找的到答案。

小幫手幫您改寫後整理起來。

 

1.

SetTotalBar((maxlist(FastLength,SlowLength,6) + MACDLength) * 4);

input: Length(9), RSVt(3), Kt(3);

variable: rsv(0), k(0), _d(0);

Stochastic(Length, RSVt, Kt, rsv, k, _d);

condition1 = k crosses above _d and k < 20 and _d < 20;

 

input: FastLength(12), SlowLength(26), MACDLength(9);

variable: difValue(0), macdValue(0), oscValue(0);

MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue);

condition2 = oscValue Crosses Above 0;

 

if condition1 and condition2 then ret = 1;

 

2.頻率應該使用60分鐘,並用 xf_RSI 取得日頻率的RSI資訊。

input: day_len(6), min_len(6)

settotalbar(maxlist(day_len, 6) * 9 * 5);

value1 = xf_RSI("W",GetField("Close","W"),day_len);

value2 = RSI(Close, min_len);

condition1 = value1 cross over 50;

condition2 = value2 cross over 60;

if condition1 and condition2 then ret = 1;

 

3.

if GetSymbolInfo("WithFuture") then ret = 1;

 

建議您可以先閱覽相關教學文章

發表回覆
Close