編譯時沒有錯誤,但是執行時卻提示分母可能為0無法顯示的警示
可以麻煩幫我檢視嗎?以下是程式碼
Input:length1(8),length2(13),length3(26);
variable: SU(0),SD(0);
if close >= close[1] then
SU = CLOSE - CLOSE[1]
else
SU = 0;
if close < close[1] then
SD = CLOSE[1] - CLOSE
else
SD = 0;
value1 = (summation(SU,length1)-summation(SD,length1))/(summation(SU,length1)+summation(SD,length1))*100;
value2 = (summation(SU,length2)-summation(SD,length2))/(summation(SU,length2)+summation(SD,length2))*100;
value3 = (summation(SU,length3)-summation(SD,length3))/(summation(SU,length3)+summation(SD,length3))*100;
plot1(value1, "CMO1");
plot2(value2, "CMO2");
plot3(value3, "CMO3");
5 評論