選股
技術
var:up1(0),mp1(0),lp1(0);
up1 = low+(high-low)*1.382;
mp1 = (high+low)/2;
lp1 = high-(high-low)*1.382;
if close > mp1 then ret=1;
Stochastic(期數, K值平滑期數, D值平滑期數, 輸出RSV值, 輸出K值, 輸出D值)
:計算 KD 指標。可計算 KD 指標的 RSV、K 及 D 三個數值。Stochastic 函數回傳 1 時,代表計算成功。RSV、K 及 D 的值是回傳在第 4、5、6 個參數。
input: Length(9, "天數"), RSVt(3, "RSVt權數"), Kt(3, "Kt權數");
var: rsv(0), k(0), d(0), days(0), j(0);
Stochastic(Length, RSVt, Kt, rsv, k, d);
j = 3 * d - 2 * k;
if k > 80 and _d > 40 and j > 20 then ret = 1;