請教:KDJ指標 選股程式如何寫 J值只挑選 J=-5以下,同時 BIAS(5) (10) (20) 為負值??
感謝!!
        
        請教:KDJ指標 選股如何設定 J值只挑選 -J=5之下,同時 BIAS(5) (10) (20) 為負值??
- 394
 - 最後發表 Duca 2024 一月 18
 
Hello Duca,
網站上有教學區,裡面有XS語法的基礎和應用可以閱覽。
您可以使用 Stochastic 函數計算KD值並以KD值另外計算出J值 (可參考內建的KDJ指標腳本)。
同時搭配bias計算出的數值當作條件即可。
舉例來說:
input: Length(9), RSVt(3), Kt(3), JType(0);
variable: rsv(0), k(0), _d(0), j(0);
SetTotalBar(maxlist(Length,6) * 3);
Stochastic(Length, RSVt, Kt, rsv, k, _d);
if JType = 0 then
j = 3 * k - 2 * _d
else
j = 3 * _d - 2 * k;
condition1 = j <= -5;
condition2 = bias(5) < 0 and bias(10) < 0 and bias(20) < 0;
if conditino1 and condition2 then ret = 1;
感謝教學,
請教:KDJ指標 選股程式如何寫 J值只挑選 J=-5以下,同時 BIAS(5) (10) (20) 為負值??
感謝!!小編您好:
我嘗試加入setbarfreq("Hour");//60minK,去偵測 60minK 但是看來無法執行,
有其他方法嗎??
setbarfreq("D");
input: Length(9), RSVt(3), Kt(3), JType(0);
variable: rsv(0), k(0), _d(0), j(0),h_j(0), h_k(0), h_d(0);
SetTotalBar(maxlist(Length,6) * 3);
Stochastic(Length, RSVt, Kt, rsv, k, _d);
value1 = (average(close,3));
if JType = 0 then
j = 3 * k - 2 * _d
else
j = 3 * _d - 2 * k;
condition1 = j <= -10;
condition2 = bias(5) < -5 and bias(10) < -5 and bias(20) < -5;
setbarfreq("Hour");
Stochastic(Length, RSVt, Kt, rsv, h_k, h_d);
if JType = 0 then
h_j = 3 * h_k - 2 * h_d
else
h_j = 3 * h_d - 2 * h_k;
condition3 = h_j <= -1;
condition4 = bias(5) < -1;
if condition1 and condition2 and condition3 and condition4 then ret = 1;
Hello Duca,
網站上有教學區,裡面有XS語法的基礎和應用可以閱覽。
選股中心只能夠使用日以上的頻率,無法使用分鐘頻率。
如果要篩選分鐘頻率的話請使用策略雷達。
另外 SetBarFreq 只是指定這個腳本能夠使用的頻率,並不會讓該腳本執行在該頻率上。
您分別傳入也不會同時計算日頻率和分鐘頻率的資訊。
 
            
            
4 評論