我想找 sma50向上,sma20向上,收盤價在sma50之上,sma20在sma50之上,macd黃金交叉的股票
我從系統例子湊出以下,但好像挑不出符合的標的
可以幫我確認一下嗎? 感恩~~
input: shortlength(20); setinputname(1,"短期均線期數");
input: Longlength(50); setinputname(2,"長期均線期數");
input: FastLength(12), SlowLength(26), MACDLength(9);
variable: difValue(0), macdValue(0), oscValue(0);
settotalbar(3);
setbarback(maxlist(shortlength,Longlength));
SetTotalBar((maxlist(FastLength,SlowLength,6) + MACDLength) * 3 + 8);
variable: Longaverage(0);
variable: shortaverage(0);
SetInputName(1, "DIF短期期數");
SetInputName(2, "DIF長期期數");
SetInputName(3, "MACD期數");
Longaverage = Average(close,Longlength);
shortaverage=Average(close,shortlength) ;
MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue);
if Longaverage[0]>Longaverage[1]
and shortaverage[0]>shortaverage[1]
and shortaverage > Longaverage
and close > Longaverage
and difValue Crosses Above macdValue
then ret=1;

2 評論