
我想用過去稅後淨利率來預估未來本益比,但跑了之後發現錯誤一堆
首先2019/11/13 的收盤價根本不正確 1102 亞泥都來到44.75元了,還在27.4?
再來我有設定稅後淨利率要大於0才觸發條件
但怎麼印出來還是有稅後淨利率小於0的??
底下是完整程式碼
value1=GetField("月營收","M");//億
value2=GetField("營業利益率","Q");
value3=Average(GetField("月營收","M"),12)*12*Average(GetField("ProfitMargin","Q"),4)/100;
setoutputname3("稅後淨利率1");
outputfield3(GetField("ProfitMargin","Q")[0]);
setoutputname4("稅後淨利率2");
outputfield4(GetField("ProfitMargin","Q")[1]);
setoutputname5("稅後淨利率3");
outputfield5(GetField("ProfitMargin","Q")[2]);
setoutputname6("稅後淨利率4");
outputfield6(GetField("ProfitMargin","Q")[3]);
value4=GetField("最新股本");//億
variable:FEPS(0);
FEPS=value3/value4*10;
setoutputname1("用月營收預估的本業EPS");
outputfield1(FEPS);
if feps<>0
then value5=close/feps;
setoutputname2("用月營收預估的本益比");
outputfield2(value5);
if value5<12 and value5>0
then condition1=true;
input:lowlimit(20);//單位:%
setinputname(1,"成長百分比");
value6=GetField("月營收月增率","M");
value7=GetField("月營收年增率","M");
//if value6>=lowlimit
//and value7>=lowlimit
//and value6[1]>0
//then condition2=true;
if GetField("ProfitMargin","Q")>0 and GetField("ProfitMargin","Q")[1]>0 and GetField("ProfitMargin","Q")[2]>0 and GetField("ProfitMargin","Q")[3]>0
then condition2=true;
if condition1 and condition2
then ret=1;
1 評論