Hi 你好,
1.以下是我的程式 但是我要找的是 KD corss over 剛黃金交叉,但是我找到的卻是已經
金叉好幾天了~~請問是哪裡有問題呢?
(ex:2019/05/02 找出1109 ,看其KD已經黃金交叉4天了
2.有否程式碼可以得知今天是KD黃金交叉or 均線黃金交叉 後的幾天了嗎 ?
ex: 4天前5MA>20MA ,跑完成式後 可以讓我知道是4
謝謝
input:
BollinLength(20),
KDLength(9),
UpperBand(2),
RSVt(3),
Kt(3);
SetInputName(1, "布林通道天期");
SetInputName(2, "KD天期");
SetInputName(3, "布林通道標準差");
SetInputName(4, "RSVt權數");
SetInputName(5, "Kt權數");
variable: rsv(0), k(0), _d(0);
SetTotalBar(maxlist(KDLength,6) * 3);
Stochastic(KDLength, RSVt, Kt, rsv, k, _d);
if K crosses over _d then condition1=true;
if K crosses below _d then condition1 =false;
if condition1 = true and close >= bollingerband(Close, BollinLength, UpperBand) then ret = 1;
3 評論