這是我的程式
input: FastLength(12), SlowLength(26), MACDLength(9), KDLength(9), RSVt(3), Kt(3);
input: Length_W(9, "周KD期間");
variable: difValue(0), macdValue(0), oscValue(0),rsv(0), k(0), _d(0);
variable: rsv_w(0),kk_w(0),dd_w(0);
SetTotalBar( maxlist((maxlist(KDLength,6) * 3),((maxlist(FastLength,SlowLength,6) + MACDLength) * 4)));
SetInputName(1, "DIF短期期數");
SetInputName(2, "DIF長期期數");
SetInputName(3, "MACD期數");
SetInputName(4, "天數");
SetInputName(5, "RSVt權數");
SetInputName(6, "Kt權數");
MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue);
Stochastic(KDLength, RSVt, Kt, rsv, k, _d);
xf_stochastic("w", Length_W, 3, 3, rsv_w, kk_w, dd_w);
value1=(GetField("外資買賣超") + GetField("投信買賣超")+GetField("自營商買賣超"));
condition1 = k crosses over _d and k<30;
condition2 = volume > 300;
condition3 = GetField("成交量")>GetField("成交量")[1]*1.5;
condition4 = GetField("月營收年增率","M") > 0;
condition5 = GetField("每股稅後淨利(元)","Q") > GetField("每股稅後淨利(元)","Q")[4];
condition6 = value1 > 0 ;
Ret = condition1 and condition2 and condition3 and condition4 and condition5 and condition6 and difValue<0 and kk_w<50;
SetOutputName1("法人買賣超");
OutputField1(value1);
1 評論