在價值型機器人裡,金牌定存股這個策略是在尋找每年獲利都超過五億,且近五年獲利獲利都還算穩定的公司,然後在這樣的公司移動平均線出現翻多的情況時,通知使用者。
金牌定存股這個 選股策略是由兩個腳本組成,第一個是找出金牌定存股的腳本
1input:lowlimit(5,"年度獲利下限(億)"); 2 3value1=GetField("本期稅後淨利","Y");//單位:百萬 4value2=lowest(value1,5);//五年獲利低點 5value3=average(value1,5);//五年來平均獲利 6if value1/100> lowlimit//獲利超過年度獲利下限 7and value1/100<50//獲利沒有超過五十億元 8and 9value1>value1[1]*0.9 10and value1[1]>value1[2]*0.9//年度獲利連續兩年未衰退超過一成 11and value2*1.3>value3 12//五年來獲利最差的時候比平均值沒有掉超過三成 13 14then ret=1; 15 16outputfield(1, value1/100, 1, "稅後淨利(億)");
第二個腳本則是用月線及季線來定義目前股價處在什麼位置
1variable:m20(0),m60(0),message("0") ; 2m20=average(close,20); 3m60=average(close,60); 4if close > m20 and c< m60 and m20<m60 5then message="復甦期" 6else 7if close > m20 and c> m60 and m20<m60 8then message="收集期" 9else 10if close > m20 and c> m60 and m20 > m60 11then message="多頭" 12else 13if close < m20 and c>m60 and m20>m60 14then message="警示期" 15else 16if close < m20 and c<m60 and m20>m60 17then message="發散期" 18else 19if close < m20 and c<m60 and m20<m60 20then message="空頭"; 21 22 23 24if message<>message[1] 25and message="多頭" 26and message[1]="收集期" 27and message[2]="收集期" 28and volume>500 and close>10 29then ret=1; 30outputfield1(message); 31setoutputname1("今日訊號"); 32outputfield2(message[1]); 33setoutputname2("昨日訊號"); 34outputfield3(message[2]); 35setoutputname3("前日訊號");
這個腳本的概念是從下面這張圖來的
腳本的概念是不管之前是什麼階段,第一天回頭多頭時就觸發通知訊號。
把這兩個腳本結合起來,就是當獲利穩定的公司,股價重返多頭的第一天,就請機器人發出警訊。
以上是金牌定存股的說明
