FOR迴圈語法問題
各位大神想要統計加總一段週期內的"收盤價>中位數及收盤價>昨日收盤價"與"收盤價<中位數及收盤價<昨日收盤價" 次數.
但print出來是錯誤的,正確是要跟excel的圖一樣.
程式碼是哪邊寫錯了?? 還請各位大神指教.
程式碼如下
//---------------------------------------------------------------------------------------------------------------------------------------------------------
inputs:MMILen( 5 );
variables:l_MMI(0),MMI(0),nlow(0),nhigh(0),j(0);
l_MMI = Median(C,MMILen);
nhigh = 0;
nlow = 0;
for j=0 to MMILen-1 begin
if c > l_MMI and c > c then
nhigh = nhigh+1
else
if c < l_MMI and c < c then
nlow = nlow+1;
end;
MMI = 100*(nhigh + nlow) / (MMILen-1);
plot1(MMI,"MMI");
print(date,"",time,"",c,"",nhigh,"",nlow,"",l_MMI,"",j,"");
//---------------------------------------------------------------------------------------------------------------------------------------------------------
會不會是nhigh = nhigh+1 少加了 ; 結尾
頁:
[1]