我使用原系統的選股程式.修改5日線>20日線>60日線及MACD的oscvalue值>0及MACD值>0,
程式如下,112/3/31選股出391檔,回技術分析查看很多都是oscvalue<0的股票
請問小幫手及各位高手.程式上有那地方要修改?
// MO 選股
input:Leng1(5),Leng2(20),Leng3(60);
variable: ma1(0), ma2(0), ma3(0);
SetInputName(1,"短均線");
SetInputName(2,"中均線");
SetInputName(3,"長均線");
settotalbar(3);
ma1 = average(close, Leng1);
ma2 = average(close, Leng2);
ma3 = average(close, Leng3);
condition1 = close > ma1;
condition2 = ma1 > ma2;
condition3 = ma2 > ma3;
input: FastLength(12), SlowLength(26), MACDLength(9);
variable: difValue(0), macdValue(0), oscValue(0);
SetTotalBar((maxlist(FastLength,SlowLength,6) + MACDLength) * 4);
SetInputName(4, "DIF短期期數");
SetInputName(5, "DIF長期期數");
SetInputName(6, "MACD期數");
MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue)
condition4 = oscValue>0 and macdValue>0;
if (condition1 and condition2 and condition3 and condition4) then
ret=1;
2 評論