Hello 
我用了一個指標當作選股參考寫腳本
code 如下 : 
input: FastLength(12), SlowLength(26), MACDLength(9), OscDecrease(5);
variable: price(0);
SetInputName(1, "DIF短天數");
SetInputName(2, "DIF長天數");
SetInputName(3, "MACD天數");
price = WeightedClose();
Value1 = XAverage(price, FastLength) - XAverage(price, SlowLength);
Value2 = XAverage(Value1, MACDLength) ;
Value3 = Value1 - Value2 ;
condition1 = CrossOver(Value1,Value2);
condition2 = Value3[1] < 0 and Value3 > 0;
condition3 = TrueAll(Value3>Value3[1], OscDecrease);
ret = condition1 and condition2 and condition3;
這樣子篩選出來的結果卻是
有 condition1 = 0 and condition2 = 0 and condition3 = 1 的結果 (如附圖)
我期望的結果是 condition1 = 1 and condition2 = 1 and condition3 = 1
想請問這段code是哪邊寫得有問題呢 謝謝
 
            
        
        
            
2 評論