input: Len1(20,"期數"), Len2(120,"期數");
variable: m1(0), m2(0);
variable: rsv(0), k(0), _d(0);
SetTotalBar(maxlist(9,6) * 3);
Stochastic(9, 3, 3, rsv, k, _d);
m1=average(close, len1);
m2=average(close, len2);
if close> m1 and close> m2 and m1> m2
then condition11=true
else condition11=false;
condition12= k < _d;
condition13= k[1] > 75;
if condition11 and condition12 and condition13 then plot1(low, "賣出放空");
if close< m1 and close< m2 and m1< m2
then condition21=true
else condition21=false;
condition22= k > _d;
condition23= k[1] < 25;
if condition21 and condition22 and condition23 then plot2(high, "買進回補");
4 評論