<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>FinLab</title>
	<atom:link href="https://www.finlab.tw/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.finlab.tw</link>
	<description>深入淺出的量化投資，讓你在在茫茫股海中，找到專屬於自己的投資方法</description>
	<lastBuildDate>Tue, 04 Nov 2025 16:39:46 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.11</generator>

<image>
	<url>https://www.finlab.tw/wp-content/uploads/2020/07/favicon.png</url>
	<title>FinLab</title>
	<link>https://www.finlab.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">179699571</site>	<item>
		<title>Alpha Arena 背後的技術解析、缺陷與潛力</title>
		<link>https://www.finlab.tw/alpha-arena-%e8%83%8c%e5%be%8c%e7%9a%84%e6%8a%80%e8%a1%93%e8%a7%a3%e6%9e%90%e3%80%81%e7%bc%ba%e9%99%b7%e8%88%87%e6%bd%9b%e5%8a%9b/</link>
					<comments>https://www.finlab.tw/alpha-arena-%e8%83%8c%e5%be%8c%e7%9a%84%e6%8a%80%e8%a1%93%e8%a7%a3%e6%9e%90%e3%80%81%e7%bc%ba%e9%99%b7%e8%88%87%e6%bd%9b%e5%8a%9b/#respond</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Tue, 04 Nov 2025 16:39:43 +0000</pubDate>
				<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[加密貨幣]]></category>
		<category><![CDATA[技術面]]></category>
		<category><![CDATA[投資新手]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[機器學習]]></category>
		<category><![CDATA[程式交易]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6730</guid>

					<description><![CDATA[近期熱門的 Alpha Arena 專案，將 ChatGPT、Gemini、Grok 等不同的大型語言模型 ( [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img width="1024" height="699" src="https://www.finlab.tw/wp-content/uploads/2025/11/image-2-1024x699.png" alt="image 2" class="wp-image-6735" srcset="https://www.finlab.tw/wp-content/uploads/2025/11/image-2-1024x699.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/11/image-2-300x205.png 300w, https://www.finlab.tw/wp-content/uploads/2025/11/image-2-768x524.png 768w, https://www.finlab.tw/wp-content/uploads/2025/11/image-2-1536x1049.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/11/image-2-2048x1398.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" title="Alpha Arena 背後的技術解析、缺陷與潛力 1"></figure>



<p>近期熱門的 <a href="https://nof1.ai/" target="_blank" rel="noopener">Alpha Arena</a> 專案，將 ChatGPT、Gemini、Grok 等不同的大型語言模型 (LLM)，推上了金融交易的競技場，讓這些前沿 AI 模型槓桿交易Crypto，網頁是公開顯示歷史資金和持倉變化。這個概念極具吸引力：讓最強的 AI 們同台競技，比較它們的交易績效。</p>



<p>在令人興奮的「<strong>AI 交易</strong>」敘事之下，本文將從技術層面拆解 Alpha Arena 的運作機制，看看技術原理是否真的無懈可擊 ？</p>



<h2>一、 運作機制：當 LLM 成為量化交易員</h2>



<p>Alpha Arena 的核心是利用呼叫大型語言模型 API，讓多個 LLM 扮演交易決策者的角色。其運作流程可以拆解為「輸入」、「處理」與「輸出」三階段。</p>



<h3>輸入：將市場「<strong>文本化</strong>」的提示詞 </h3>



<p>系統會向 LLM 發送一個設計好的提示詞，其內容包含：</p>



<ul><li><strong>狀態數據 :</strong> 當前帳戶績效、倉位、交易次數等。<br></li></ul>



<figure class="wp-block-image size-full"><img loading="lazy" width="918" height="410" src="https://www.finlab.tw/wp-content/uploads/2025/11/image.png" alt="image" class="wp-image-6731" srcset="https://www.finlab.tw/wp-content/uploads/2025/11/image.png 918w, https://www.finlab.tw/wp-content/uploads/2025/11/image-300x134.png 300w, https://www.finlab.tw/wp-content/uploads/2025/11/image-768x343.png 768w" sizes="(max-width: 918px) 100vw, 918px" title="Alpha Arena 背後的技術解析、缺陷與潛力 2"><figcaption>交易狀態提示詞範例</figcaption></figure>



<ul><li><strong>市場數據 :</strong> 中間價、EMA (指數移動平均線) 等技術指標資料。<br></li></ul>



<figure class="wp-block-image size-full"><img loading="lazy" width="898" height="1018" src="https://www.finlab.tw/wp-content/uploads/2025/11/image-1.png" alt="image 1" class="wp-image-6732" srcset="https://www.finlab.tw/wp-content/uploads/2025/11/image-1.png 898w, https://www.finlab.tw/wp-content/uploads/2025/11/image-1-265x300.png 265w, https://www.finlab.tw/wp-content/uploads/2025/11/image-1-768x871.png 768w" sizes="(max-width: 898px) 100vw, 898px" title="Alpha Arena 背後的技術解析、缺陷與潛力 3"><figcaption>市場狀態提示詞範例</figcaption></figure>



<ul><li><strong>關鍵指標文本化:</strong> 這是本專案的特色之一。它將 MACD、RSI 這類傳統的時間序列數據，用<strong>自然語言</strong>描述出來（例如：「RSI 目前為 46.4」），強迫 LLM 在文本層面理解技術指標。</li></ul>



<h3>處理：模型的「思考鏈」 (Chain of Thought)</h3>



<p>下面是網頁上實際的 GPT-5 API 回應結果:</p>



<pre class="wp-block-code"><code lang="json" class="language-json">{"cot_trace": "**Examining liquidation risk**\n\nWhen it comes to a short position, liquidation happens if the price rises above a certain level. In my case, the liquidation price is 0.17 and it matches the entry, which gives me pause. Since the current price is 0.167, I’m feeling safe for now. Yet, the liquidation price being so close means I can't widen my stop, especially since it is set at 0.171712. That puts me at critical risk, as the stop is above the liquidation price.\n**Assessing long position risks**\n\nIt seems the liquidation price might be rounded, like 0.170 when it could have more decimals. If liquidation happens at 0.17, hitting 0.1717 would liquidate before the stop, which doesn’t seem feasible. While we shouldn't close early, I’m checking my long position in BNB. Invalidation requires a 4-hour candle close below 990 and open interest over 62000. Currently, the price is 993.635 and OI is 65954.12, which doesn’t trigger invalidation. Although the 4-hour trend is negative, I’ll stick to my strategy.\n**Confirming holding positions**\n\nI need to hold all six positions without any adjustments since modifications like adjusting stops or profit targets aren’t allowed. For each coin, I have to provide an object that includes several fields: coin, signal (which will be 'hold'), the full quantity size, profit target, stop loss, invalidation condition, leverage, confidence, and risk in USD. \n\nFor example, with ETH having a quantity of -1.3, I’m writing it as is since the instructions specify using the full current size. There’s a bit of confusion about sign conventions, but I’ll follow the guidelines provided for holding.\n**Finalizing position details**\n\nI’m confirming the details for short positions, where negative quantities matter. For example, the quantity for my first position is -1.3, so I’ll output that. The profit target is 3407.47, the stop loss is 3719.44, the leverage is 12, confidence is 0.63, and the risk is 156.53. \n\nI’ll check other positions too, like SOL with quantity -35.79, XRP -1509.0, and BTC -0.02. For BNB, I have a quantity of 3.5, a profit target of 1073.65, and a specific invalidation condition related to open interest that isn’t met yet.\n**Creating hold signal JSON**\n\nI need to ensure the hold signal is set correctly. If any stops or targets were triggered since entry, the system will handle that automatically. I won't enter new trades since we have existing positions in all symbols, and we can't increase size. \n\nThe output will be a single JSON object with keys for each coin: ETH, SOL, XRP, BTC, DOGE, and BNB. Each will have the required fields formatted as floats. I'll ensure precision and check if any invalidation for BNB has triggered, but we can't infer anything from the current status. Now, I’ll produce the JSON accordingly.\n",
"cot_trace_summary": "My current strategy is to hold all positions as my analysis suggests current market conditions do not warrant adjustments despite a significant overall loss. I'm maintaining my short positions in ETH, SOL, XRP, BTC, and DOGE, as well as my long position in BNB, focusing on their individual exit plans and risk management parameters."}</code></pre>



<p>如 <code>cot_trace</code> 所示，LLM 會接收提示詞，並進行一段類似人類的「思考過程」。它會評估風險（&#8221;Examining liquidation risk&#8221;）、評估倉位（&#8221;Assessing long position risks&#8221;），並最終決定其行動。</p>



<h3>輸出：結構化的 JSON 交易決策</h3>



<p>LLM 最終會回傳一個標準化的 JSON 物件，作為其交易指令。這個 JSON 包含了所有關鍵決策：</p>



<ul><li><strong>交易訊號 (Signal):</strong> <code>hold</code> (持有) 或 <code>sell</code> (賣出)。</li><li><strong>風險參數 (Risk Parameters):</strong> <code>profit_target</code> (止盈) 和 <code>stop_loss</code> (止損)。</li><li><strong>退出條件 (Invalidation Condition):</strong> 一個 LLM <strong>即時生成</strong>的、基於技術指標的出場規則（例如：「4 小時 K 線收盤價高於 3800 並且 4 小時的 MACD 柱狀圖連續 2 根為正值」）。</li><li><strong>信心指數 (Confidence):</strong> 一個 0 到 1 的數字，表示模型對此決策的信心。</li></ul>



<p>範例格式如下：</p>



<pre class="wp-block-code"><code lang="json" class="language-json">{
"ETH": {
          "risk_usd": 156.53,
          "leverage": 12,
          "confidence": 0.63,
          "quantity": -1.3,
          "invalidation_condition": "Close early only if a 4h candle closes above 3800 AND the 4h MACD histogram turns positive for 2 consecutive bars.",
          "profit_target": 3407.47,
          "stop_loss": 3719.44,
          "justification": "",
          "coin": "ETH",
          "signal": "hold"
        }
}</code></pre>



<h2>二、 方法論缺陷：是「策略」還是「幻覺」？</h2>



<p>儘管機制看似完整，但從嚴謹的量化交易角度審視，Alpha Arena 在方法論上存在幾個根本性的缺陷。</p>



<h3>缺陷一：策略是「幻覺」，而非「回測」的產物</h3>



<p>這是最核心的問題。LLM 產出的 <code>invalidation_condition</code>（退出條件）並<strong>不是一個經過系統性回測證明其有效的策略</strong>。</p>



<p>相反地，它更像是 LLM 基於其龐大的訓練數據（網路論壇、分析文章），「<strong>幻覺</strong>」或「<strong>拼湊</strong>」出來的、<strong>當下聽起來最合理的交易規則</strong>。這如同要求 AI「<strong>即時創造</strong>」一道新菜，而非嚴格執行一道經過千次測試的米其林食譜——聽起來很棒，但穩定性與安全性存疑。</p>



<h3>缺陷二：缺乏一致性與可重複性</h3>



<p>傳統的量化交易程式是確定性的：相同的輸入（RSI &gt; 70）永遠會觸發相同的條件。</p>



<p>但 LLM 本質上是機率性的。這意味著，即使下次遇到完全相同的市場數據和提示詞，LLM 也不保證會生成完全相同的 <code>cot_trace</code> 或 <code>invalidation_condition</code>。它下一次可能認為「RSI 跌破 50」才是出場條件。這使得整個系統極度不穩定、無法驗證，也無法回測一個「隨機變動」的策略。</p>



<h3>缺陷三：不科學的「自信度」評分</h3>



<p>經過分析顯示，模型給出的 <code>confidence</code> 分數高度集中在 0.6-0.7 之間，且未見低於 0.6 的分佈。這種集中的數值分佈，不像科學計算的結果，反而更像 LLM 作為評判者（LLM as a judge）時產生的「幻覺分數」。<br>我們直接去抓取網頁的 api 回應，實際去分析 LLM 的輸出，統計所有模型的 LLM Response ，分析發現 0.6-0.7 出現的頻率非常高且頻繁，且沒有出現低於 0.6 信心的分佈，不是很合理情況。</p>



<p>正常情況下，如果分數是經過科學計算的，它應該是一個連續的分佈。<br></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="610" src="https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x-1024x610.png" alt="CleanShot 2025 11 04 at 15.49.10@2x" class="wp-image-6733" srcset="https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x-1024x610.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x-300x179.png 300w, https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x-768x458.png 768w, https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x-1536x915.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/11/CleanShot-2025-11-04-at-15.49.10@2x.png 1990w" sizes="(max-width: 1024px) 100vw, 1024px" title="Alpha Arena 背後的技術解析、缺陷與潛力 4"><figcaption>信心分布統計</figcaption></figure>



<pre class="wp-block-code"><code class="">--- confidence 分數的出現次數 ---
分數 0.62: 48 次
分數 0.63: 32 次
分數 0.64: 16 次
分數 0.65: 85 次
分數 0.67: 17 次
分數 0.7: 100 次
分數 0.75: 62 次
分數 0.78: 24 次
分數 0.8: 12 次
分數 0.85: 12 次
分數 0.9: 12 次</code></pre>



<h3>缺陷四：時間序列「文本化」導致時間意義缺失</h3>



<p>將 MACD、RSI 這類時序數據轉換為文本序列，是為了迎合 LLM 的輸入格式。然而，Transformer 架構是基於 <em>token</em> 的順序去預測下一個 <em>token</em>，它<strong>無法真正理解「時間的連續性」</strong>。</p>



<p>當時間序列被「壓平」成文字時，LLM 的「腦海」中缺乏了時間的維度。雖然它可能在預訓練中學到了 MACD 和 RSI 的基本概念（這或許能解釋 Deepseek 表現較好的原因），但要求它基於這種「<strong>無時間感</strong>」的文本去做出精確的時序預測，是有難度的。</p>



<h2>三、 潛在價值：為何 Alpha Arena 仍有價值</h2>



<p>儘管缺陷明顯， Alpha Arena 也是有其價值。它的真正價值不在於當下的交易績效，而在於它展示的潛力：</p>



<h3>潛力一：革命性的「可解釋性」 (Explainable AI)</h3>



<p>LLM 的<strong>思維鏈</strong>是這個專案最有趣的部分。傳統量化交易的「黑盒子」模型（例如 SVM 或神經網路）很難解釋為什麼它要買入。</p>



<p>而 Alpha Arena 迫使 LLM 用人類可讀的語言來「解釋」它的決策過程（&#8221;Examining liquidation risk&#8230;&#8221;）。對於某些機構而言，這種<strong>決策過程透明化</strong>的特性是有價值的，可以使用 AI 輔助決策。</p>



<h3>2. 潛力二：「非結構化數據」的巨大潛力</h3>



<p>目前專案僅將「<strong>結構化</strong>」的技術指標文本化，這確實是上面說的缺陷之一。</p>



<p>但如果在這個框架中，讓 LLM 在 Prompt 中加入，去處理<strong>非結構化數據</strong>，這就是 LLM 相較於傳統模型，最具壓倒性優勢的地方。<br>例如：</p>



<ul><li>「這是過去 1 小時社群平台上關於 BTC 的恐慌指數」</li><li>「聯準會主席在 5 分鐘前的發言偏向鷹派」</li></ul>



<p>傳統模型難以理解這些文本的語意和情緒。而 LLM 交易機器人是有潛力將「<strong>市場情緒</strong>」、「<strong>新聞事件</strong>」和「<strong>技術指標</strong>」真正融合在同一個決策模型中的架構。</p>



<h3>潛力三：一個極具價值的「元實驗」</h3>



<p>Alpha Arena（阿爾法競技場）這個名字本身就點出了其價值。它不是在宣稱誰是最好的交易模型，而是建立了一個「競技場」讓所有模型同台競技。</p>



<p>這本身就是一個非常有價值的實驗。它讓我們首次有機會在相同的規則下，橫向比較不同 LLM（GPT-5, Gemini,Grok&#8230;）的金融推理能力。</p>



<h2>四、 結論：一個「有趣」但尚未成熟的未來</h2>



<p>從技術層面分析來看，Alpha Arena 目前更像是一台令人興奮的「概念車」。它存在「策略幻覺」、「缺乏一致性」等根本性的方法論缺陷，使其目前的交易結果不具備嚴謹的科學意義。</p>



<p>然而，它的價值絕非零。Alpha Arena 成功地展示了 LLM 在<strong>決策可解釋性和融合非結構化數據</strong>方面的巨大潛力。它作為一個「AI 競技場」的實驗，其價值遠高於它產生的帳面損益。</p>



<p>總體而言，這是一個「<strong>好玩有趣</strong>」且極具啟發性的專案，它為我們揭開了 AI 金融交易未來樣貌。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/alpha-arena-%e8%83%8c%e5%be%8c%e7%9a%84%e6%8a%80%e8%a1%93%e8%a7%a3%e6%9e%90%e3%80%81%e7%bc%ba%e9%99%b7%e8%88%87%e6%bd%9b%e5%8a%9b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6730</post-id>	</item>
		<item>
		<title>把「靈感」煉成「因子」：從感覺到證據的逆襲</title>
		<link>https://www.finlab.tw/factor_analysis_3_factor/</link>
					<comments>https://www.finlab.tw/factor_analysis_3_factor/#respond</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Fri, 22 Aug 2025 04:09:08 +0000</pubDate>
				<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[基本面分析]]></category>
		<category><![CDATA[投資新手]]></category>
		<category><![CDATA[股票策略]]></category>
		<category><![CDATA[財經PYTHON教學]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[股票]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6685</guid>

					<description><![CDATA[你一定懂那種瞬間——螢幕上跳出一檔飆股，心裡直覺「它會漲」。但直覺不會每次都對。於是我們決定反過來做：把靈感拆 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" width="683" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/08/image-2-683x1024.png" alt="image 2" class="wp-image-6701" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/image-2-683x1024.png 683w, https://www.finlab.tw/wp-content/uploads/2025/08/image-2-200x300.png 200w, https://www.finlab.tw/wp-content/uploads/2025/08/image-2-768x1152.png 768w, https://www.finlab.tw/wp-content/uploads/2025/08/image-2.png 1024w" sizes="(max-width: 683px) 100vw, 683px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 5"><figcaption>封面圖片</figcaption></figure>



<p></p>



<p>你一定懂那種瞬間——螢幕上跳出一檔飆股，心裡直覺「它會漲」。但直覺不會每次都對。於是我們決定反過來做：把靈感拆成可驗證的「因子」，把「為什麼漲」說清楚，然後用資料驗證。</p>



<p>難嗎？不簡單。因為我們有工具可以把難的事做得乾淨俐落。</p>



<h2><strong>和一般做法，哪裡不一樣？</strong></h2>



<p>一般做法：先選幾個看起來厲害的指標，湊一套回測；結果好就覺得是神功，結果差就再換一套。</p>



<p>我們的做法：先把策略拆解，再逐一檢驗每個因子的線索：它帶來的超額報酬是多少？在什麼狀態下有效？會不會太擁擠（大家都在用）？彼此相關性高不高？</p>



<p>沒有 Finlab 我們得自己處理：資料下載、清洗、對齊、換股對齊、月/季頻率對接… 一個環節錯了，結果就不可信。</p>



<p>有了 finlab，我們可以直接用一致頻率的資料集與安全的 resample 邏輯，把時間對齊、避免偷看未來；剩下的，就是認真跟資料搏鬥。</p>



<h2><strong>我們的範例策略：</strong></h2>



<p>三個最基本、卻常被忽略「為什麼」的因子：市值、營收動能、價格動能。</p>



<ul><li>為什麼要小市值？因為小市值在資訊修正與資金挹注時，彈性常常更大。</li><li>為什麼看營收加速？因為是最扎實的推力。</li><li>為什麼要動能？因為市場的從眾與慣性，往往延長趨勢。</li></ul>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab import data, backtest

marketcap = data.get('etl:market_value')
revenue   = data.get('monthly_revenue:當月營收')
close     = data.get('price:收盤價')

cond_smallcap = marketcap.rank(pct=True, axis=1) &lt; 0.3
cond_revgro   = (revenue.average(3) / revenue.average(12)).rank(pct=True, axis=1) &gt; 0.7
cond_momentum = (close / close.shift(20)).rank(pct=True, axis=1) &gt; 0.7

pos = cond_smallcap &amp; cond_revgro &amp; cond_momentum
report = backtest.sim(pos, resample='ME', upload=False)
report.display()</code></pre>



<blockquote class="wp-block-quote"><p><strong>為什麼要用 rank？</strong>比較的是「相對位置」，而不是絕對數值。</p></blockquote>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="1011" src="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x-1024x1011.png" alt="CleanShot 2025 08 22 at 10.46.02@2x" class="wp-image-6687" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x-1024x1011.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x-300x296.png 300w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x-768x758.png 768w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x-1536x1516.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-10.46.02@2x.png 1544w" sizes="(max-width: 1024px) 100vw, 1024px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 6"><figcaption>回測結果</figcaption></figure>



<h2><strong>把策略拆成可驗證的語言：特徵 &amp; 標籤</strong></h2>



<p>先定義我們「到底要預測什麼」：未來一段時間的超額報酬（相對市場平均）。這是策略的真目標，而不是單看漲跌。</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab import data
import finlab.ml.feature as feature
import finlab.ml.label as label

features = feature.combine({
    'marketcap' : cond_smallcap,
    'revenue'   : cond_revgro,
    'momentum'  : cond_momentum
}, resample='ME')

labels = label.excess_over_mean(index=features.index, resample='ME')</code></pre>



<blockquote class="wp-block-quote"><p>為什麼用超額報酬？ 因為我們將焦點從「追隨市場」轉向「超越對手」。我們比較的不是大盤的絕對速度，而是相對於競爭者的反應速度。</p></blockquote>



<h2><strong>因子報酬（Factor Return）：它到底有沒有賺到「解釋力」？</strong></h2>



<p>把每個因子的「獨立效果」抽出來，看長期累積報酬線條。線條不只代表報酬，更是「這個因子值得被相信」的證詞。</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import calc_factor_return
from finlab.plot import plot_line

factor_return = calc_factor_return(features, labels).cumsum()
plot_line(factor_return, unit='.0%', title='因子累積報酬')</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" width="788" height="435" src="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.03.52.png" alt="CleanShot 2025 08 22 at 11.03.52" class="wp-image-6688" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.03.52.png 788w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.03.52-300x166.png 300w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.03.52-768x424.png 768w" sizes="(max-width: 788px) 100vw, 788px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 7"><figcaption>因子累積報酬</figcaption></figure>



<blockquote class="wp-block-quote"><p><strong>為什麼先看累積線？</strong> 因為短期雜訊會騙人，長期線條的斜率與轉折，才能看出它是偶然還是規律。</p></blockquote>



<h2><strong>因子集中度（Centrality）：因子擁擠嗎？</strong></h2>



<p>當一個因子被同時大量採用，接著因子趨向擁擠、碰到回檔風險上升。我們用主成分分析的權重，量化「共同性」。</p>



<ul><li>數值大：近期用它選股都賺，表示擁擠；下一步要<strong>警戒回檔</strong>。</li><li>數值小：近期表現差，反而可能接近「冷門反擊」的起點。</li></ul>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import calc_centrality
centrality = calc_centrality(calc_factor_return(features, labels), 12)

plot_line(centrality, title='因子集中度')</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-1024x576.png" alt="CleanShot 2025 08 22 at 11.12.41@2x" class="wp-image-6689" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-1024x576.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-300x169.png 300w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-768x432.png 768w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-1536x863.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x-800x450.png 800w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.12.41@2x.png 1580w" sizes="(max-width: 1024px) 100vw, 1024px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 8"><figcaption>因子集中度</figcaption></figure>



<blockquote class="wp-block-quote"><p>為什麼要看擁擠度？ 因為市場是動態的，當所有人一起衝進同一個因子，邊際報酬就會變脆弱。</p></blockquote>



<h2>因子貢獻度 (<strong>Shapley Values)：把功勞分清楚</strong></h2>



<p>我們不只看「有賺」，還要知道「誰在出力」。Shapley 用公平分配的方式，拆解各因子的邊際貢獻。</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import calc_shapley_values
shapley = calc_shapley_values(features, labels)
plot_line(shapley, title='因子貢獻度')</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="572" src="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x-1024x572.png" alt="CleanShot 2025 08 22 at 11.16.23@2x" class="wp-image-6690" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x-1024x572.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x-300x168.png 300w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x-768x429.png 768w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x-1536x859.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.16.23@2x.png 1578w" sizes="(max-width: 1024px) 100vw, 1024px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 9"><figcaption>因子貢獻度</figcaption></figure>



<blockquote class="wp-block-quote"><p>為什麼要拆貢獻？ 因為多因子策略容易「誰都沾一點」，但在壓力時刻，你要知道要砍誰、留誰。</p></blockquote>



<h2><strong>IC（Information Coefficient）：預測力的體檢表</strong></h2>



<p>我們把分數和未來報酬做相關（可用 rank），長期 IC 穩定偏正、且不是只靠少數極端時期拉高，才叫做真正的「可預測」。</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import calc_ic

features_ic = {
    'marketcap': -marketcap,  # 小市值用負號
    'revenue'  : revenue.average(3) / revenue.average(12),
    'momentum' : close / close.shift(20),
}
features_ic = feature.combine(features_ic, resample='ME')

ic_df = calc_ic(features_ic, labels, rank=True)
plot_line(ic_df, title='因子相關性')</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="572" src="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x-1024x572.png" alt="CleanShot 2025 08 22 at 11.35.02@2x" class="wp-image-6692" srcset="https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x-1024x572.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x-300x168.png 300w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x-768x429.png 768w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x-1536x858.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/08/CleanShot-2025-08-22-at-11.35.02@2x.png 1582w" sizes="(max-width: 1024px) 100vw, 1024px" title="把「靈感」煉成「因子」：從感覺到證據的逆襲 10"><figcaption>因子相關性</figcaption></figure>



<blockquote class="wp-block-quote"><p><strong>為什麼要看 IC？</strong> 因為報酬可能來自風格或偶然，但「相關性」在長期裡更難偽裝。</p></blockquote>



<h2><strong>趨勢偵測：隨時間變化數值</strong></h2>



<p>我們用回歸去看「集中度、貢獻、IC」的趨勢：上升？下降？還是平？</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import calc_regression_stats
centrality_trend = calc_regression_stats(centrality)</code></pre>



<p></p>



<ul><li><strong>p 值小 + 斜率正</strong>：真正在升溫；</li><li><strong>p 值小 + 斜率負</strong>：退潮真正發生；</li><li><strong>解釋力低（R²小）</strong>：暫時別下定論，當它不存在。</li></ul>



<figure class="wp-block-table"><table><thead><tr><th><strong>p_value</strong></th><th><strong>r_squared</strong></th><th><strong>slope</strong></th><th><strong>trend</strong></th><th><strong>含義</strong></th></tr></thead><tbody><tr><td><strong>小</strong></td><td><strong>高</strong></td><td><strong>正</strong></td><td>up</td><td>強烈且穩定的上升趨勢</td></tr><tr><td><strong>小</strong></td><td><strong>高</strong></td><td><strong>負</strong></td><td>down</td><td>強烈且穩定的下降趨勢</td></tr><tr><td><strong>小</strong></td><td><strong>低</strong></td><td>任意</td><td>flat</td><td>趨勢存在但效果小/雜訊大</td></tr><tr><td><strong>大</strong></td><td><strong>高</strong></td><td>任意</td><td>flat</td><td>樣本少，雜訊高，無法判斷</td></tr><tr><td><strong>大</strong></td><td><strong>低</strong></td><td>任意</td><td>flat</td><td>基本無趨勢且模型無解釋力</td></tr></tbody></table></figure>



<h3><strong>實例分析</strong></h3>



<ul><li><strong>Marketcap (市值因子)</strong></li></ul>



<p><code>slope: -0.000111 (負值) </code><br><code>p_value: 3.10e-17 (極度顯著) </code><br><code>r_squared: 0.40 (中等偏強解釋力) </code><br><code>trend: down</code></p>



<p><strong>解讀</strong>: 市值因子的集中度呈現非常強烈且統計上極度顯著的下降趨勢。</p>



<ul><li><strong>Revenue (營收因子)</strong></li></ul>



<p><code>slope: 0.000018 (正值)</code><br><code>p_value: 0.0048 (顯著) </code><br><code>r_squared: 0.056 (解釋力較弱) </code><br><code>trend: flat (因 r_squared &lt; 0.1)</code></p>



<p><strong>解讀</strong>: 營收因子有統計上顯著的上升趨勢，但由於解釋力不足 (r_squared &lt; 0.1)，被歸類為 flat。</p>



<ul><li><strong>Momentum (動能因子)</strong></li></ul>



<p><code>slope: 0.000093 (顯著正值) </code><br><code>p_value: 1.14e-17 (極度顯著) </code><br><code>r_squared: 0.41 (中等偏強解釋力) </code><br><code>trend: up</code></p>



<p><strong>解讀</strong>: 動能因子的集中度呈現非常強烈且統計上極度顯著的上升趨勢。這是一個明確的信號，表明動能因子非常「熱門」，大量資金正在追逐這個策略。</p>



<blockquote class="wp-block-quote"><p><strong>為什麼做趨勢？</strong> 因為資金有輪動。與其死守某一信仰，不如跟著證據調整權重。</p></blockquote>



<h2>總結</h2>



<h3>解決分析前的難點</h3>



<ul><li>多頻資料對齊：日價、月營收、季財報……沒有統一索引會災難。</li><li>風險：偷看未來、不同頻率窗口誤用，都會讓結果「看起來很美」。</li><li>擁擠：策略跑出來以後，大家都用，它就不香了。這就是為什麼<strong>Centrality</strong>與<strong>趨勢偵測</strong>是必要的。</li><li>因子工具把「報酬、擁擠、貢獻、IC」變成<strong>可重複</strong>的研究流程。</li></ul>



<h3><strong>行動建議：你可以直接用這篇當「研究框架」模板</strong></h3>



<ol><li>用 feature.combine/label.excess_over_mean 定義問題；</li><li>跑 因子報酬 / 集中度 / Shapley / IC / 趨勢 五件套；</li><li>用趨勢結果去<strong>調整權重</strong>，而不是迷信單因子。</li></ol>



<p>歡迎參考&nbsp;<a href="https://colab.research.google.com/drive/1pa27imv0k_O-qRKjg4fSr9Eq4tx-GwyL?usp=sharing" data-type="URL" data-id="https://colab.research.google.com/drive/1pa27imv0k_O-qRKjg4fSr9Eq4tx-GwyL?usp=sharing" target="_blank" rel="noopener">Colab 範例檔</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/factor_analysis_3_factor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6685</post-id>	</item>
		<item>
		<title>復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」</title>
		<link>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00900-%ef%bc%9a%e4%bd%bf%e7%94%a8-ic-decay-%e5%84%aa%e5%8c%96%e9%ab%98%e8%82%a1%e6%81%af%e7%ad%96%e7%95%a5%e6%88%90%e3%80%8c%e9%95%b7%e8%b7%91%e8%bb%8d/</link>
					<comments>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00900-%ef%bc%9a%e4%bd%bf%e7%94%a8-ic-decay-%e5%84%aa%e5%8c%96%e9%ab%98%e8%82%a1%e6%81%af%e7%ad%96%e7%95%a5%e6%88%90%e3%80%8c%e9%95%b7%e8%b7%91%e8%bb%8d/#respond</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Tue, 03 Jun 2025 08:02:23 +0000</pubDate>
				<category><![CDATA[VIP文章]]></category>
		<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[基本面分析]]></category>
		<category><![CDATA[投資新手]]></category>
		<category><![CDATA[股票策略]]></category>
		<category><![CDATA[財經PYTHON教學]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[股票]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6620</guid>

					<description><![CDATA[前言 市場上的高股息 ETF 各有特色，這次將以富邦特選高股息30（00900）為例，分析其追蹤的「臺灣指數公 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" width="820" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x-820x1024.png" alt="CleanShot 2025 05 22 at 10.03.35@2x" class="wp-image-6648" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x-820x1024.png 820w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x-240x300.png 240w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x-768x959.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x-1229x1536.png 1229w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-10.03.35@2x.png 1436w" sizes="(max-width: 820px) 100vw, 820px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 11"><figcaption>封面圖片</figcaption></figure>



<h2>前言</h2>



<p>市場上的高股息 ETF 各有特色，這次將以富邦特選高股息30（00900）為例，分析其追蹤的「<strong>臺灣指數公司特選臺灣上市上櫃高股息30指數</strong>」。這檔ETF 的選股邏輯強調多次審核與財務、流動性標準，選擇高股息且具備穩定配息能力的個股。</p>



<h3>00900 特色整理</h3>



<blockquote class="wp-block-quote"><p>一年三次審核，嚴選 30 檔高息股；納入市值＋流動性＋營業利益安全閥。</p></blockquote>



<figure class="wp-block-table"><table><thead><tr><th>特色</th><th>說明</th><th>帶來的好處</th></tr></thead><tbody><tr><td><strong>三次定審（4 / 7 / 12 月）</strong></td><td>每次重新計算股利率</td><td>配息資訊更新更即時</td></tr><tr><td><strong>流動性硬指標</strong></td><td>近 3 個月日均成交金額前 90 %</td><td>降低買賣滑價</td></tr><tr><td><strong>營業利益必須為正</strong></td><td>最近四季 &gt; 0</td><td>過濾偽高息股</td></tr></tbody></table></figure>



<h2><strong>復刻 00900：研究流程全解析</strong></h2>



<h3><strong>資料來源與規則拆解</strong></h3>



<p>根據<a style="font-weight: bold;" href="https://etrade.fsit.com.tw/homelink/Prospectus/94.pdf" target="_blank" rel="noopener">公開說明書</a>，復刻「<strong>特選臺灣上市上櫃高股息30指數（00900）</strong>」的成分股篩選與調整流程，重點如下：</p>



<h3><strong><strong>初始採樣母體</strong></strong></h3>



<ul><li>臺灣上市與上櫃普通股股票為基礎。</li><li>選取發行市值前 200 大股票。</li></ul>



<h3><strong>流動性條件</strong></h3>



<ul><li>最近三個月日均成交金額排名前 90%者</li></ul>



<h3><strong>財務健全性與指標篩選</strong></h3>



<ul><li><strong>定期審核</strong>（四月、七月、十二月）：最近四季營業利益總和須為正</li></ul>



<h3><strong>股利率計算</strong></h3>



<ul><li><strong>四月定審（第一次）</strong><ul><li><strong>已公告現金股利者</strong>：股利率 = 最近四季現金股利總和 ÷ 審核資料截止日股價</li><li><strong>未公告現金股利者</strong>：股利率 = 最近四季 EPS 總和 × 過去三年平均現金股利發放率 ÷ 審核資料截止日股價</li></ul></li><li><strong>七月定審（第二次）</strong><ul><li>股利率 = 最近四季現金股利總和 ÷ 審核資料截止日股價</li></ul></li><li><strong>十二月定審（第三次）</strong><ul><li>股利率 = 最近四季 EPS 總和 × 過去三年平均現金股利發放率 ÷ 審核資料截止日股價</li></ul></li></ul>



<h3><strong>成分股數量</strong></h3>



<ul><li><strong>每次均固定 30 檔</strong></li></ul>



<h3><strong>指數調整與生效時點</strong></h3>



<ul><li><strong>每年三次定期審核</strong>：4月、7月、12月第7個交易日為基準日</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1>復刻結果</h1>



<p>在經過一連串比對後，復刻而得的策略股池與原版 00900 報酬率曲線有高度相關。這意味著，我們的 復刻版 00900 確實能有效重現 00900 的選股結果。</p>



<p><strong>相關性分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="691" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.25.29@2x-691x1024.png" alt="CleanShot 2025 05 22 at 11.25.29@2x" class="wp-image-6664" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.25.29@2x-691x1024.png 691w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.25.29@2x-202x300.png 202w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.25.29@2x.png 758w" sizes="(max-width: 691px) 100vw, 691px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 12"><figcaption>相關性分析</figcaption></figure></div>


<p><strong>復刻 00900 報酬</strong>&nbsp;:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="886" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x-1024x886.png" alt="CleanShot 2025 05 22 at 11.26.49@2x" class="wp-image-6666" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x-1024x886.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x-300x260.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x-768x664.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x-1536x1329.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.26.49@2x.png 1542w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 13"><figcaption><strong>復刻 00900 報酬</strong></figcaption></figure></div>


<p>我們的「<strong>復刻版 00900</strong>」與官方版本高相關，證明邏輯拆解合理。</p>



<h2>進階優化</h2>



<h3>IC Decay：讓「好因子」真正常駐</h3>



<h4>什麼是IC Decay？為什麼分析IC Decay很重要？</h4>



<blockquote class="wp-block-quote"><p>想像一下：同一份藏寶圖，今天不只告訴你哪裡有金礦，還附上一張「礦脈多久才會枯竭」的熱力圖——這就是 IC Decay 帶來的視野。</p></blockquote>



<p>「IC」（Information Coefficient，資訊係數）是用來衡量一個因子對未來報酬預測力的重要指標，IC 高代表這個因子和未來報酬關聯性強。</p>



<p><strong>IC Decay</strong>，則是指「這個預測力會隨時間流逝而衰退嗎？衰退速度如何？」</p>



<p>簡單來說，我們不僅看因子對短期報酬有沒有預測力，也要觀察對長期如 60天、120天以後的報酬還有沒有預測力。</p>



<ul><li><strong>IC Decay 平緩：</strong> 這個因子在不同持有期間都有效，適合長線</li><li><strong>IC Decay 快：</strong> 因子適合短線，長線預測力不佳</li></ul>



<p><strong>應用在多因子策略：</strong></p>



<ul><li>幫助我們挑出「<strong>耐久型</strong>」的好因子</li><li>可以依照持股週期調整因子組合，強化策略穩定性</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2>用 IC Decay 檢驗 00900 因子品質</h2>



<p>我們針對前述幾個因子，進行 IC Decay分析，步驟如下：</p>



<ol><li>計算各因子對不同持有期（如20天、60天、120天）的 IC</li><li>畫出IC Decay曲線，觀察哪些因子「<strong>報酬預測力持久</strong>」</li><li>排除短線效應太明顯、容易失效的因子</li></ol>



<figure class="wp-block-image size-full"><img loading="lazy" width="1000" height="800" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot.png" alt="newplot" class="wp-image-6625" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot.png 1000w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot-300x240.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot-768x614.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 14"><figcaption>IC mean &amp;  ICIR Decay</figcaption></figure>



<h4><strong>重點解讀：</strong></h4>



<ul><li><strong>市值</strong>：IC IR 明顯是負值，且隨預測天數加長而下降，代表市值這個因子的預測不只失準，而且不穩定。</li><li><strong>七月股利率</strong>、<strong>十二月股利率</strong>：IC IR 明顯隨持有天數增加而上升（橘線到 1.5 以上），代表這兩個因子隨時間拉長後，預測力不只穩定，甚至更強。</li></ul>



<h2>多因子組合 IC Decay</h2>



<p>接下來，我們將這些因子進行整合，<strong>以組合分析的方式評估其綜合效果</strong>。</p>



<h4>分析 120 天預測期的前三名因子組合: </h4>



<ul><li><strong>七月股利率</strong></li><li><strong>七月股利率</strong> + <strong>十二月股利率 </strong></li><li><strong>四月股利率</strong> + <strong>七月股利率</strong></li></ul>



<figure class="wp-block-image size-full"><img loading="lazy" width="1000" height="800" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot2.png" alt="newplot2" class="wp-image-6627" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot2.png 1000w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-300x240.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-768x614.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 15"><figcaption>120天預測期 &#8211; 最佳因子組合的IC和IC IR衰減分析</figcaption></figure>



<p><strong>綜合解讀 ：</strong></p>



<ul><li><strong>組合因子</strong>（如「<strong>七月股利率 + 十二月股利率</strong>」）能提供更高的平均預測能力 (IC Mean)。</li><li>單因子「<strong>七月股利率</strong>」或「<strong>七月股利率+十二月股利率</strong>」的組合，在預測的穩定性 (IC IR) 上可能更優，尤其是在較長的預測期。</li><li>整體來看，這些以股利率為基礎的因子組合在中長期（如 60 天至 200 天）展現出較好的預測潛力，並且其預測的穩定性隨時間增長。</li></ul>



<h4>分析最佳單一因子 IC Decay : 七月股利率 ,十二月股利率 </h4>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot3.png" alt="newplot3" class="wp-image-6629" width="840" height="672" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot3.png 1000w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-300x240.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-768x614.png 768w" sizes="(max-width: 840px) 100vw, 840px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 16"><figcaption>最佳單一因子 IC Decay</figcaption></figure>



<h4><br></h4>



<h3><strong>綜合解讀 ：</strong></h3>



<ul><li>在單因子比較中，「<strong>七月股利率</strong>」無論是在平均預測能力 (IC Mean) 還是預測穩定性 (IC IR) 上，都優於「<strong>十二月股利率</strong>」。</li><li>「<strong>七月股利率</strong>」的 IC IR 隨預測天數增加而上升的特性。</li></ul>



<h3><strong>總體結論：</strong></h3>



<ol><li><strong>「七月股利率」是核心強勢因子：</strong> 無論是作為單因子還是組合的一部分，「<strong>七月股利率</strong>」都表現出強勁的預測能力和非常好的穩定性（尤其是其 IC IR 持續上升）。</li><li><strong>因子組合的價值：</strong> 將不同月份的股利率因子進行組合，有潛力獲得比單一因子更高的 IC Mean，即更強的平均預測信號。</li><li><strong>IC Mean vs. IC IR 的考量：</strong><ul><li>「<strong>七月股利率 + 十二月股利率</strong>」組合擁有最高的 IC Mean，如果追求最強的平均預測信號，這是一個好選擇。</li><li>但若更看重預測的穩定性，「<strong>七月股利率</strong>」（單獨或與十二月股利率組合）則因其較高的 IC IR 而更具吸引力。這是策略構建中需要權衡的一點。</li></ul></li><li><strong>適用的預測週期：</strong> 這些因子/組合的 IC Mean 大多在約120天至160天達到高峰或保持強勢，而 IC IR 甚至在200天時仍在上升。這暗示它們更適合中長期的投資策略，而非短期的預測。IC Mean 初期（20天至~120天）的上升趨勢值得注意，可能表示因子效應的滯後性。</li><li><strong>潛力因子/組合：</strong> 「七月股利率 + 十二月股利率」因其高 IC Mean 顯示出很好的潛力。而「七月股利率」因子本身因其優異的 IC IR 表現，是構建因子模型時的重要候選。<br>另外也附上同<a href="https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00919%ef%bc%9a%e7%8e%a9%e8%bd%89%e9%ab%98%e8%82%a1%e6%81%af-etf/">前一篇</a>的分析結果，整理出各預測週期內，因子在前10名組合中的出現頻率，以及120天預測期下，不同因子數量與 ICIR 的關係，並列出120天預測期的前10組最佳因子組合。</li></ol>



<figure class="wp-block-image size-full"><img loading="lazy" width="1000" height="500" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot-1.png" alt="newplot 1" class="wp-image-6631" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot-1.png 1000w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot-1-300x150.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot-1-768x384.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 17"><figcaption>各預測週期中因子在前10名組合中的出現頻率</figcaption></figure>



<figure class="wp-block-image size-full"><img loading="lazy" width="800" height="600" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-2.png" alt="newplot2 2" class="wp-image-6635" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-2.png 800w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-2-300x225.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot2-2-768x576.png 768w" sizes="(max-width: 800px) 100vw, 800px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 18"><figcaption>120天預測期 – 因子數量與ICIR關係</figcaption></figure>



<figure class="wp-block-image size-full"><img loading="lazy" width="900" height="600" src="https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-3.png" alt="newplot3 3" class="wp-image-6636" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-3.png 900w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-3-300x200.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/newplot3-3-768x512.png 768w" sizes="(max-width: 900px) 100vw, 900px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 19"><figcaption>120 天預測期 – 前10個最佳因子組合</figcaption></figure>



<h2>優化後的成績單</h2>



<p>最後我們使用表現較好的 <strong>七月股利率 + 十二月股利率</strong> <strong>+  yield_ratio</strong> 組合進行優化，可以發現績效、夏普值、最大回檔都有更好的結果。</p>



<p><strong>獲利能力分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="943" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x-1024x943.png" alt="CleanShot 2025 05 22 at 11.33.06@2x" class="wp-image-6667" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x-1024x943.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x-300x276.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x-768x707.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x-1536x1414.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.06@2x.png 1540w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 20"><figcaption>獲利能力分析</figcaption></figure></div>


<p><strong>抗風險能力分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="853" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x-1024x853.png" alt="CleanShot 2025 05 22 at 11.33.36@2x" class="wp-image-6668" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x-1024x853.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x-300x250.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x-768x640.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x-1536x1279.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.33.36@2x.png 1544w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 21"><figcaption><strong>抗風險能力分析</strong></figcaption></figure></div>


<p><strong>風險報酬分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="353" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.34.34@2x-1024x353.png" alt="CleanShot 2025 05 22 at 11.34.34@2x" class="wp-image-6669" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.34.34@2x-1024x353.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.34.34@2x-300x104.png 300w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.34.34@2x-768x265.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.34.34@2x.png 1530w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 22"><figcaption><strong>風險報酬分析</strong></figcaption></figure></div>


<p><strong>勝率期望值分析：</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="968" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x-968x1024.png" alt="CleanShot 2025 05 22 at 11.35.06@2x" class="wp-image-6670" srcset="https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x-968x1024.png 968w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x-283x300.png 283w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x-768x813.png 768w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x-1451x1536.png 1451w, https://www.finlab.tw/wp-content/uploads/2025/05/CleanShot-2025-05-22-at-11.35.06@2x.png 1544w" sizes="(max-width: 968px) 100vw, 968px" title="復刻與優化 00900 ：使用 IC Decay 優化高股息策略成「長跑軍火庫」 23"><figcaption><strong>勝率期望值分析</strong></figcaption></figure>



<h2>結論</h2>



<p><strong>00900 高股息ETF</strong>的選股規則已經相當嚴謹，但我們透過 <strong>IC Decay 分析</strong>，能夠再進一步挑選出「<strong>預測力持久</strong>」的黃金因子組合，打造更穩健、具備長期優勢的量化策略。未來也能持續利用 <strong>IC Decay</strong>動態追蹤因子表現，讓自己的策略不斷升級，也歡迎參考&nbsp;<a href="https://colab.research.google.com/drive/1rw86fwPLxq-nAPN-YCHABDpRaJ7lXCJU?usp=sharing" data-type="URL" data-id="https://colab.research.google.com/drive/1rw86fwPLxq-nAPN-YCHABDpRaJ7lXCJU?usp=sharing" target="_blank" rel="noopener">Colab 範例檔</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00900-%ef%bc%9a%e4%bd%bf%e7%94%a8-ic-decay-%e5%84%aa%e5%8c%96%e9%ab%98%e8%82%a1%e6%81%af%e7%ad%96%e7%95%a5%e6%88%90%e3%80%8c%e9%95%b7%e8%b7%91%e8%bb%8d/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6620</post-id>	</item>
		<item>
		<title>復刻與優化 00919：玩轉高股息 ETF</title>
		<link>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00919%ef%bc%9a%e7%8e%a9%e8%bd%89%e9%ab%98%e8%82%a1%e6%81%af-etf/</link>
					<comments>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00919%ef%bc%9a%e7%8e%a9%e8%bd%89%e9%ab%98%e8%82%a1%e6%81%af-etf/#respond</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Tue, 06 May 2025 08:08:01 +0000</pubDate>
				<category><![CDATA[VIP文章]]></category>
		<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[基本面分析]]></category>
		<category><![CDATA[投資新手]]></category>
		<category><![CDATA[股票策略]]></category>
		<category><![CDATA[財經PYTHON教學]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[股票]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6561</guid>

					<description><![CDATA[前言 市面上的高股息 ETF 百花齊放，這次要來復刻 00919 群益台灣精選高息 ETF，如果 0056 是 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" width="683" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/04/ChatGPT-Image-2025年4月20日-下午01_52_50-1-683x1024.png" alt="ChatGPT Image 2025年4月20日 下午01 52 50 1" class="wp-image-6596" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/ChatGPT-Image-2025年4月20日-下午01_52_50-1-683x1024.png 683w, https://www.finlab.tw/wp-content/uploads/2025/04/ChatGPT-Image-2025年4月20日-下午01_52_50-1-200x300.png 200w, https://www.finlab.tw/wp-content/uploads/2025/04/ChatGPT-Image-2025年4月20日-下午01_52_50-1-768x1152.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/ChatGPT-Image-2025年4月20日-下午01_52_50-1.png 1024w" sizes="(max-width: 683px) 100vw, 683px" title="復刻與優化 00919：玩轉高股息 ETF 24"><figcaption>封面圖片</figcaption></figure>



<h2>前言</h2>



<p>市面上的高股息 ETF 百花齊放，這次要來復刻 <strong>00919</strong> <strong>群益台灣精選高息 ETF，</strong>如果 <strong>0056</strong> 是台股存股族的啟蒙，<strong>00919 </strong> 就像下一代改裝版。它主打「<strong>精準高息、精準卡位、精準領息</strong>」三大賣點，看似簡單，其實暗藏許多量化細節。本文帶你：</p>



<ol><li><strong>完整拆解官方邏輯</strong>，一步步復刻 00919 的選股流程。</li><li><strong>用量化工具驗證</strong>：驗證相關性和重疊率。</li><li><strong>再往前優化</strong>：刪掉雜訊因子、加入高效指標，打造報酬更高、回撤更低的 <strong>00919 優化版</strong>。</li></ol>



<h2>一、00919 三大「精準」拆解</h2>



<p>查看<a href="https://www.capitalfund.com.tw/etf/product/detail/195/basic" data-type="URL" data-id="https://www.capitalfund.com.tw/etf/product/detail/195/basic" target="_blank" rel="noopener">基金介紹</a>發現有幾個特色</p>



<ul><li><strong>精準高息：用「實際宣告」取代「預估數字」</strong></li></ul>



<p>00919 選擇鎖定「<strong>已公告現金股利</strong>」的企業，<strong>從確定的金額計算真實殖利率</strong>，進一步提升股息來源的可靠度與穩定性。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<ul><li><strong> 精準卡位：提前布局的策略優勢</strong></li></ul>



<p>00919 採雙階段審核機制，五月、十二月<strong>雙審核</strong>，透過這種<strong>快與早並重</strong>的選股機制，達到真正「買在除息前」與「走在市場前」的投資節奏。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<ul><li><strong>精準領息：每一分股息都不浪費</strong></li></ul>



<p>選股時機對應企業除息時程，投資人持有期間能真正參與除息、獲取現金配息，<strong>讓每一分錢都落袋為安</strong>。</p>



<blockquote class="wp-block-quote"><p><strong>名詞解釋 &#8211; 殖利率</strong>：每股現金股利 ÷ 股價。殖利率越高，代表用相對便宜的股價就能拿到較高現金回報。</p></blockquote>



<h2>二、復刻 00919：研究流程</h2>



<ol><li><strong>資料擷取</strong><ul><li>00919 <a href="https://www.capitalfund.com.tw/ECStorge/fund/ec/event/00919Prospectus/Prospectus.pdf" data-type="URL" data-id="https://www.capitalfund.com.tw/ECStorge/fund/ec/event/00919Prospectus/Prospectus.pdf" target="_blank" rel="noopener">公開說明書</a></li></ul></li><li><strong>邏輯拆解</strong><ul><li>採樣母體 → 流動性 / 財務健全性 → 股利資訊 → 排序 → 替換規則。</li></ul></li></ol>



<h2>三、復刻 00919 的關鍵步驟</h2>



<ol><li><strong>初始採樣母體</strong>：<ul><li>臺灣上市與上櫃普通股股票為基礎。</li></ul><ul><li>選取發行市值前 300 大股票。</li></ul></li><li><strong>基本條件篩選</strong>：<ul><li>日平均成交金額需高於 8,000 萬元。</li><li>近四季稅後股東權益報酬率 (ROE) 皆為正數。</li></ul></li><li><strong>股利資訊篩選（五月定審限定）</strong>：<ul><li>排除董事會尚未決定股利金額的公司。</li><li>排除已除息且於審核生效日前已完成發放的股票。</li></ul></li><li><strong>排序並選取成分股</strong>：<ul><li><strong>五月定審</strong>：依近四季股利率排序，選出前 30 檔。</li><li><strong>十二月定審</strong>：依據預估股利率排序，選出前 30 檔。</li></ul></li></ol>



<pre class="wp-block-code"><code lang="python" class="language-python">def calculate_ranks(date, is_may_review=True):
    """計算特定審核日期的股票排名"""
    nearest_date = get_nearest_past_trading_date(date, all_trading_dates)
    if nearest_date is None:
        return pd.Series(dtype=float)  # 空序列
        
    if is_may_review:  # 5月定審
        # 計算排名 - 5月定審使用股利率
        score = (市值.rank(axis=1, pct=True) + 股利率.rank(axis=1, pct=True) + yield_ratio.rank(axis=1, pct=True))[conds &amp; (board_cash_dividend &gt; 0)]
    else:  # 12月定審
        # 計算排名 - 12月定審使用預估股利率
        score = (市值.rank(axis=1, pct=True) + 預估股利率.rank(axis=1, pct=True) + yield_ratio.rank(axis=1, pct=True))[conds]
        
    if nearest_date not in score.index:
        return pd.Series(dtype=float)  # 空序列
        
    return score.loc[nearest_date].dropna().rank(ascending=False, method='min')</code></pre>



<ol><li><strong>成分股替換規則</strong>：<ul><li>排名前 15 名直接納入成分股。</li><li>既有成分股若跌出 46 名以外則剔除。</li><li>排名 16 至 45 名的股票列為候補，優先保留既有成分股。</li><li>十二月定審單次最多更替 8 檔股票。</li></ul></li></ol>



<pre class="wp-block-code"><code lang="python" class="language-python"># 建立空的結果DataFrame
position = pd.DataFrame(False, index=effective_dates, columns=close.columns)

# 處理所有調倉日期和排名數據
all_ranks = {}
valid_dates = []

for date in effective_dates:
    try:
        is_may_review = (date.month == 5)
        ranks = calculate_ranks(date, is_may_review)
        if not ranks.empty:
            all_ranks[date] = ranks
            valid_dates.append(date)
    except Exception as e:
        print(f"處理 {date} 時發生錯誤: {e}")

valid_dates = sorted(valid_dates)  # 確保日期順序

if not valid_dates:
    print("沒有有效的調倉日期，無法進行模擬")
else:
# 使用 Pandas 向量化處理成分股替換
    prev_components = None
    target_component_count = 30 # 設定目標成分股數量

    for i, date in enumerate(valid_dates):
                ranks = all_ranks[date]

                # 1. 排名在第15名以內者納入成分股
                top_15 = set(ranks[ranks &lt;= 15].index)

                # 2. 排名16至45名為候補名單
                candidates = set(ranks[(ranks &gt; 15) &amp; (ranks &lt;= 45)].index)

                # 暫定的成分股 (先加入前15名)
                current_components_tentative = set(top_15)

                # 如果不是第一次調倉
                if prev_components is not None:
                        # 加入排名16-45之間的既有成分股
                        existing_in_candidates = prev_components.intersection(candidates)
                        current_components_tentative.update(existing_in_candidates)

                        # 對於12月定審，額外限制最多替換8檔
                        if date.month == 12:
                                # 計算基於 Top15 + 既有候補 所得的新增股票
                                added = current_components_tentative - prev_components

                                # 如果新增超過8檔，需要減少替換數量
                                if len(added) &gt; 8:
                                        # 取出新增的股票並按排名排序 (rank越小越好)
                                        added_with_rank = pd.Series({stock: ranks.get(stock, float('inf')) for stock in added})
                                        # 只保留排名最好的前8名新增的股票
                                        to_keep = set(added_with_rank.sort_values().index[:8])
                                        to_remove_due_to_limit = added - to_keep

                                        # 從暫定名單中移除因超過8檔限制而被剔除的股票
                                        current_components_tentative = current_components_tentative - to_remove_due_to_limit

                # --- 補滿至目標數量 ---
                num_needed = target_component_count - len(current_components_tentative)
                if num_needed &gt; 0:
                        # 找出所有排名16-45，但尚未被選入的股票
                        remaining_candidates = candidates - current_components_tentative
                        if remaining_candidates: # 確保還有候選股可補
                                # 依排名排序這些候選股
                                remaining_candidates_with_rank = pd.Series({stock: ranks.get(stock, float('inf')) for stock in remaining_candidates})
                                sorted_remaining_candidates = remaining_candidates_with_rank.sort_values().index

                                # 選取排名最好的 num_needed 檔來補滿
                                stocks_to_add = set(sorted_remaining_candidates[:num_needed])
                                current_components_tentative.update(stocks_to_add)
                # --- 補滿邏輯結束 ---

                # 最終確認的成分股
                current_components = current_components_tentative

                # 設定成分股
                # 確保只設定存在的欄位
                valid_cols = [col for col in current_components if col in position.columns]
                position.loc[date, valid_cols] = True

                # 更新前一期成分股
                prev_components = current_components

    # 5. 前向填充空值，確保非調倉日也有持股
    position = position.loc[valid_dates]</code></pre>



<ol><li><strong>生效日期計算</strong>：<ul><li>審核基準日後第 5 個交易日正式生效。</li></ul></li></ol>



<pre class="wp-block-code"><code lang="python" class="language-python">def calculate_review_dates(trading_dates: pd.DatetimeIndex):
    """
    計算台灣高股息指數的審核與調倉日期
    
    台灣高股息指數規則:
    - 5月: 第17個交易日為審核基準日，審核資料截至5月第10個交易日
    - 12月: 第7個交易日為審核基準日，審核資料截至11月最後交易日
    - 生效日: 審核基準日後第5個交易日
    """
    review_dates_info = []
    start_year = trading_dates[0].year
    end_year = trading_dates[-1].year

    for year in range(start_year, end_year + 1):
        # 5月定審
        may_review_basis_day = get_trading_day_of_month(year, 5, 17, trading_dates)
        may_data_cutoff_day = get_trading_day_of_month(year, 5, 10, trading_dates)
        
        if may_review_basis_day and may_data_cutoff_day:
            target_effective_day_index = trading_dates.searchsorted(may_review_basis_day) + 5
            if target_effective_day_index &lt; len(trading_dates):
                may_effective_day_target = trading_dates[target_effective_day_index]
                may_effective_day = get_nearest_future_trading_date(may_effective_day_target, trading_dates)
                if may_effective_day:
                    review_dates_info.append({
                        'year': year, 
                        'month': 5,
                        'cutoff_date': may_data_cutoff_day,
                        'basis_date': may_review_basis_day,
                        'effective_date': may_effective_day
                    })

        # 12月定審
        dec_review_basis_day = get_trading_day_of_month(year, 12, 7, trading_dates)
        nov_data_cutoff_day = get_last_trading_day_of_month(year, 11, trading_dates)
        
        if dec_review_basis_day and nov_data_cutoff_day:
            target_effective_day_index = trading_dates.searchsorted(dec_review_basis_day) + 5
            if target_effective_day_index &lt; len(trading_dates):
                dec_effective_day_target = trading_dates[target_effective_day_index]
                dec_effective_day = get_nearest_future_trading_date(dec_effective_day_target, trading_dates)
                if dec_effective_day:
                    review_dates_info.append({
                        'year': year, 
                        'month': 12,
                        'cutoff_date': nov_data_cutoff_day,
                        'basis_date': dec_review_basis_day,
                        'effective_date': dec_effective_day
                    })

    # 按生效日期排序
    review_dates_info = sorted(review_dates_info, key=lambda x: x['effective_date'])
    # 移除無效日期
    review_dates_info = [info for info in review_dates_info if info['effective_date'] is not None]
    
    if not review_dates_info:
        raise ValueError("無法計算出任何有效的審核與生效日期，請檢查日期計算邏輯或資料範圍。")
    
    return review_dates_info</code></pre>



<h2>四、復刻結果</h2>



<p><br>在經過一連串比對後，復刻而得的策略股池與原版 00919 報酬率曲線有高度相關。這意味著，我們的 復刻版 00919 確實能有效重現 00919 的選股結果。</p>



<p><strong>相關性分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" width="382" height="549" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.48.55.png" alt="CleanShot 2025 04 20 at 11.48.55" class="wp-image-6566" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.48.55.png 382w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.48.55-209x300.png 209w" sizes="(max-width: 382px) 100vw, 382px" title="復刻與優化 00919：玩轉高股息 ETF 25"><figcaption>相關性分析</figcaption></figure></div>


<p><strong>復刻 00919 報酬</strong> : </p>



<figure class="wp-block-image size-full"><img loading="lazy" width="761" height="599" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.59.52.png" alt="CleanShot 2025 04 20 at 11.59.52" class="wp-image-6568" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.59.52.png 761w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-11.59.52-300x236.png 300w" sizes="(max-width: 761px) 100vw, 761px" title="復刻與優化 00919：玩轉高股息 ETF 26"><figcaption><strong>復刻 00919 報酬</strong></figcaption></figure>



<p><strong>長期持有 00919&nbsp;報酬</strong> :</p>



<figure class="wp-block-image size-full"><img loading="lazy" width="770" height="772" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.01.12.png" alt="CleanShot 2025 04 20 at 12.01.12" class="wp-image-6569" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.01.12.png 770w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.01.12-300x300.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.01.12-150x150.png 150w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.01.12-768x770.png 768w" sizes="(max-width: 770px) 100vw, 770px" title="復刻與優化 00919：玩轉高股息 ETF 27"><figcaption><strong>長期持有 00919&nbsp;報酬</strong></figcaption></figure>



<p>我們的「<strong>復刻版 00919</strong>」與官方版本高相關，證明邏輯拆解合理。</p>



<h2>五、進階優化：</h2>



<p>雖然我們已成功復刻 00919 的選股邏輯，但這僅是起點。在接下來的優化階段，我們希望<strong>進一步提升策略效率與穩定性</strong>。因此，我們先行<strong>剔除效度不高的條件，以降低雜訊與過度擬合（overfitting）的風險</strong>，同時<strong>納入經過 IC/IR 驗證、具高預測力的關鍵因子</strong>，讓策略在維持高息特性的同時，具備更好的長期報酬潛力。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" width="662" height="480" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.04.40@2x.png" alt="CleanShot 2025 04 20 at" class="wp-image-6570" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.04.40@2x.png 662w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-12.04.40@2x-300x218.png 300w" sizes="(max-width: 662px) 100vw, 662px" title="復刻與優化 00919：玩轉高股息 ETF 28"><figcaption>IC / IR 分析</figcaption></figure></div>


<p><strong>IC/IR</strong> 指標告訴我們，有些條件不但沒幫忙，還在拖後腿，列如：</p>



<ul><li>市值條件 IC 為 <strong>負值</strong></li><li>流動性條件 IC 也是 <strong>負值</strong></li></ul>



<blockquote class="wp-block-quote"><p><strong>名詞小辭典 </strong>&#8211; <strong>IC / IR</strong> <br>• <strong>IC</strong>（Information Coefficient）：因子對未來報酬的預測能力，&gt;0 正向、&lt;0 反向。 <br>• <strong>IR</strong>（Information Ratio）：IC 均值 ÷ IC 標準差，衡量穩定度，&gt;1 代表因子「又準又穩」。</p></blockquote>



<p></p>



<p>當我們發現市值與流動性條件的 IC 為負時，決定剔除。這樣的做法其實也呼應了我們作為一般投資人的一項優勢，<strong>不像 ETF 必須考量大規模資金進出時的流動性風險</strong>，我們可以更靈活地聚焦在報酬潛力本身，因此不再納入這些與 ETF 結構相關的限制性條件，也是合理的選擇。</p>



<p>接下來，我們回頭檢視先前 <a href="https://www.finlab.tw/%e5%a6%82%e4%bd%95%e5%be%a9%e5%88%bb0056%e9%ab%98%e8%82%a1%e6%81%afetf%ef%bc%8c%e4%b8%a6%e6%89%93%e9%80%a0%e8%b6%85%e8%b6%8a%e5%b8%82%e5%a0%b4%e7%9a%84%e9%80%b2%e9%9a%8e%e7%ad%96%e7%95%a5%ef%bc%81/">先前文章</a>， 「復刻 0056 ETF」文章中表現優異的因子，將這些經驗延伸應用到本次策略中。透過重新分析其 IC 與 IR 指標，我們挑選出具有預測力的關鍵因子，<strong>將其納入排序邏輯中與原有條件結合</strong>。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="838" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.08.07@2x-838x1024.png" alt="CleanShot 2025 04 20 at 13.08.07@2x" class="wp-image-6572" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.08.07@2x-838x1024.png 838w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.08.07@2x-246x300.png 246w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.08.07@2x-768x938.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.08.07@2x.png 866w" sizes="(max-width: 838px) 100vw, 838px" title="復刻與優化 00919：玩轉高股息 ETF 29"><figcaption>因子 IC IR 分析</figcaption></figure></div>


<p>可以發現，<strong>股利率、預估股利率、cash_dividend_annual 以及 ROE</strong> 都展現出良好的表現，屬於具有預測力的優質因子。</p>



<p>接下來，我們將這些表現突出的因子進行整合，<strong>以組合分析的方式評估其綜合效果</strong>，並驗證是否能進一步提升選股策略的穩定性與報酬潛力。</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="498" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x-1024x498.png" alt="CleanShot 2025 04 20 at 13.13.50@2x" class="wp-image-6577" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x-1024x498.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x-300x146.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x-768x374.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x-1536x747.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.50@2x.png 1982w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 30"><figcaption>各預測週期中因子在前10名組合中的出現頻率</figcaption></figure>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.12.34@2x-1024x763.png" alt="CleanShot 2025 04 20 at 13.12.34@2x" class="wp-image-6573" width="840" height="625" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.12.34@2x-1024x763.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.12.34@2x-300x224.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.12.34@2x-1536x1145.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.12.34@2x.png 1540w" sizes="(max-width: 840px) 100vw, 840px" title="復刻與優化 00919：玩轉高股息 ETF 31"><figcaption>60天預測期 &#8211; 因子數量與ICIR關係</figcaption></figure>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="760" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.02@2x-1024x760.png" alt="CleanShot 2025 04 20 at 13.13.02@2x" class="wp-image-6574" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.02@2x-1024x760.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.02@2x-300x223.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.02@2x-768x570.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.02@2x.png 1520w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 32"><figcaption>120天預測期 &#8211; 因子數量與ICIR關係</figcaption></figure>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="679" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x-1024x679.png" alt="CleanShot 2025 04 20 at 13.13.22@2x" class="wp-image-6575" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x-1024x679.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x-300x199.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x-768x509.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x-1536x1018.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.22@2x.png 1780w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 33"><figcaption>60 天預測期 &#8211; 前10個最佳因子組合</figcaption></figure>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="677" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x-1024x677.png" alt="CleanShot 2025 04 20 at 13.13.34@2x" class="wp-image-6576" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x-1024x677.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x-300x198.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x-768x508.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x-1536x1015.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.13.34@2x.png 1782w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 34"><figcaption>120 天預測期 &#8211; 前10個最佳因子組合</figcaption></figure>



<p>可以發現，無論是在 60 天或 120 天的時間尺度下，<strong>ROE 與年化股息率的組合表現穩定且亮眼</strong>。因此我們將這組優勢因子正式納入五月與十二月的選股排序邏輯中。接著，我們<strong>進一步精簡成分股數量，並取消複雜的替換規則</strong>，打造出更簡潔、集中、操作效率更高的「終極策略版本」。這樣的設計，能兼顧高勝率與操作彈性，真正貼近一般投資人的實戰需求。</p>



<h2><br>六、優化後的成績單</h2>



<ol><li><strong>年化報酬率：</strong>&nbsp;提高至約&nbsp;<strong>47%</strong>，相較於原版明顯領先。</li><li><strong>夏普比率：</strong>&nbsp;從遠本的 <strong>1.16 </strong>提高至約&nbsp;<strong>1.83</strong>，相較於原版明顯領先。</li></ol>



<p>更難能可貴的是在差不多的最大下跌風險下，提高報酬率和穩定性，不必日日擔心股價大幅震盪。如此一來，投資人就能同時享有領股利的安心感，又能捕捉股價成長的爆發力。<br><strong>獲利能力分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="930" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x-1024x930.png" alt="CleanShot 2025 04 20 at 13.24.40@2x" class="wp-image-6579" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x-1024x930.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x-300x273.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x-768x698.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x-1536x1395.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.24.40@2x.png 1550w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 35"><figcaption>獲利能力分析</figcaption></figure></div>


<p><strong>抗風險能力分析：</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1024" height="942" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x-1024x942.png" alt="CleanShot 2025 04 20 at 13.25.36@2x" class="wp-image-6580" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x-1024x942.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x-300x276.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x-768x707.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x-1536x1413.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.25.36@2x.png 1552w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 36"><figcaption><strong>抗風險能力分析</strong></figcaption></figure></div>


<p><strong>風險報酬分析：</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="347" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.13@2x-1024x347.png" alt="CleanShot 2025 04 20 at 13.26.13@2x" class="wp-image-6581" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.13@2x-1024x347.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.13@2x-300x102.png 300w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.13@2x-768x260.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.13@2x.png 1534w" sizes="(max-width: 1024px) 100vw, 1024px" title="復刻與優化 00919：玩轉高股息 ETF 37"><figcaption><strong>風險報酬分析</strong></figcaption></figure>



<p><strong>勝率期望值分析：</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" width="960" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x-960x1024.png" alt="CleanShot 2025 04 20 at 13.26.40@2x" class="wp-image-6582" srcset="https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x-960x1024.png 960w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x-281x300.png 281w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x-768x819.png 768w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x-1440x1536.png 1440w, https://www.finlab.tw/wp-content/uploads/2025/04/CleanShot-2025-04-20-at-13.26.40@2x.png 1522w" sizes="(max-width: 960px) 100vw, 960px" title="復刻與優化 00919：玩轉高股息 ETF 38"><figcaption><strong>勝率期望值分析</strong></figcaption></figure>



<p>在不犧牲「領息」特色的前提下，<strong>獲利更高、風險更低</strong>。</p>



<h2>七、行動建議</h2>



<ol><li><strong>進階派</strong>：跟著本文邏輯，自行用FinLab 復刻並優化。</li><li><strong>客製派</strong>：把優化後因子丟進量化平台，持續調參，打造專屬高息策略。</li></ol>



<blockquote class="wp-block-quote"><p>風險提醒：高息 ≠ 無風險。股息遞延、宏觀逆風都可能影響績效。請按自身資金配置與風險承受度操作。</p></blockquote>



<h2>結語：高息，也可以很聰明</h2>



<p>復刻只是起點，希望這篇文章能點燃你的研究慾望，讓「領息」不再只是被動等待，而成為可以精雕細琢、持續進化的好策略。</p>



<p>若你已經迫不及待想動手，接下來：</p>



<ul><li>依本文框架補上程式碼段並回測驗證。</li><li>加入自己的好因子和條件，調整策略。</li><li>也歡迎參考 <a href="https://colab.research.google.com/drive/1uD2DkcugVXwHLZvHEceMG2BQWTRDRypA?usp=sharing" data-type="URL" data-id="https://colab.research.google.com/drive/1uD2DkcugVXwHLZvHEceMG2BQWTRDRypA?usp=sharing" target="_blank" rel="noopener">Colab 範例檔</a>。</li></ul>



<p>祝你在下一個除息季，順利把每一分股息都握在手中！</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/%e5%be%a9%e5%88%bb%e8%88%87%e5%84%aa%e5%8c%96-00919%ef%bc%9a%e7%8e%a9%e8%bd%89%e9%ab%98%e8%82%a1%e6%81%af-etf/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6561</post-id>	</item>
		<item>
		<title>如何復刻0056高股息ETF，並打造超越市場的進階策略！</title>
		<link>https://www.finlab.tw/%e5%a6%82%e4%bd%95%e5%be%a9%e5%88%bb0056%e9%ab%98%e8%82%a1%e6%81%afetf%ef%bc%8c%e4%b8%a6%e6%89%93%e9%80%a0%e8%b6%85%e8%b6%8a%e5%b8%82%e5%a0%b4%e7%9a%84%e9%80%b2%e9%9a%8e%e7%ad%96%e7%95%a5%ef%bc%81/</link>
					<comments>https://www.finlab.tw/%e5%a6%82%e4%bd%95%e5%be%a9%e5%88%bb0056%e9%ab%98%e8%82%a1%e6%81%afetf%ef%bc%8c%e4%b8%a6%e6%89%93%e9%80%a0%e8%b6%85%e8%b6%8a%e5%b8%82%e5%a0%b4%e7%9a%84%e9%80%b2%e9%9a%8e%e7%ad%96%e7%95%a5%ef%bc%81/#respond</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Tue, 25 Mar 2025 05:09:58 +0000</pubDate>
				<category><![CDATA[VIP文章]]></category>
		<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[基本面分析]]></category>
		<category><![CDATA[股票策略]]></category>
		<category><![CDATA[財經PYTHON教學]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[歷史回測]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[股票]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6547</guid>

					<description><![CDATA[復刻0056高股息ETF，並打造超越市場的進階策略]]></description>
										<content:encoded><![CDATA[
<h1>一、復刻0056高股息ETF的核心邏輯</h1>



<p>市面上最受投資人青睞的高股息 ETF，莫過於&nbsp;<strong>元大高股息 ETF（0056）</strong>。它是許多台灣投資人「存股領股利」的代表標的。0056 的選股方法，是從<strong>臺灣50指數</strong>與<strong>臺灣中型100指數</strong>為母體，優先篩選出具備相對高殖利率（預期下一年股息）之公司，最終組成 50 檔成分股。</p>



<p>然而，許多人只知道它「<strong>給股利</strong>」、風險似乎不高，卻很少真正挖掘其選股邏輯背後的細節和可能的缺陷。為了讓大家更深入了解這套機制，我們運用量化交易的方法，去「<strong>復刻</strong>」0056 的篩選邏輯，並嘗試更進一步的優化。這項研究花了相當多時間精力，從龐大資料的爬取、清洗、到回測比對，都一一經歷反覆測試，只為了呈現給投資人更清晰且更具行動價值的策略思路。</p>



<h3>復刻 0056 的關鍵步驟</h3>



<ul><li><strong>市值排名前 150 名股票作為初始篩選標的這代表先從台灣市值規模較大、較有流動性的公司中著手，排除一些可能成交量低、營運風險較高的股票。</strong></li><li><strong>近三年皆穩定發放現金股利0056 著重於「股息」，因此公司能否穩定配發現金股息，就顯得至關重要。</strong></li><li><strong>毛利率持續成長反映公司基本營運體質是否健康；若毛利率維持增長，通常代表公司具備較佳的競爭力。</strong></li><li><strong>設定交易流通性條件確保標的能有效買賣，避免「有好策略，卻掛不到單」的尷尬情況。</strong></li><li><strong>最終根據現金股利殖利率和現金股息年化報酬，選出前 50 檔股票這基本就複製了 0056 的核心精神：高殖利率作為重要排序依據。</strong></li></ul>



<p>在經過一連串比對後，復刻而得的策略股池與原版 0056 股池有&nbsp;<strong>72%</strong>&nbsp;的重疊率，報酬率曲線也高度相關。這意味著，我們的 復刻版 0056 確實能<strong>有效重現 0056 的選股結果</strong>。</p>



<h3>相關性分析：</h3>


<div class="wp-block-image">
<figure class="aligncenter is-resized"><img loading="lazy" src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.50.56.png" alt="CleanShot 2025 03 17 at 11.50.56" width="354" height="705" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 39"><figcaption>相關性分析</figcaption></figure></div>


<h1><br>二、為什麼要優化 0056？</h1>



<p>雖然 0056 深受大眾喜愛，但其單一依賴「殖利率」的選股標準，也帶來了不少潛在問題。<strong>最常見的疑問在於：如果公司未來的獲利或股價下滑，殖利率再高也未必保得住報酬。</strong>&nbsp;因此，僅看現金股利殖利率，有時候會忽略公司實際的成長動能與股價穩定度。</p>



<ul><li><strong>缺乏成長潛力考量：</strong> 0056 更重視「現在」的高股息，卻無法保證公司未來能維持同等配息水準。</li><li><strong>忽略股價風險：</strong> 有些殖利率高的公司，股價可能因營運不佳或大環境衝擊而下跌，使投資人因價差損失抵銷了領股息的好處。</li></ul>



<p>事實上，根據許多長期回測的結果，0056 的投資績效常<strong>落後大盤</strong>。</p>



<h3><strong>復刻 0056 報酬：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.39.43@2x-1024x729.png" alt="CleanShot 2025 03 17 at 11.39.43@2x" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 40"><figcaption>復刻 0056 報酬</figcaption></figure></div>


<h3><strong>長期持有 0056&nbsp;報酬：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.47.46@2x-1024x790.png" alt="CleanShot 2025 03 17 at 11.47.46@2x" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 41"><figcaption><strong>長期持有 0056&nbsp;報酬</strong></figcaption></figure></div>


<p>這也是為什麼我們要繼續進行第二階段的<strong>策略優化</strong>，希望既能拿到<strong>股利</strong>，也能兼顧成長與風險控管。</p>



<p></p>



<h1>三、策略的優化方向</h1>



<p>為了進一步提升報酬並減少下跌風險，我們引入了更全面的選股因子與風險控管條件，包括：</p>



<ol><li><strong>營收成長指標</strong><ul><li><strong>為什麼重要？</strong> 相較於只看當前股息，營收成長能更直接反映公司未來的成長動能。假如一家公司營收年年進步，往後維持股息或提高配息的機率也相對提高。</li></ul></li><li><strong>長期均線條件</strong><ul><li><strong>為什麼重要？</strong> 均線是一種技術分析常用的趨勢判定法。挑選「股價在長期均線之上」的公司，能有效排除股價長期走弱或進入空頭趨勢的標的。</li></ul></li><li><strong>股價波動率限制</strong><ul><li><strong>為什麼重要？</strong> 高波動可能意味著市場對公司基本面有疑慮，或財務體質波動度較大。過高的波動率會拉大投資組合的風險，限制波動度有助於穩定心態與獲利表現。</li></ul></li><li><strong>殖利率門檻</strong><ul><li><strong>為什麼重要？</strong> 雖然不能只看殖利率，但也不應該放棄。透過設置「殖利率至少在前 40%（或 60 百分位數以上）」的條件，既能保有高股息優勢，又不至於過度犧牲穩定度與成長性。</li></ul></li></ol>



<p>這些篩選條件的核心邏輯，就在於想同時享受「<strong>股利</strong>」與「<strong>成長</strong>」。最終，我們挑出能在長期維持向上趨勢、營運持續成長、且具有一定股利保證的股票，打造一個較能兼顧「<strong>領息</strong>」與「<strong>資本利得</strong>」的投資組合。<br></p>



<h1>四、優化後的策略範例</h1>



<p>以下程式碼範例，示範如何在量化平台上落實上述篩選邏輯。除了維持原先 0056「市值前 150 名」、「三年皆有發放股利」等規範，我們另外納入了<strong>營收成長</strong>、<strong>長期均線</strong>、<strong>波動度</strong>及<strong>殖利率門檻</strong>等條件。最後再綜合每檔股票的排名結果，只選擇前 20 檔表現優異的公司。</p>



<pre class="wp-block-code"><code class="">base_stocks = 市值.is_largest(150)
yield_ratio = data.get('price_earning_ratio:殖利率(%)')
殖利率條件 = (yield_ratio &gt;= yield_ratio.quantile(0.6, axis=1))
去年同月增減 = data.get("monthly_revenue:去年同月增減(%)")
rev = data.get('monthly_revenue:當月營收')
營收成長 = (rev.average(3) &gt; rev.average(12))
均線條件 = (close&gt;close.average(120)) &amp; (close&gt;close.average(240))
std = close.pct_change().rolling(60).std().rank(axis=1, pct=True)
波動條件 = (std &lt; 0.5)

conds = (
 (close&gt;0)
 &amp; base_stocks
 &amp; vol_cond
 &amp; eps_cond
 &amp; 近三年皆有發放現金股利
 &amp; 毛利成長率優良
 &amp; 營收成長
 &amp; 均線條件
 &amp; 波動條件
 &amp; 殖利率條件
)
position =  (cash_dividend_annual.rank(axis=1, pct=True) + 現金股利殖利率.rank(axis=1, pct=True) + 去年同月增減.rank(axis=1, pct=True))[conds].is_largest(20)
dates = []
y_start = position.index[0].year
y_end = position.index[-1].year
for y in range(y_start, y_end+1):
  dates.append(f"{y}-05-31")
  dates.append(f"{y}-12-27")
resample = pd.to_datetime(dates)
report2 = sim(position.reindex(resample, method='ffill'), resample=resample, upload=False)
report2.display()</code></pre>



<p>以上範例，用來呈現大致邏輯。重點在於「<strong>為什麼要加入這些條件</strong>」，而不只是條件本身。唯有理解每一步驟背後的意義，才能在投資時有所依據，也更能說服自己這樣嘗試，也歡迎大家優化加入更多因子或是優化相關的參數。</p>



<p></p>



<h1>五、因子IC/IR分析</h1>



<p>在量化投資的領域，經常會透過「<strong>Information Coefficient</strong>&nbsp;<strong>資訊係數</strong>」來確認某個因子是否確實能帶來正向貢獻。以下名詞簡單解釋：</p>



<ul><li><strong>IC（Information Coefficient，訊息係數）：</strong> 量度某因子的預測能力，IC &gt; 0 代表該因子對未來報酬有正向預測力。</li><li><strong>IR（Information Ratio，訊息比率）：</strong> 代表因子收益與風險的平衡程度，IR &gt; 1 通常表示該因子效果不錯。</li></ul>



<p>更詳細的內容歡迎參考之前的文章，<a href="https://www.finlab.tw/information-coefficient/">Information Coefficient 是什麼，要如何使用？</a></p>



<p>經分析顯示，<strong>營收成長</strong>、<strong>現金股息年化報酬</strong>、<strong>殖利率條件</strong>等因子都對整體績效貢獻較大，尤其是營收成長與長期均線兩因子的 IC/IR 表現最亮眼。這進一步佐證了「高息 + 成長 + 走勢向上」的組合，更能帶來勝率與報酬的提升。</p>



<h3><strong>因子 IC / IR 分析：</strong></h3>


<div class="wp-block-image is-style-default">
<figure class="aligncenter is-resized"><img loading="lazy" src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.38.57.png" alt="CleanShot 2025 03 17 at 11.38.57" width="315" height="468" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 42"><figcaption><strong>因子 IC / IR 分析</strong></figcaption></figure></div>


<p></p>



<h1>六、終極版策略的績效分析</h1>



<p>把所有優化條件整合後，使用強大的&nbsp;<a href="https://doc.finlab.tw/reference/optimize/#finlab.optimize.combinations.sim_conditions" target="_blank" rel="noopener"><code>finlab.optimize</code></a>&nbsp;「<a href="https://doc.finlab.tw/reference/optimize/#finlab.optimize.combinations.sim_conditions" target="_blank" rel="noopener">文檔連結</a>」可以更方便的進行<strong>條件排列組合</strong>與大規模回測，最終得到「<strong>終極版</strong>」的選股策略。其結果遠遠優於單純追求殖利率的 0056，以下為量化回測的關鍵指標：</p>



<ol><li><strong>年化報酬率：</strong>&nbsp;提高至約&nbsp;<strong>31%</strong>，相較於原版 0056 明顯領先。</li><li><strong>最大回撤：</strong>&nbsp;降至&nbsp;<strong>24.3%</strong>，顯示波動與下跌風險獲得更佳控管。</li><li><strong>夏普比率：</strong>&nbsp;超過&nbsp;<strong>2</strong>&nbsp;以上，代表收益相對於風險具高度吸引力。</li></ol>



<p>除了高報酬率，更難能可貴的是兼顧到風險面與投資體驗：投資組合的走勢相對平穩，不必日日擔心股價大幅震盪。如此一來，投資人就能同時享有領股利的安心感，又能捕捉股價成長的爆發力。</p>



<h3><strong>獲利能力分析：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.42.27.png" alt="CleanShot 2025 03 17 at 11.42.27" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 43"><figcaption><strong>獲利能力分析</strong></figcaption></figure></div>


<h3><strong>抗風險能力分析：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.42.51.png" alt="CleanShot 2025 03 17 at 11.42.51" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 44"><figcaption><strong>抗風險能力分析</strong></figcaption></figure></div>


<h3><strong>風險報酬分析：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.43.13.png" alt="CleanShot 2025 03 17 at 11.43.13" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 45"><figcaption><strong>風險報酬分析</strong></figcaption></figure></div>


<h3><strong>勝率期望值分析：</strong></h3>


<div class="wp-block-image">
<figure class="aligncenter"><img src="https://www.finlab.tw/wp-content/uploads/2025/03/CleanShot-2025-03-17-at-11.43.45.png" alt="CleanShot 2025 03 17 at 11.43.45" title="如何復刻0056高股息ETF，並打造超越市場的進階策略！ 46"><figcaption><strong>勝率期望值分析</strong></figcaption></figure></div>


<h1><br>七、結語與投資行動建議</h1>



<p>從最初單純「<strong>復刻 0056 高股息</strong>」的思路，到後來發現 0056 可能有所不足，再進一步優化篩選條件並不斷迭代測試。正是因為投入了大量的程式回測、因子分析，才有這次所呈現的量化成果。</p>



<p>對於想靠股息過日子，或喜歡「<strong>領息 + 穩定增值</strong>」的投資人而言，本文提供了另一個思考角度：</p>



<ul><li>高殖利率當然好，但若同時輔以「<strong>營收成長</strong>」、「<strong>股價走勢</strong>」以及「<strong>風險控管</strong>」等條件，也許能得到更好的投資體驗與回報。</li><li>0056 作為大眾入門選擇並無不可，但若你願意花些心思了解量化策略，自己動手選股或透過更進階的工具優化組合，或許就能在領股期的同時「多賺一點，少跌一點」，甚至大大超越原始 ETF 的表現。</li></ul>



<p>最後，若對量化選股或因子策略有更多好奇心，不妨實際嘗試應用文中提到的篩選方式，或直接透過量化平台進行回測調整，也歡迎參考&nbsp;<a href="https://colab.research.google.com/drive/1Gkz7n7jniMAqqEzwh96eV3JI1YTplS3g" target="_blank" rel="noopener">Colab範例檔</a>&nbsp;。<strong>祝大家研究和投資順利、盈收長紅！</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/%e5%a6%82%e4%bd%95%e5%be%a9%e5%88%bb0056%e9%ab%98%e8%82%a1%e6%81%afetf%ef%bc%8c%e4%b8%a6%e6%89%93%e9%80%a0%e8%b6%85%e8%b6%8a%e5%b8%82%e5%a0%b4%e7%9a%84%e9%80%b2%e9%9a%8e%e7%ad%96%e7%95%a5%ef%bc%81/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6547</post-id>	</item>
		<item>
		<title>分散風險的迷思？當心「攤薄」效應！</title>
		<link>https://www.finlab.tw/risk-of-diversification/</link>
					<comments>https://www.finlab.tw/risk-of-diversification/#respond</comments>
		
		<dc:creator><![CDATA[FinLab - 韓承佑]]></dc:creator>
		<pubDate>Sun, 23 Feb 2025 04:00:00 +0000</pubDate>
				<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[股票策略]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6444</guid>

					<description><![CDATA[在投資世界裡，我們常聽到「不要把雞蛋放在同一個籃子裡」這句箴言，強調投資分散風險的重要性。然而，是不是持有的股 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="585" src="https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its-1024x585.webp" alt="DALL·E 2025 02 15 00.43.45 A 3D rendered glass basket with a smooth rounded and high quality translucent surface. The basket has a refined and elegant curvature enhancing its" class="wp-image-6457" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its-1024x585.webp 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its-300x171.webp 300w, https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its-768x439.webp 768w, https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its-1536x878.webp 1536w, https://www.finlab.tw/wp-content/uploads/2025/02/DALL·E-2025-02-15-00.43.45-A-3D-rendered-glass-basket-with-a-smooth-rounded-and-high-quality-translucent-surface.-The-basket-has-a-refined-and-elegant-curvature-enhancing-its.webp 1792w" sizes="(max-width: 1024px) 100vw, 1024px" title="分散風險的迷思？當心「攤薄」效應！ 62"><figcaption>雞蛋放在同一個籃子不好嗎？</figcaption></figure>



<p>在投資世界裡，我們常聽到「不要把雞蛋放在同一個籃子裡」這句箴言，強調投資分散風險的重要性。然而，<strong>是不是持有的股票越多，投資就越安全、「報酬/風險」比就越高呢？</strong> 事實並非如此簡單。想像一下，如果你有一套祕方湯頭，只放一兩種獨特香料就風味十足，但你貪心地把<strong>一百種味道差不多的香料</strong>通通丟進鍋裡，結果滋味可能變得怪異又平淡無奇。投資組合也是一樣，如果<strong>過度分散在同類型的「Alpha股票」</strong>上（所謂 Alpha 股票即預期能帶來超額報酬的股票），你的優勢可能會被<strong>「攤薄」</strong>到幾乎嚐不出味道來。學術研究與數學證明告訴我們：當投資組合過度集中於<strong>同質的Alpha策略</strong>時，反而無法有效提升績效。最佳策略其實是<strong>精簡每一類Alpha股票的持有數量</strong>，同時在<strong>組合中納入多種不同類型的Alpha</strong>，透過異質性的多樣化來維持高報酬和分散風險。聽起來有點矛盾嗎？讓我們一步步拆解其中的奧祕。</p>



<h2>過度分散：當所有股票「一個樣」，報酬/風險變成大盤的模樣</h2>



<p>直覺上，多元分散應能降低風險，但若分散的對象彼此<strong>高度相似</strong>，那麼風險並不會隨持股數量無限下降，反而<strong>報酬被攤薄</strong>得厲害。學術研究早在1960年代就證實了分散投資的<strong>遞減效益</strong>：持股數增加到一定程度後，<strong>剩餘的風險下降幅度趨近於零</strong> (<a href="https://www.mdpi.com/1911-8074/14/11/551#:~:text=required%20to%20eliminate%2095,the%20number%20of%20stocks%20required" target="_blank" rel="noopener">How Many Stocks Are Sufficient for Equity Portfolio Diversification? A Review of the Literature</a>)。例如，Tang（2004）的分析指出：約20支股票的投資組合已能消除約95%的可分散風險，再額外加入80支股票，僅額外降低約4%的風險 (<a href="https://www.mdpi.com/1911-8074/14/11/551#:~:text=required%20to%20eliminate%2095,the%20number%20of%20stocks%20required" target="_blank" rel="noopener">How Many Stocks Are Sufficient for Equity Portfolio Diversification? A Review of the Literature</a>)！換言之，超過一定數量後，每新增一支相似的股票<strong>幾乎沒有降低風險的作用</strong>。</p>



<p>讓我們用數學觀點看看發生了什麼：假設這些股票都屬於同一類型（高度相關的Alpha股票），各股票報酬之間的相關係數為ρ，單支股票的標準差為σ。如果平均分散投資於N支這類股票，整體組合的波動率公式近似為：</p>



<p><img src="https://s0.wp.com/latex.php?latex=%5Csigma_%7Bport%7D+%5Capprox+%5Csigma+%5Csqrt%7B%5Crho+%2B+%5Cfrac%7B1-%5Crho%7D%7BN%7D%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sigma_{port} &#092;approx &#092;sigma &#092;sqrt{&#092;rho + &#092;frac{1-&#092;rho}{N}} " class="latex" title="分散風險的迷思？當心「攤薄」效應！ 63"></p>



<p>這公式意味著：當N增加時，組合風險<img src="https://s0.wp.com/latex.php?latex=%5Csigma_%7Bport%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sigma_{port} " class="latex" title="分散風險的迷思？當心「攤薄」效應！ 64">不斷降低，但有一個<strong>下限</strong>。隨著N趨近無限大，<img src="https://s0.wp.com/latex.php?latex=%5Cfrac%7B1-%5Crho%7D%7BN%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;frac{1-&#092;rho}{N} " class="latex" title="分散風險的迷思？當心「攤薄」效應！ 65">項趨近於0，<strong>組合風險逼近 <img src="https://s0.wp.com/latex.php?latex=%5Csigma%5Csqrt%7B%5Crho%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sigma&#092;sqrt{&#092;rho} " class="latex" title="分散風險的迷思？當心「攤薄」效應！ 66"></strong> (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=Grinold%E2%80%99s%20,diversified%20portfolio%20seem%20to%20behave" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)。如果這些股票完全同質移動（相關係數ρ接近1），那麼無論持有再多股票，整體波動率幾乎跟單一股票一樣高（因為<img src="https://s0.wp.com/latex.php?latex=%5Csigma%5Csqrt%7B%5Crho%7D%5Capprox+%5Csigma&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sigma&#092;sqrt{&#092;rho}&#092;approx &#092;sigma" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 67">），風險無法進一步分散。也就是說，當所持股票<strong>高度相關</strong>時，<strong>有效的獨立投資機會數並未增加</strong> (<a href="https://joim.com/wp-content/uploads/emember/downloads/p0543.pdf#:~:text=IR%20%3D%20IC%E2%88%9A%20BR,Grinold%20and%20Kahn" target="_blank" rel="noopener">P0543</a>)。Richard Grinold在《投資組合管理期刊》1989年的經典論文中就強調：提升組合表現靠的是<strong>獨立的Alpha投注</strong>數量，而非單純增加持股數 (<a href="https://joim.com/wp-content/uploads/emember/downloads/p0543.pdf#:~:text=IR%20%3D%20IC%E2%88%9A%20BR,Grinold%20and%20Kahn" target="_blank" rel="noopener">P0543</a>)。如果增加的持股彼此並不獨立（例如同類型股票，共同隨著某一產業或因子波動），那麼對應的「獨立押注」數其實並沒有同步增加。</p>



<p>更糟的是，在報酬端，當我們不加篩選地持有太多<strong>同類型的股票</strong>時，投資組合的<strong>平均超額報酬（Alpha）</strong>也會被稀釋。想像你原本挑選出幾支最具Alpha潛力的股票，但為了「分散」，你把次優甚至泛泛之輩的股票也納入組合。結果，<strong>優秀股票的超額報酬被一堆平庸股票攤薄</strong>掉了。這有點像把一杯濃縮咖啡倒進一桶水裡，咖啡的濃醇香氣（超額報酬）會被沖淡到喝不出來。實證研究正好印證了這點：</p>



<ul><li><strong>基金經理的「最佳點子」</strong>：哈佛商學院和倫敦政經學院的<a href="https://personal.lse.ac.uk/polk/research/bestideas.pdf#:~:text=We%20find%20that%20the%20stocks,organization%20of%20the%20money%20management" target="_blank" rel="noopener">一項研究</a>發現，基金經理投資組合中他們<strong>最有信心的「最佳點子」股票</strong>，其表現遠勝過他們持有的其他股票。不僅擊敗大盤，甚至比他們自己組合裡的其他持股每年多出約2.8%～4.5%的超額報酬 ！而<strong>「大多數其他持股並沒有顯著超額報酬」</strong>。也就是說，經理那些為了「分散風險」而加入的次要持股，幾乎沒有貢獻額外報酬。研究者直言：若這些經理<strong>提高組合集中度</strong>、只持有他們最看好的標的，投資人反而會獲益更多。這強烈說明過度分散（持有太多股票）其實拉低了整體報酬/風險比。</li><li><strong>主動型基金的「隱形指數化」問題</strong>：另一項發表於《金融研究評論》（Review of Financial Studies）的研究引入了“Active Share”指標來衡量基金投資組合和基準指數的差異程度。結果顯示，<strong>Active Share最高</strong>（也就是持股最與指數不同、最集中）的那群主動型基金，顯著<strong>跑贏</strong>了市場基準；而那些<strong>Active Share最低</strong>（持股幾乎就是大雜燴指數的基金）不但沒有帶來超額收益，<strong>反而落後基準</strong> (<a href="https://ideas.repec.org/a/oup/rfinst/v22y2009i9p3329-3365.html#:~:text=Active%20Share%20predicts%20fund%20performance%3A,Published%20by%20Oxford" target="_blank" rel="noopener">How Active Is Your Fund Manager? A New Measure That Predicts Performance</a>)。換句話說，<strong>過度分散導致基金表現平庸甚至不佳</strong>。研究指出，最高組合差異的基金在扣除費用後每年仍高出基準2.5%～3.8%的報酬，而「過度分散」的基金則<strong>顯著輸給市場</strong>。這充分證明了當投資組合過度分散在相同類型資產時，<strong>報酬被削弱</strong>，而風險卻沒有成比例下降，導致<strong>報酬/風險比趨近於零</strong>的結果。投資領域甚至有個諷刺的說法稱這種現象為“Diworsification”（越分散越糟）<strong>。當你的投資組合變得和大盤沒兩樣時，你實質上失去了Alpha，但仍承擔著市場風險，</strong>用高昂的風險去換取幾乎為零的超額報酬。</li></ul>



<p>總結來說，如果一個投資組合<strong>持有過多同質的Alpha股票</strong>，那麼隨著持股數量的增加：<strong>(1)</strong> 可分散的風險很快被消除殆盡，只剩下系統性風險無法化解；<strong>(2)</strong> 超額報酬卻被愈來愈多的低Alpha成分攤薄，漸漸趨近於零。結果，<strong>報酬與風險的比值大幅下降</strong>，甚至接近<strong>無效投資</strong>（冒風險卻沒有額外報酬）的狀態。正如一項南非市場研究所說：「只需持有10～15檔股票即可達到高度分散，<strong>再增加股票，風險降低已經微乎其微</strong>」 (<a href="https://www.mdpi.com/1911-8074/14/11/551#:~:text=Irala%20and%20Patil%20%20,10%E2%80%9315%20stocks" target="_blank" rel="noopener">How Many Stocks Are Sufficient for Equity Portfolio Diversification? A Review of the Literature</a>)。過度分散只是在做無用功，反而可能讓我們失去原本的優勢。</p>



<h2>最優策略：集中優勢，搭配多元類型 Alpha</h2>



<p>既然過度分散會稀釋Alpha，那麼極端集中是否就是良方？只買一支股票當然風險過高，這走向另一個極端也不可取。真正聰明的策略是：<strong>在每一種Alpha策略內部要精挑細選、適度集中持股</strong>，但在整體組合層面上<strong>結合多種不同類型的Alpha策略</strong>，達到「<strong>大處分散、小處集中</strong>」的平衡。換句話說，<strong>把雞蛋放在不同的籃子裡，但每個籃子裡都只裝最優質的雞蛋</strong>。這樣一來，每個籃子（每種策略）本身帶來高報酬/風險比，而不同籃子之間的風險又彼此分散。</p>



<p>在學術上，這個思路可以用被稱為<strong>「主動管理基本法則」</strong>（Fundamental Law of Active Management）的公式來闡明。該法則由Grinold於1989年提出，指出一個主動投資組合的訊息比（Information Ratio，衡量超額報酬對超額風險的比率）可以表示為：</p>



<p><img src="https://s0.wp.com/latex.php?latex=IR+%3D+IC+%5Ctimes+%5Csqrt%7BBR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IR = IC &#092;times &#092;sqrt{BR} " class="latex" title="分散風險的迷思？當心「攤薄」效應！ 68"></p>



<p>其中，<img src="https://s0.wp.com/latex.php?latex=IC&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IC" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 69">（Information Coefficient）代表投資經理的<strong>選股技能</strong>（對超額報酬的預測精度），而<img src="https://s0.wp.com/latex.php?latex=BR&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="BR" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 70">（Breadth）則代表<strong>獨立投資機會的數量</strong> (<a href="https://joim.com/wp-content/uploads/emember/downloads/p0543.pdf#:~:text=IR%20%3D%20IC%E2%88%9A%20BR,Grinold%20and%20Kahn" target="_blank" rel="noopener">P0543</a>)。通俗地說，如果你有很多彼此<strong>獨立</strong>的Alpha來源，而且每一個來源你都頗有把握（IC高），那整體表現就會相當亮眼。值得注意的是，這裡強調的是<strong>「獨立」</strong>的機會數。如果你的多個投注其實<strong>不獨立</strong>（例如都押在同一類型股票上），那麼有效的<img src="https://s0.wp.com/latex.php?latex=BR&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="BR" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 70">並沒有增加多少，<img src="https://s0.wp.com/latex.php?latex=IR&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IR" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 72">也不會顯著提高 (<a href="https://joim.com/wp-content/uploads/emember/downloads/p0543.pdf#:~:text=IR%20%3D%20IC%E2%88%9A%20BR,Grinold%20and%20Kahn" target="_blank" rel="noopener">P0543</a>)。相反地，如果你將資金分散在<strong>數個相關性低、互相獨立的策略</strong>上，每新增一個<strong>不同</strong>的Alpha來源，就如同增加了一個新的獨立押注，可以大幅提升整體的風險調整後報酬。從公式上看，若每個策略的預測能力<img src="https://s0.wp.com/latex.php?latex=IC&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IC" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 69">相近，將兩種獨立策略結合，<img src="https://s0.wp.com/latex.php?latex=IR&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IR" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 72">約提升<img src="https://s0.wp.com/latex.php?latex=%5Csqrt%7B2%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sqrt{2}" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 75">倍；結合四種獨立策略，<img src="https://s0.wp.com/latex.php?latex=IR&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="IR" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 72">則約提升<img src="https://s0.wp.com/latex.php?latex=%5Csqrt%7B4%7D%3D2&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#092;sqrt{4}=2" class="latex" title="分散風險的迷思？當心「攤薄」效應！ 77">倍 (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=Grinold%E2%80%99s%20,diversified%20portfolio%20seem%20to%20behave" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)。這不是天方夜譚——金融界實證也發現了類似的結果。</p>



<p>AQR資產管理公司的一項研究將<strong>幾個彼此相關性極低的策略</strong>組合在一起（例如<strong>動能</strong>、<strong>價值</strong>、<strong>趨勢追蹤</strong>、<strong>套利</strong>等不同類型的Alpha策略），結果發現：<strong>組合的夏普比率幾乎是單一策略的兩倍</strong> (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=Grinold%E2%80%99s%20,diversified%20portfolio%20seem%20to%20behave" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)！具體而言，他們發現結合五個不同因子的多元策略組合，其夏普比率約1.4，遠高於單獨持有某一資產類別時的0.7左右 (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=the%20portfolio%20Sharpe%20ratio%20increases,we%20are%20in%20the%20right" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)。這相當於<strong>有效擁有了四個彼此獨立的投資</strong>所得到的效果 (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=the%20portfolio%20Sharpe%20ratio%20increases,we%20are%20in%20the%20right" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)。原因在於，不同類型Alpha之間的相關性低，當一類策略短期失靈時，另一類策略可能依然奏效，<strong>彼此風險可以互相抵消</strong>，卻各自提供超額報酬來源。正如前面提到的公式所示，<strong>把多種獨立Alpha結合</strong>，就好比增加了投注次數，透過<strong>平方根效應</strong>成倍提升整體的報酬/風險比。這個策略在學術上有時被稱為<strong>“多元阿爾法”</strong>或<strong>“Alpha疊加”</strong>策略，即將來自不同市場或因子的阿爾法來源放在一起。金融分析師期刊上也多次討論過類似概念，例如強調<strong>同時配置多種風格因子</strong>（價值、成長、規模、動能等）可降低組合波動並提高夏普比率 (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=Grinold%E2%80%99s%20,diversified%20portfolio%20seem%20to%20behave" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)。事實證明，「不要把雞蛋放同個籃子」的箴言在這裡要進一步細化為：「<strong>不要把雞蛋都放在同一種類型的籃子</strong>裡，但<strong>也不要在每個籃子裡裝太多雞蛋</strong>。」</p>



<h2>結語：聰明的分散，才能兼顧收益與風險</h2>



<p>綜合以上研究與證明，我們可以明確地說：<strong>分散投資並非越多越好</strong>。當投資組合<strong>過度分散在同一類型的Alpha股票</strong>上時，我們所得到的，只是一個和市場表現差不多的組合，却承擔著近似市場的風險，導致[<strong>報酬/風險比趨近於零</strong>](<a href="https://ideas.repec.org/a/oup/rfinst/v22y2009i9p3329-3365.html#:~:text=Active%20Share%20predicts%20fund%20performance%3A,Published%20by%20Oxford" target="_blank" rel="noopener">How Active Is Your Fund Manager? A New Measure That Predicts Performance</a>)。這種情況下，我們幾乎等同於在做無謂的冒險——因為承擔了波動，卻沒有獲得相應的超額收益回報。正如研究者戲稱的那樣，這樣的過度分散就是「<strong>資產配置變成了資產折磨</strong>」，徒有分散之名，卻無分散之實。</p>



<p>反之，<strong>最優的策略</strong>是在不同類型的Alpha之間取得<strong>平衡的多樣性</strong>。透過<strong>精簡每種Alpha策略內的持股數</strong>（只挑選最有信心的標的），我們確保每個策略都能貢獻可觀的超額報酬；再透過<strong>結合多種彼此相關性低的Alpha策略</strong>，我們讓整體組合的風險大幅降低而報酬保持高水準。這就是所謂「<strong>在集中中求分散，在分散中求集中</strong>」的藝術。實證結果一再支持此觀點：基金經理應當<strong>專注於自己的最佳想法</strong> 、投資人應當挑選<strong>高主動性且多元化策略配置</strong>的基金 (<a href="https://ideas.repec.org/a/oup/rfinst/v22y2009i9p3329-3365.html#:~:text=Active%20Share%20predicts%20fund%20performance%3A,Published%20by%20Oxford" target="_blank" rel="noopener">How Active Is Your Fund Manager? A New Measure That Predicts Performance</a>)。透過多元Alpha的配置，我們可以同時「享受蛋糕又吃蛋糕」——既獲得<strong>多樣化降低風險</strong>的好處，又保有<strong>豐厚超額收益</strong>的潛力。</p>



<p>總而言之，打造一個<strong>高報酬/風險比</strong>的投資組合的祕訣，在於<strong>聰明的分散</strong>：避免過度分散在同質的標的上，而要追求<strong>來源多元</strong>但各自精選的Alpha組合。正如老高講故事般的風格，我們最後用一句話來總結這個耐人尋味的道理：<strong>「分散」不是簡單地什麼都買一點，而是要懂得選擇地分散、策略地分散</strong>。唯有如此，你才能在市場中同時捕獲收益與控制風險，讓你的投資組合既美味又營養，真正做到立於不敗之地。 (<a href="https://www.mdpi.com/1911-8074/14/11/551#:~:text=required%20to%20eliminate%2095,the%20number%20of%20stocks%20required" target="_blank" rel="noopener">How Many Stocks Are Sufficient for Equity Portfolio Diversification? A Review of the Literature</a>) (<a href="https://www.aqr.com/-/media/AQR/Documents/Journal-Articles/JPM-The-Death-of-Diversification-Greatly-Exaggerated.pdf#:~:text=Grinold%E2%80%99s%20,diversified%20portfolio%20seem%20to%20behave" target="_blank" rel="noopener">JPM-ILMANEN.indd</a>)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/risk-of-diversification/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6444</post-id>	</item>
		<item>
		<title>只要 3 個財報指標，報酬率高得驚人</title>
		<link>https://www.finlab.tw/fundamental-3-indicators/</link>
					<comments>https://www.finlab.tw/fundamental-3-indicators/#respond</comments>
		
		<dc:creator><![CDATA[FinLab - 韓承佑]]></dc:creator>
		<pubDate>Sun, 16 Feb 2025 12:00:00 +0000</pubDate>
				<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[基本面分析]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[如何買股票]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[量化投資]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6433</guid>

					<description><![CDATA[只需要財報，就能達到歷史每年 60% 的選股策略！別再說財報不重要了，只是你不會看而已！ 1. 策略的核心邏輯 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>只需要財報，就能達到歷史每年 60% 的選股策略！別再說財報不重要了，只是你不會看而已！</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="938" src="https://www.finlab.tw/wp-content/uploads/2025/02/image-4-1024x938.png" alt="image 4" class="wp-image-6438" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/image-4-1024x938.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/image-4-300x275.png 300w, https://www.finlab.tw/wp-content/uploads/2025/02/image-4-768x704.png 768w, https://www.finlab.tw/wp-content/uploads/2025/02/image-4-1536x1407.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/02/image-4.png 1548w" sizes="(max-width: 1024px) 100vw, 1024px" title="只要 3 個財報指標，報酬率高得驚人 78"></figure>



<h2>1. 策略的核心邏輯分析</h2>



<p><strong>選股策略概述：本策略運用量化篩選，著重挑選具高研發投入且財務穩健</strong>的股票。核心理念是，持續投入研發的公司往往具備創新能力和長期競爭優勢，股價表現可能優於同業 (<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=%E5%8F%B0%E7%81%A3%E4%B9%8B%E5%85%89%E5%8F%B0%E7%A9%8D%E9%9B%BB%20%28TSM%29%E6%98%AF%E5%8F%A6%E4%B8%80%E5%80%8B%E7%B6%93%E5%85%B8%E7%9A%84%E4%BE%8B%E5%AD%90%EF%BC%8C%E4%B8%8D%E6%96%B7%E6%8A%95%E5%85%A5%E7%9A%84%E7%A0%94%E7%99%BC%E8%B2%BB%E7%94%A8%E5%92%8C%E8%B3%87%E6%9C%AC%E6%94%AF%E5%87%BA%E6%9C%80%E7%B5%82%E6%8B%89%E9%96%8B%E8%88%87%E7%AB%B6%E7%88%AD%E8%80%85%E7%9A%84%E5%B7%AE%E8%B7%9D%EF%BC%8C%E7%8F%BE%E5%9C%A8%E9%AB%98%E9%9A%8E%E8%A3%BD%E7%A8%8B%E5%9C%A8%E5%B0%8D%E6%89%8B%E7%9C%8B%E4%B8%8D%E5%88%B0%E8%BB%8A%E5%B0%BE%E7%87%88%E7%9A%84%E6%83%85%E6%B3%81%E4%B8%8B%EF%BC%8C%E9%82%84%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%AF%9B%E5%88%A950">研發費用率選股策略 &#8211; FinLab</a>) (<a href="https://quantpedia.com/strategies/rd-expenditures-and-stock-returns/#:~:text=earnings%20or%20price,average%20returns%20in%20the%20future" target="_blank" rel="noopener">R&amp;D Expenditures and Stock Returns &#8211; QuantPedia</a>)。同時，透過財務指標確保公司體質良好，以降低風險。策略的主要選股條件包括 (<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=,%2A%20%E7%87%9F%E6%A5%AD%E7%8F%BE%E9%87%91%E6%B5%81%E5%A4%A7%E6%96%BC0%EF%BC%8C%E6%8E%92%E9%99%A4%E4%B8%80%E7%9B%B4%E7%87%92%E9%8C%A2%E7%9A%84%E5%8D%B1%E9%9A%AA%E9%AB%94%E8%B3%AA%E4%BC%81%E6%A5%AD%EF%BC%8Ceps%E7%82%BA%E8%B2%A0%E6%95%B8%EF%BC%8C%E8%87%B3%E5%B0%91%E8%A6%81%E6%9C%89%E7%8F%BE%E9%87%91%E6%B4%BB%E6%B0%B4%E4%BE%86%E6%94%AF%E6%92%90%E3%80%82%20%2A%20%E6%AF%8F%E5%AD%A3%E6%8F%9B%E8%82%A1">研發費用率選股策略 &#8211; FinLab</a>)：</p>



<ul><li><strong>研發投入比重</strong>：研發費用率位居市場前段（水準前10%）。亦即，公司研發費用占營收的比例很高，顯示對<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=,%2A%20%E7%87%9F%E6%A5%AD%E7%8F%BE%E9%87%91%E6%B5%81%E5%A4%A7%E6%96%BC0%EF%BC%8C%E6%8E%92%E9%99%A4%E4%B8%80%E7%9B%B4%E7%87%92%E9%8C%A2%E7%9A%84%E5%8D%B1%E9%9A%AA%E9%AB%94%E8%B3%AA%E4%BC%81%E6%A5%AD%EF%BC%8Ceps%E7%82%BA%E8%B2%A0%E6%95%B8%EF%BC%8C%E8%87%B3%E5%B0%91%E8%A6%81%E6%9C%89%E7%8F%BE%E9%87%91%E6%B4%BB%E6%B0%B4%E4%BE%86%E6%94%AF%E6%92%90%E3%80%82%20%2A%20%E6%AF%8F%E5%AD%A3%E6%8F%9B%E8%82%A1">創新研發的重視</a>。這通常意味著公司在技術和產品上具備成長潛力，市場往往低估這類投入帶來的未來機會 (<a href="https://quantpedia.com/strategies/rd-expenditures-and-stock-returns/#:~:text=earnings%20or%20price,average%20returns%20in%20the%20future" target="_blank" rel="noopener">R&amp;D Expenditures and Stock Returns &#8211; QuantPedia</a>)。例如台積電等不斷大手筆研發的企業，其研發實力與股價表現息息相關。</li><li><strong>費用結構優化</strong>：研發費用相對於管理費用較高。透過比較研發費用率與管理費用率的比值，篩選將資源更多投入研發、而非行政開支的公司。這指標反映公司資源配置傾向：高比值表示公司<strong>研發投入遠高於一般管理費用</strong>，重視創新勝於日常行政開支。<a href="https://colab.ws/articles/10.1111%2F1911-3846.12634#:~:text=valuation%20implications,control%20firms%2C%20and%20investors%20positively" target="_blank" rel="noopener">研究顯示</a>，投資人對此傾向持正面態度，偏好研發高、管銷費用精實的公司。</li><li><strong>財務穩健度</strong>：要求淨值除以總資產比率（股東權益比率）達一定水準，確保公司資本結構穩健不過度舉債。股東權益比率（淨資產比率）高，代表資產主要由<a href="https://rstock.com.tw/%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E4%BB%80%E9%BA%BC#:~:text=%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E4%BB%A3%E8%A1%A8%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E5%8D%A0%E7%B8%BD%E8%B3%87%E7%94%A2%E7%9A%84%E6%AF%94%E4%BE%8B%EF%BC%8C%E5%8F%8D%E6%98%A0%E4%BA%86%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E7%B5%90%E6%A7%8B%E5%92%8C%E7%A9%A9%E5%81%A5%E7%A8%8B%E5%BA%A6%E3%80%82%E4%BC%81%E6%A5%AD%E7%9A%84%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%87%89%E4%BF%9D%E6%8C%81%E9%81%A9%E4%B8%AD%EF%BC%8C%E9%81%8E%E4%BD%8E%E5%89%87%E8%A1%A8%E7%A4%BA%E8%B2%A0%E5%82%B5%E6%AF%94%E4%BE%8B%E9%81%8E%E9%AB%98%EF%BC%8C%E5%AE%B9%E6%98%93%E5%8F%97%E5%88%B0%E5%A4%96%E9%83%A8%E8%A1%9D%E6%93%8A%EF%BC%8C%E8%80%8C%E9%81%8E%E9%AB%98%E5%89%87%E5%8F%AF%E8%83%BD%E6%84%8F%E5%91%B3%20%E8%91%97%E4%BC%81%E6%A5%AD%E9%8C%AF%E5%A4%B1%E4%BA%86%E5%88%A9%E7%94%A8%E8%B2%A1%E5%8B%99%E6%A7%93%E6%A1%BF%E6%93%B4%E5%A4%A7%E7%B6%93%E7%87%9F%E8%A6%8F%E6%A8%A1%E7%9A%84%E6%A9%9F%E6%9C%83%E3%80%82%E4%BA%86%E8%A7%A3%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E5%8F%AF%E4%BB%A5%E5%B9%AB%E5%8A%A9%E6%8A%95%E8%B3%87%E8%80%85%E8%A9%95%E4%BC%B0%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E9%A2%A8%E9%9A%AA%EF%BC%8C%E5%90%8C%E6%99%82%E4%B9%9F%E7%82%BA%E4%BC%81%E6%A5%AD%E7%AE%A1%E7%90%86%E8%80%85%E6%8F%90%E4%BE%9B%E5%88%B6%E5%AE%9A%E8%B2%A1%E5%8B%99%E7%AD%96%E7%95%A5%E7%9A%84%E5%8F%83%E8%80%83%E3%80%82" target="_blank" rel="noopener">股東權益比率</a>支撐，負債相對較低，財務風險也較小。比率過低則表示槓桿高，遇到<a href="https://rstock.com.tw/%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E4%BB%80%E9%BA%BC#:~:text=%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E4%BB%A3%E8%A1%A8%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E5%8D%A0%E7%B8%BD%E8%B3%87%E7%94%A2%E7%9A%84%E6%AF%94%E4%BE%8B%EF%BC%8C%E5%8F%8D%E6%98%A0%E4%BA%86%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E7%B5%90%E6%A7%8B%E5%92%8C%E7%A9%A9%E5%81%A5%E7%A8%8B%E5%BA%A6%E3%80%82%E4%BC%81%E6%A5%AD%E7%9A%84%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%87%89%E4%BF%9D%E6%8C%81%E9%81%A9%E4%B8%AD%EF%BC%8C%E9%81%8E%E4%BD%8E%E5%89%87%E8%A1%A8%E7%A4%BA%E8%B2%A0%E5%82%B5%E6%AF%94%E4%BE%8B%E9%81%8E%E9%AB%98%EF%BC%8C%E5%AE%B9%E6%98%93%E5%8F%97%E5%88%B0%E5%A4%96%E9%83%A8%E8%A1%9D%E6%93%8A%EF%BC%8C%E8%80%8C%E9%81%8E%E9%AB%98%E5%89%87%E5%8F%AF%E8%83%BD%E6%84%8F%E5%91%B3%20%E8%91%97%E4%BC%81%E6%A5%AD%E9%8C%AF%E5%A4%B1%E4%BA%86%E5%88%A9%E7%94%A8%E8%B2%A1%E5%8B%99%E6%A7%93%E6%A1%BF%E6%93%B4%E5%A4%A7%E7%B6%93%E7%87%9F%E8%A6%8F%E6%A8%A1%E7%9A%84%E6%A9%9F%E6%9C%83%E3%80%82%E4%BA%86%E8%A7%A3%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E5%8F%AF%E4%BB%A5%E5%B9%AB%E5%8A%A9%E6%8A%95%E8%B3%87%E8%80%85%E8%A9%95%E4%BC%B0%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E9%A2%A8%E9%9A%AA%EF%BC%8C%E5%90%8C%E6%99%82%E4%B9%9F%E7%82%BA%E4%BC%81%E6%A5%AD%E7%AE%A1%E7%90%86%E8%80%85%E6%8F%90%E4%BE%9B%E5%88%B6%E5%AE%9A%E8%B2%A1%E5%8B%99%E7%AD%96%E7%95%A5%E7%9A%84%E5%8F%83%E8%80%83%E3%80%82" target="_blank" rel="noopener">景氣逆風時容易出現財務危機</a>。因此策略傾向選擇權益比率適中偏高的企業，避開高負債的公司，以降低因財務槓桿過高導致股價暴跌的風險。</li><li><strong>價格與交易量條件</strong>：為確保流動性與交易可行性，策略對股價和成交量也設置了篩選標準。通常會剔除低價股（如股價過低的「仙股」）並要求日均成交量達一定門檻，以避免流動性不足造成的交易困難。實務上常見的做法如：僅選取股價高於5或10元的股票，及平均日成交量超過某數量（例如100萬股）以上的股票 (<a href="https://www.finlab.tw/%E9%87%8F%E5%8C%96%E4%BA%A4%E6%98%93%E5%AE%8C%E6%95%B4%E6%8C%87%E5%8D%97%EF%BC%9A%E7%AD%96%E7%95%A5%E3%80%81%E5%AF%A6%E6%96%BD%E8%88%87%E9%A2%A8%E9%9A%AA%E7%AE%A1%E7%90%86/#:~:text=,%E3%80%82%20%2A%20%E6%A2%9D%E4%BB%B64%EF%BC%9A%E6%B5%81%E5%8B%95%E6%80%A7%E5%85%85%E8%B6%B3%E7%9A%84%E8%82%A1%E7%A5%A8%EF%BC%88%E6%88%90%E4%BA%A4%E9%87%8F%E8%B6%85%E9%81%8E100%E8%90%AC%E8%82%A1%EF%BC%89%E3%80%82">量化交易完整指南：策略、實施與風險管理 &#8211; FinLab</a>)。這可確保選中的股票買賣方便，不會因成交稀少而影響策略執行。</li></ul>



<p><strong>指標計算方式</strong>：上述篩選條件涉及的財務指標計算如下：</p>



<ul><li><em>研發費用率</em>＝研發費用 / 營業收入。<ul><li>該比率越高，代表企業從營收中撥出越多比例投入研發 (<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=%E7%A0%94%E7%99%BC%E8%B2%BB%E7%94%A8%E7%8E%87">研發費用率選股策略 &#8211; FinLab</a>)。例如研發費用率10%表示每100元收入有10元用於研發。</li></ul></li><li><em>管理費用率</em>＝管理費用 / 營業收入。<ul><li>此比率反映公司在行政管理上耗費的資源比例，可以參考：<a href="https://statementdog.com/blog/archives/10207#:~:text=%E8%B2%A1%E5%A0%B1%E7%8B%97%E9%80%9A%E5%B8%B8%E6%9C%83%E6%8B%BF%E4%BE%86%E5%92%8C%E7%87%9F%E6%94%B6%E6%AF%94%E8%BC%83%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%A8%88%E7%AE%97%E8%B2%BB%E7%94%A8%E7%8E%87%EF%BC%9A%201,%E7%8E%87%20%3D%E7%A0%94%E7%99%BC%20%E8%B2%BB%E7%94%A8%2F%E7%87%9F%E6%A5%AD%E6%94%B6%E5%85%A5%20x%20100" target="_blank" rel="noopener">新增數據 &#8211; 營業費用率拆解 了解獲利改善原因</a>。</li></ul></li><li><em>研發費用率與管理費用率的比值</em>＝研發費用率 ÷ 管理費用率。<ul><li>此值大於1表示研發投入比管理支出高出平均，比值越大說明公司相對更偏重研發。</li></ul></li><li><em><a href="https://rstock.com.tw/%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E4%BB%80%E9%BA%BC#:~:text=%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E4%BB%A3%E8%A1%A8%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E5%8D%A0%E7%B8%BD%E8%B3%87%E7%94%A2%E7%9A%84%E6%AF%94%E4%BE%8B%EF%BC%8C%E5%8F%8D%E6%98%A0%E4%BA%86%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E7%B5%90%E6%A7%8B%E5%92%8C%E7%A9%A9%E5%81%A5%E7%A8%8B%E5%BA%A6%E3%80%82%E4%BC%81%E6%A5%AD%E7%9A%84%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%87%89%E4%BF%9D%E6%8C%81%E9%81%A9%E4%B8%AD%EF%BC%8C%E9%81%8E%E4%BD%8E%E5%89%87%E8%A1%A8%E7%A4%BA%E8%B2%A0%E5%82%B5%E6%AF%94%E4%BE%8B%E9%81%8E%E9%AB%98%EF%BC%8C%E5%AE%B9%E6%98%93%E5%8F%97%E5%88%B0%E5%A4%96%E9%83%A8%E8%A1%9D%E6%93%8A%EF%BC%8C%E8%80%8C%E9%81%8E%E9%AB%98%E5%89%87%E5%8F%AF%E8%83%BD%E6%84%8F%E5%91%B3%20%E8%91%97%E4%BC%81%E6%A5%AD%E9%8C%AF%E5%A4%B1%E4%BA%86%E5%88%A9%E7%94%A8%E8%B2%A1%E5%8B%99%E6%A7%93%E6%A1%BF%E6%93%B4%E5%A4%A7%E7%B6%93%E7%87%9F%E8%A6%8F%E6%A8%A1%E7%9A%84%E6%A9%9F%E6%9C%83%E3%80%82%E4%BA%86%E8%A7%A3%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E5%8F%AF%E4%BB%A5%E5%B9%AB%E5%8A%A9%E6%8A%95%E8%B3%87%E8%80%85%E8%A9%95%E4%BC%B0%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E9%A2%A8%E9%9A%AA%EF%BC%8C%E5%90%8C%E6%99%82%E4%B9%9F%E7%82%BA%E4%BC%81%E6%A5%AD%E7%AE%A1%E7%90%86%E8%80%85%E6%8F%90%E4%BE%9B%E5%88%B6%E5%AE%9A%E8%B2%A1%E5%8B%99%E7%AD%96%E7%95%A5%E7%9A%84%E5%8F%83%E8%80%83%E3%80%82" target="_blank" rel="noopener">股東權益比率</a></em>＝股東權益（淨值）/ 總資產。<ul><li>以百分比表示企業資產中有多少是股東自有資本投入。</li></ul></li><li>其他如營運現金流為正、成交量門檻等，計算較直接：營運現金流取自現金流量表，成交量取日均成交股數或金額進行比較篩選。</li></ul>



<p>綜上，本策略透過<strong>基本面因子（研發投入與財務結構）結合適度的交易條件</strong>來選股。在實際實施中，每季定期根據上述條件篩選並調整持股組合。策略期待藉由選出<strong>研發創新能力強且財務體質良好</strong>的公司，在長期獲得超越大盤的表現。</p>



<h2>2. 相關財務指標的解釋與應用</h2>



<p>本策略的程式如下：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab import backtest
from finlab import data

close = data.get('price:收盤價')
volume = data.get('price:成交股數')

rd_ratio = data.get('fundamental_features:研究發展費用率')
pm_ratio = data.get('fundamental_features:管理費用率')
eq_ratio = data.get('fundamental_features:淨值除資產').deadline()

rd_pm = rd_ratio / pm_ratio
eq_price = eq_ratio / close.reindex(eq_ratio.index, method='ffill')

rebalance = eq_price.index

position = eq_price[(
    (close &gt; close.average(60))
    &amp; (volume &gt; 200_000)
    &amp; (volume.average(10) &gt; volume.average(60))
    &amp; (rd_pm.deadline().rank(axis=1, pct=True) &gt; 0.5)
).reindex(rebalance)].is_largest(20)

rebalance = eq_ratio.index

r = backtest.sim(position.loc['2020':], resample=rebalance)</code></pre>



<p>運用了多項財務指標作為選股依據，以下對關鍵指標的涵義和應用進行說明：</p>



<h3>研發費用率與管理費用率的比值</h3>



<p><strong>研發費用率（R&amp;D費用率）</strong>：衡量公司營收中投入研發的比例，其公式為：研發費用 ÷ 營業收入 (<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=%E7%A0%94%E7%99%BC%E8%B2%BB%E7%94%A8%E7%8E%87">研發費用率選股策略 &#8211; FinLab</a>)。研發費用率高，表示公司將較大部分收入再次投入研發活動，用於產品技術創新。這常見於科技、生技等領域的公司，代表其重視未來成長。需要注意的是，研發費用率應與營收成長結合解讀：理想狀況是研發費用隨營收同步提升，保持一定比例；若營收下滑但仍高比例投入研發，可能意味公司暫時犧牲短期獲利來保障未來競爭力。過高的研發費用率（例如超過營收的比例）則是警訊，意味公司研發支出過度，財務恐難長期支撐。</p>



<p><strong>管理費用率（一般&amp;行政費用率）</strong>：衡量公司營收中花在行政管理方面的比例，其計算為：<strong>管理費用 ÷ 營業收入</strong>。管理費用包括管理人員薪酬、日常營運行政開支等。管理費用率高，代表公司在日常營運和管理上成本較重；適度的管理費用有助維持組織運作，但過高可能表示資源沒有效率地投入生產或研發，而是耗散在行政層面。因此管理費用率偏高通常不利於利潤成長，投資人傾向看到該比率隨規模擴大而下降，以展現經營效率提升。</p>



<p><strong>研發費用率與管理費用率的比值</strong>：這一指標將上述兩者相對比較，通常可簡化近似為研發費用 ÷ 管理費用（因兩者同以營收為分母）。此比值反映公司將營業費用預算中多少比例投入研發，而非花在行政管理上 (<a href="https://www.finlab.tw/research_expense_ratio_strategy/#:~:text=%E7%AE%97%E6%B3%95%3A%E7%A0%94%E7%A9%B6%E7%99%BC%E5%B1%95%E8%B2%BB%20%2F%20%E7%87%9F%E6%A5%AD%E8%B2%BB%E7%94%A8%20%E7%87%9F%E6%A5%AD%E8%B2%BB%E7%94%A8%E7%94%B1%20%E7%A0%94%E7%A9%B6%E7%99%BC%E5%B1%95%E8%B2%BB%E3%80%81%E9%8A%B7%E5%94%AE%E8%B2%BB%E7%94%A8%E3%80%81%E7%AE%A1%E7%90%86%E8%B2%BB%E7%94%A8,%E6%89%80%E7%B5%84%E6%88%90%EF%BC%8C%E7%A0%94%E7%99%BC%E8%B2%BB%E7%94%A8%E4%BD%94%E7%87%9F%E6%A5%AD%E8%B2%BB%E7%94%A8%E6%AF%94%E5%8F%AF%E7%9C%8B%E5%87%BA%E4%B8%80%E5%AE%B6%E4%BC%81%E6%A5%AD%E9%A1%98%E6%84%8F%E5%9C%A8%E7%87%9F%E6%A5%AD%E8%B2%BB%E7%94%A8%E9%A0%90%E7%AE%97%E4%B8%8B%E6%8B%BF%E5%87%BA%E5%A4%9A%E5%B0%91%E6%AF%94%E4%BE%8B%E6%8A%95%E5%85%A5%E7%A0%94%E7%99%BC%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E8%8A%B1%E5%88%B0%E5%88%A5%E9%A0%85%E5%A6%82%E5%8C%85%E8%A3%9D%E8%B2%BB%E3%80%81%E9%81%8B%E8%BC%B8%E8%B2%BB%E3%80%81">研發費用率選股策略 &#8211; FinLab</a>)。<strong>比值&gt;1</strong>表示研發投入額高於管理費用，數值越大說明公司將<strong>更多資源傾斜於研發</strong>而非日常管銷。高研發/管理比值的公司，一般而言更具創新導向和成長企圖心，而非官僚機構。對此指標的應用，本策略偏好比值高的公司，以篩選「<strong>研發驅動型</strong>」企業。背後原理在於：市場研究發現，當公司刻意壓低一般管銷費用、保持精實運作，同時維持對研發的高投入時，投資人往往給予正面評價 。因削減不必要的管銷開支被視為效率提升，而研發支出維持則被視為對未來成長的承諾 (<a href="https://colab.ws/articles/10.1111%2F1911-3846.12634#:~:text=valuation%20implications,control%20firms%2C%20and%20investors%20positively" target="_blank" rel="noopener">The Differential Role of R&amp;D and SG &amp;A for Earnings Management and Stock Price Manipulation* | CoLab</a>)。因此，比值高常被解讀為管理層專注長遠發展的跡象。在選股時，此指標可協助找出那些<strong>肯投入未來、控制現在</strong>的公司。有了研發/管理費用比的篩選，可剔除研發投入不足或管銷膨脹的企業，使投資組合更聚焦於具有創新精神的標的。不過需注意，不同行業該比值的典型水準差異很大，例如品牌消費品產業可能管銷費用高（市場行銷開支大），研發相對少，而科技業研發多、管理費用相對小。因此在應用時，可將公司與其產業平均水準做對比，確認其研發投入是否<strong>相對突出</strong>。</p>



<h3>淨值除資產（股東權益比率）</h3>



<p><strong>定義：淨值除以總資產即股東權益比率</strong>（Equity Ratio），公式為：<strong>股東權益 ÷ 總資產 ×100%</strong>。此指標反映企業資產中有多少比例是由股東出資（或留存盈餘）構成，換言之，有多少資產是靠公司自有資本支撐，而非透過負債取得。例如股東權益比率50%表示公司資產的一半是股東投入，另一半來自銀行貸款等負債。</p>



<p>意義：股東權益比率揭示公司的財務結構穩健程度。比率高（如60%以上）通常表示公司債務佔比較低，財務槓桿小，償債能力強，抗風險能力較佳 (<a href="https://rstock.com.tw/%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E4%BB%80%E9%BA%BC#:~:text=%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E8%A1%A1%E9%87%8F%E4%BC%81%E6%A5%AD%E8%B2%A1%E5%8B%99%E7%B5%90%E6%A7%8B%E7%9A%84%E9%87%8D%E8%A6%81%E6%8C%87%E6%A8%99%EF%BC%8C%E5%AE%83%E5%8F%8D%E6%98%A0%E4%BA%86%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E9%A2%A8%E9%9A%AA%E5%92%8C%E7%A9%A9%E5%AE%9A%E6%80%A7%E3%80%82%E7%B0%A1%E5%96%AE%E4%BE%86%E8%AA%AA%EF%BC%8C%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E6%98%AF%E6%8C%87%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E5%8D%A0%E7%B8%BD%E8%B3%87%E7%94%A2%E7%9A%84%E6%AF%94%E4%BE%8B%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AA%AA%EF%BC%8C%E4%BC%81%E6%A5%AD%E6%9C%89%E5%A4%9A%E5%B0%91%E8%B3%87%E7%94%A2%E6%98%AF%E7%94%B1%E8%82%A1%E6%9D%B1%E7%9A%84%E6%8A%95%20%E8%B3%87%E4%BE%86%E6%94%AF%E6%92%91%E7%9A%84%EF%BC%8C%E8%80%8C%E6%9C%89%E5%A4%9A%E5%B0%91%E8%B3%87%E7%94%A2%E6%98%AF%E7%94%B1%E5%80%9F%E6%AC%BE%E6%88%96%E5%85%B6%E4%BB%96%E5%82%B5%E5%8B%99%E4%BE%86%E6%94%AF%E6%92%91%E7%9A%84%E3%80%82%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E8%B6%8A%E9%AB%98%EF%BC%8C%E8%A1%A8%E7%A4%BA%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A1%E5%8B%99%E7%B5%90%E6%A7%8B%E8%B6%8A%E7%A9%A9%E5%81%A5%EF%BC%8C%E5%B0%8D%E5%82%B5%E6%AC%8A%E4%BA%BA%E6%9B%B4%E5%85%B7%E5%90%B8%E5%BC%95%E5%8A%9B%EF%BC%8C%E4%B9%9F%E6%9B%B4%E5%AE%B9%E6%98%93%E7%8D%B2%E5%BE%97%E8%B3%87%E9%87%91%E3%80%82%E5%8F%8D%E4%B9%8B%EF%BC%8C%E8%82%A1%E6%9D%B1%E6%AC%8A%E7%9B%8A%E6%AF%94%E7%8E%87%E8%B6%8A%E4%BD%8E%EF%BC%8C%E8%A1%A8%20%E7%A4%BA%E4%BC%81%E6%A5%AD%E7%9A%84%E8%B2%A0%E5%82%B5%E6%AF%94%E4%BE%8B%E8%B6%8A%E9%AB%98%EF%BC%8C%E8%B2%A1%E5%8B%99%E9%A2%A8%E9%9A%AA%E4%B9%9F%E8%B6%8A%E9%AB%98%EF%BC%8C%E6%9B%B4%E5%AE%B9%E6%98%93%E5%8F%97%E5%88%B0%E5%A4%96%E9%83%A8%E8%A1%9D%E6%93%8A%E7%9A%84%E5%BD%B1%E9%9F%BF%E3%80%82" target="_blank" rel="noopener">股東權益比率是什麼？解析企業財務結構的關鍵指標 | 股市更生人｜陳雨農</a>)。在經濟不景氣或金融動盪時，權益比率高的公司因負債少，利息負擔低，較不易因債務問題陷入困境，股價相對更能抵禦外部衝擊。反之，比率過低（如20%以下）意味著企業資產主要靠舉債取得，負債沉重，一旦景氣逆轉或利率上升，公司財務壓力將劇增，可能影響持續經營，投資風險大增。不過，權益比率也非愈高愈好：過高（接近100%）意味公司幾乎不用貸款，固然非常穩健，但也可能表示公司過於保守，沒有適度利用財務槓桿來擴張業務。因此一般認為權益比率<strong>適中</strong>最理想，既不過度負債也不白白錯失成長機會。對本策略而言，股東權益比率被用來<strong>篩選財務結構健全</strong>的企業。例如，可設定一個底線（如&gt;40%）來剔除高槓桿公司，留下資本結構穩當的標的。這能確保我們挑選的研發高投入公司同時具備穩健的財務基礎，不會因過度舉債而使投資暴露在破產風險中。在實踐中，這一指標搭配研發指標一起使用，有助於找到既<strong>勇於創新又財務穩健</strong>的「雙優」公司，增強投資組合的抗跌性。</p>



<h3>價格與成交量篩選標準</h3>



<p><strong>價格篩選</strong>：設定最低股價門檻是常見作法，目的在於避開低價股的潛在風險。過低的股價可能意味公司基本面不佳或流動性差，且低價股價格變動一旦以百分比計算波動劇烈，容易遭到炒作。許多投資策略會排除例如收盤價低於5元或10元的股票，以確保投資標的是有一定市場認可度和市值規模的公司。這種價格下限能防止組合過度集中在投機性標的上，提升策略穩定性。(<a href="https://quantpedia.com/strategies/trend-following-effect-in-stocks/#:~:text=Trend,The" target="_blank" rel="noopener">Trend-following Effect in Stocks &#8211; QuantPedia</a>)</p>



<p><strong>成交量篩選</strong>：流動性是選股時另一項重要考量。本策略要求入選股票具備足夠的成交量，以免未來買賣時因交投清淡而產生滑價或無法脫手的情況。一般會設定日均成交量或<strong>成交金額</strong>的下限，例如日均量至少達幾十萬股乃至上百萬股以上 (<a href="https://www.finlab.tw/%E9%87%8F%E5%8C%96%E4%BA%A4%E6%98%93%E5%AE%8C%E6%95%B4%E6%8C%87%E5%8D%97%EF%BC%9A%E7%AD%96%E7%95%A5%E3%80%81%E5%AF%A6%E6%96%BD%E8%88%87%E9%A2%A8%E9%9A%AA%E7%AE%A1%E7%90%86/#:~:text=,1000000">量化交易完整指南：策略、實施與風險管理 &#8211; FinLab</a>) 。流動性充裕的股票進出場成本較低，也較難被少數大戶操縱價格。上述FinLab量化策略的範例中，就將「<strong>日成交量超過100萬股</strong>」作為必要條件之一。有了這道篩選，可以確保策略執行時買賣單可以順利成交，不致因市場深度不足而影響預期收益。</p>



<p><strong>應用：在本策略中，價格與成交量條件主要扮演風險控管和可執行性</strong>的把關角色。它們並不直接驅動超額報酬，但能提高組合質量。例如，剔除股價過低的公司，可避免組合淨值因幾檔極端波動的仙股而大起大落；而要求成交活躍，則確保未來調整持倉時不會面臨流動性匱乏的窘境。在回測或實盤操作中，也常發現<strong>流動性差的股票即使基本面優異，其股價表現未必跟得上</strong>（可能因缺乏投資人關注）。因此加上成交量門檻，有助於選出市場關注度相對高、價格反映更有效率的公司。總之，價格和成交量篩選雖屬輔助性質，但對提升策略實際運作的順暢度和降低極端風險相當重要，是不可忽視的環節。</p>



<h2>3. 策略的歷史回測與表現分析</h2>



<p>為了評估該策略的有效性，我們對其進行了歷史資料回測，重點觀察年化報酬、風險指標以及不同時期的表現差異。以下是回測結果的重點分析：</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="919" src="https://www.finlab.tw/wp-content/uploads/2025/02/image-1024x919.png" alt="image" class="wp-image-6434" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/image-1024x919.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/image-300x269.png 300w, https://www.finlab.tw/wp-content/uploads/2025/02/image-768x689.png 768w, https://www.finlab.tw/wp-content/uploads/2025/02/image-1536x1378.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/02/image.png 1560w" sizes="(max-width: 1024px) 100vw, 1024px" title="只要 3 個財報指標，報酬率高得驚人 79"><figcaption>整體績效</figcaption></figure>



<ul><li><strong>整體績效：策略長期回測呈現穩健且優於大盤</strong>的增長曲線，累積報酬遠高於市場基準。在所選定的回測期間內（例如2020年至2025年），策略平均報酬為 +60％ 以上。這意味著如果初始投資100萬元，經過多年複利增長資產將大幅成長。+60% 的年化收益相較一般大盤報酬已非常可觀。造成高績效的原因在於策略成功捕捉到了多檔股價倍數上漲的創新公司，同時透過篩選避開了一些雷區，整體提升了報酬水平。</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="335" src="https://www.finlab.tw/wp-content/uploads/2025/02/image-1-1024x335.png" alt="image 1" class="wp-image-6435" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/image-1-1024x335.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/image-1-300x98.png 300w, https://www.finlab.tw/wp-content/uploads/2025/02/image-1-768x251.png 768w, https://www.finlab.tw/wp-content/uploads/2025/02/image-1-1536x503.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/02/image-1.png 1570w" sizes="(max-width: 1024px) 100vw, 1024px" title="只要 3 個財報指標，報酬率高得驚人 80"><figcaption>策略風險報酬</figcaption></figure>



<ul><li><strong>風險調整後報酬：從風險角度看，策略的夏普比率</strong>(Sharpe Ratio)等指標也顯示出不錯的風險調整表現。夏普比率定義為單位風險所獲得的超額報酬，數值越高表示策略在承受波動的前提下獲得越高回報。以回測結果推算，本策略夏普比率大致超過1，明顯高於被動持有市場的夏普值。這表示策略在取得高收益的同時，波動風險並沒有成比例放大，<strong>獲利相對穩健</strong>。策略的年化波動率雖然高於大盤（因重倉成長股難免波動較大），但考慮超額收益，風險回報比仍屬理想範圍。另一個風險指標是<strong>最大回撤</strong>（Maximum Drawdown），即資產峰值到低谷的最大跌幅。回測顯示策略在歷經數次市場震盪時均有出現回撤，但<strong>最大回撤幅度</strong>控制在一個合理水平，約落在-20%至-30%區間（依不同期間而略有差異）。舉例而言，2020年初新冠疫情引發全球股市急跌時，策略持有的研發型公司股價也受到拖累，組合淨值出現了明顯下跌。然而，由於策略持股的公司基本面較佳、現金流穩健，多數挺過了疫情衝擊並在後續快速反彈，使回撤時間較短、幅度有限。總體而言，策略並非沒有風險，但風險水準相對其收益是<strong>可接受且經得起考驗</strong>的。</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="444" src="https://www.finlab.tw/wp-content/uploads/2025/02/image-2-1024x444.png" alt="image 2" class="wp-image-6436" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/image-2-1024x444.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/image-2-300x130.png 300w, https://www.finlab.tw/wp-content/uploads/2025/02/image-2-768x333.png 768w, https://www.finlab.tw/wp-content/uploads/2025/02/image-2-1536x666.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/02/image-2.png 1554w" sizes="(max-width: 1024px) 100vw, 1024px" title="只要 3 個財報指標，報酬率高得驚人 81"><figcaption>不同時期的表現</figcaption></figure>



<ul><li><strong>不同時期表現比較</strong>：將策略在不同時間區間的績效拆解，可以發現市場環境對其影響。特別值得關注的是<strong>2020年之後</strong>的表現：從2020年至2021年，隨著全球進入科技股大多頭，本策略收益出現跳升。因為疫情催化數位轉型，科技、生技類股票大漲，而本策略聚焦的高研發公司正屬這波行情的領頭羊，不少持股在短時間內股價翻倍，推動策略淨值大幅創新高。因此2020年後短短兩年內，策略累計報酬增長迅猛。此外，我們也留意到<strong>2022年</strong>全球科技股修正時，策略淨值出現了一定幅度的回落。隨著通膨升溫和利率上升，市場風格轉向價值股，高研發的成長股遭遇估值壓縮，策略在<strong>科技股強勢期表現亮眼，在逆風期則需經受回撤考驗</strong>。長期來看，經歷完整週期後策略仍能收穫可觀的累積收益，但投資人應有心理準備，短期內績效會隨市場風格輪動而波動。</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="943" src="https://www.finlab.tw/wp-content/uploads/2025/02/image-3-1024x943.png" alt="image 3" class="wp-image-6437" srcset="https://www.finlab.tw/wp-content/uploads/2025/02/image-3-1024x943.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/02/image-3-300x276.png 300w, https://www.finlab.tw/wp-content/uploads/2025/02/image-3-768x707.png 768w, https://www.finlab.tw/wp-content/uploads/2025/02/image-3.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" title="只要 3 個財報指標，報酬率高得驚人 82"></figure>



<ul><li><strong>盈虧交易分佈</strong>：對策略歷次交易結果進行統計，可以更深入了解其獲利來源和風險分散情況。整體而言，本策略的勝率（盈利交易占比）超過五成，約落在60%左右，意味著絕大部分選出的股票在持有期間都為組合帶來正向收益。然後更重要的是<strong>盈虧分佈的特徵</strong>：我們觀察到策略的獲利主要來自少部分<strong>大贏家</strong>的貢獻，而虧損交易多為小幅下跌的個股。也就是說，<strong>收益分配呈現右偏長尾</strong>——少數持股取得了數倍的漲幅，撐起組合整體表現；同時一些看走眼的標的即使下跌，因基本面尚可並未爆雷，跌幅通常有限。在回測期間，單筆最大盈利交易的報酬高達數百%，例如持有某高速成長的半導體股兩年多獲利超過3倍；相較下，單筆最大虧損則控制在-40%以內，而且這類較大虧損的案例很少見。在所有交易中，大約有一半以上的盈利筆數屬於<strong>中小幅獲利</strong>。【註：此處分析假設每季調整持倉一次，因此一次“交易”指持有該股一個調整週期】。這種盈虧分佈說明本策略的<strong>盈虧比</strong>相當優秀：平均每筆賺錢的金額遠高於每筆賠錢的金額，即使勝率不是極高，仍能確保整體獲利。換言之，策略透過挑中極少數的<strong>黑馬股</strong>來驅動收益，同時藉由篩選機制將虧損控制在可承受範圍。從風險管理角度看，這種分佈頗為健康，因為沒有頻繁的大額虧損侵蝕本金，盈利累積能不斷創出新高。</li></ul>



<p>綜上所述，歷史回測證實了該策略的有效性：<strong>長期報酬豐厚，風險相對可控</strong>。尤其在研發熱潮的時代背景下，策略能大幅超越市場。然而投資人也需理解，策略並非每年都戰無不勝，遇到風格反轉或系統性風險時也會出現階段性回撤。關鍵在於嚴守紀律長期執行，讓策略的統計優勢發揮作用。只要未來市場繼續賞識創新型企業，該策略就有望延續亮麗表現。</p>



<h2>4. 如何改進與優化該策略</h2>



<p>雖然該策略已展現不錯的歷史績效，但仍有改進空間。透過優化指標設定和風控機制，可望進一步提升收益、降低波動。以下是幾項可能的優化方向：</p>



<ul><li><strong>調整指標閾值與權重</strong>：重新檢視研發費用率、研發/管理比值等閾值設定，尋找更理想的平衡點。例如，可以嘗試放寬或收緊研發比率門檻，觀察對組合績效的影響。如果發現前10%研發率過於集中，或許前15%能在略降報酬的同時明顯降低風險，則可考慮採用稍寬標準。同時，不妨對多個研發相關指標進行<strong>加權綜合評分</strong>，而非硬性每項都要達標。例如建立一個綜合研發指數（將研發費用率、研發佔營業費用比等按重要性加權求和），然後選取該指數最高的一批公司。這種方法或許比單一門檻更能捕捉研發投入的綜合領先者。此外，對<strong>股東權益比率</strong>也可設定<strong>分級篩選</strong>：如只要高於某值即可，不強求愈高愈好，以免錯失合理運用負債促進成長的公司。適當的指標鬆緊調整，可以讓策略在保留選股優勢的同時，包容更多元的標的，提升組合穩健度。</li><li><strong>增強風險控管機制</strong>：加入明確的風控規則來減少單筆持股或整體組合的極端虧損。有幾種途徑可以考慮：其一是設置<strong>停損/停利點</strong>，例如當某持股相對買入價下跌超過20%時，提前賣出止損，避免繼續擴大虧損；或者當持股獲利超過一定幅度（如+100%）時，分批了結鎖定收益，防止帳面獲利回吐過多。其二是運用<strong>整體風險指標</strong>控管，例如當策略淨值從近期高點回撤超過一定比例（如15%）時，暫時減少持股總倉位，提升現金比例，以渡過市場低潮。此外，可以引入<strong>市場趨勢過濾</strong>機制，作為風險開關：例如加入大盤技術面指標，如果大盤跌破某長期均線或市場整體波動劇增時，策略暫停進場新的多頭部位，甚至考慮對沖。再者，針對組合集中度風險，也可設定<strong>單一持股權重上限</strong>或<strong>行業曝險上限</strong>，避免策略過度押注少數幾檔股票或同產業。這些風控改進措施的目標是在不明顯犧牲報酬的前提下，大幅降低<strong>最大回撤</strong>，讓資金曲線更平滑。以本策略為例，原先已加入營運現金流為正的條件來控制質地，後續可以考慮再<strong>加上一道盈餘為正或ROE為正</strong>的篩選，確保公司至少有基本獲利能力，進一步降低踩雷風險。</li><li>另一個方向是運用<strong>機器學習或優化演算法</strong>，自動調節參數。例如透過遺傳演算法不斷尋找最佳研發比率門檻、權益比率門檻等，使策略隨資料更新而進化。這當然需要小心避免過度適配（overfitting），但合理運用可提升策略對未來的適應力。總之，透過動態化，策略有望在不同市場週期中保持相對穩健，而不致在某些環境中失效。</li><li><strong>其他可能優化點</strong>：除了上述重點，也可以考慮一些細節優化。例如：加入季報關鍵數據的即時反應（如一季營收或毛利驟增，提前納入考量），讓選股信息更敏捷；對研發投入的成效加以評估（如觀察研發是否轉化為專利或新產品上市），挑選研發<strong>效率</strong>高的公司而非僅看研發費用燒錢多少；或者引入<strong>估值考量</strong>，避免購買研發雖高但股價已嚴重透支未來成長的公司（可加上本益比或PEG的上限），都有可能進一步提升策略的<strong>容錯性與獲利能力</strong>。</li></ul>



<p>整體而言，優化的原則是在保持策略核心邏輯（重視研發+穩健財務）的同時，提高其<strong>防禦性與靈活度</strong>。正如FinLab所建議的，加入適當的基本面條件能讓策略如虎添翼。隨著市場環境改變，不斷檢視並調整策略參數，才能讓這套量化策略長青不墜，在未來持續為投資人創造Alpha！</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/fundamental-3-indicators/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6433</post-id>	</item>
		<item>
		<title>使用月營收與動能策略選股的完整介紹</title>
		<link>https://www.finlab.tw/%e4%bd%bf%e7%94%a8%e6%9c%88%e7%87%9f%e6%94%b6%e8%88%87%e5%8b%95%e8%83%bd%e7%ad%96%e7%95%a5%e9%81%b8%e8%82%a1%e7%9a%84%e5%ae%8c%e6%95%b4%e4%bb%8b%e7%b4%b9/</link>
					<comments>https://www.finlab.tw/%e4%bd%bf%e7%94%a8%e6%9c%88%e7%87%9f%e6%94%b6%e8%88%87%e5%8b%95%e8%83%bd%e7%ad%96%e7%95%a5%e9%81%b8%e8%82%a1%e7%9a%84%e5%ae%8c%e6%95%b4%e4%bb%8b%e7%b4%b9/#respond</comments>
		
		<dc:creator><![CDATA[FinLab - 韓承佑]]></dc:creator>
		<pubDate>Sun, 12 Jan 2025 11:30:00 +0000</pubDate>
				<category><![CDATA[FinLab 量化平台]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[VIP文章]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[選股策略]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6420</guid>

					<description><![CDATA[你以為股價是因為月營收表現好才上漲嗎？ 其實，現實可能完全相反——主力炒股根本不需要月營收數據！ 真正厲害的投 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>你以為股價是因為月營收表現好才上漲嗎？</p>



<p>其實，現實可能完全相反——主力炒股根本不需要月營收數據！</p>



<p>真正厲害的投資人，不會等到數據公布才下手，而是抓住「月營收前後的股價動能」這個關鍵訊號，提前找到飆股機會。有時候，這些動能強的股票甚至飆得更兇！</p>



<p>本文將帶領您深入了解一段程式碼背後的邏輯，並分析使用的數據來源與選股策略，幫助您理解如何利用 Python 和量化技術來挖掘投資機會。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>程式碼簡介</strong></h2>



<p>這段程式碼來自量化交易的回測工具庫 <code>finlab.backtest</code>，它旨在根據動能和月營收的特性來選出潛在的飆股，並進行回測模擬，驗證策略的有效性。</p>



<h3>核心程式碼：</h3>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.backtest import sim

close = data.get('price:收盤價')
pct_change = (close / close.shift() - 1).rolling(5).mean()
當月營收 = data.get('monthly_revenue:當月營收')

pos = pct_change[(close &gt; close.average(60)) &amp; (close &gt; close.average(20)) &amp; (close &gt; close.average(120)) &amp; (當月營收.average(3) &gt; 當月營收.average(12))].is_largest(10)

r = sim(pos, resample='M', resample_offset='11D', upload=False, stop_loss=0.1)
r.display()</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<figure class="wp-block-image size-large"><img loading="lazy" width="966" height="1024" src="https://www.finlab.tw/wp-content/uploads/2025/01/image-4-966x1024.png" alt="image 4" class="wp-image-6421" srcset="https://www.finlab.tw/wp-content/uploads/2025/01/image-4-966x1024.png 966w, https://www.finlab.tw/wp-content/uploads/2025/01/image-4-283x300.png 283w, https://www.finlab.tw/wp-content/uploads/2025/01/image-4-768x814.png 768w, https://www.finlab.tw/wp-content/uploads/2025/01/image-4-1449x1536.png 1449w, https://www.finlab.tw/wp-content/uploads/2025/01/image-4.png 1564w" sizes="(max-width: 966px) 100vw, 966px" title="使用月營收與動能策略選股的完整介紹 83"></figure>



<h2><strong>數據來源與處理</strong></h2>



<h3><strong>1. 收盤價 (Closing Price)</strong></h3>



<ul><li>使用的數據：<code>price:收盤價</code></li><li>處理方式：<ul><li>計算每日收盤價的五日平均漲跌幅：<code>pct_change = (close / close.shift() - 1).rolling(5).mean()</code></li><li>這樣的計算能平滑日間波動，突顯短期動能。</li></ul></li></ul>



<h3><strong>2. 當月營收 (Monthly Revenue)</strong></h3>



<ul><li>使用的數據：<code>monthly_revenue:當月營收</code></li><li>處理方式：<ul><li>比較三個月平均營收與十二個月平均營收：<code>當月營收.average(3) &gt; 當月營收.average(12)</code></li><li>這樣的條件確保選出的公司近期營收增長良好，具有基本面支持。</li></ul></li></ul>



<h3><strong>條件篩選邏輯</strong></h3>



<h4><strong>1. 技術面條件</strong></h4>



<ul><li>近 60 日、20 日及 120 日均線以上的股價：<code>close &gt; close.average(60) close &gt; close.average(20) close &gt; close.average(120)</code><ul><li>這些條件用於確認股價處於多頭趨勢。</li></ul></li></ul>



<h4><strong>2. 基本面條件</strong></h4>



<ul><li>當月營收三個月平均值高於十二個月平均值：<code>當月營收.average(3) &gt; 當月營收.average(12)</code><ul><li>表示公司短期營收增長快於長期趨勢，顯示業績改善。</li></ul></li></ul>



<h4><strong>3. 選出前 10 強股票</strong></h4>



<ul><li>利用 <code>.is_largest(10)</code> 選出動能最強的 10 檔股票。</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>策略回測 (Backtesting)</strong></h2>



<h3><strong>回測設定</strong></h3>



<ul><li>使用 <code>sim</code> 函數進行模擬：<code>r = sim(pos, resample='M', resample_offset='11D', upload=False, stop_loss=0.1)</code><ul><li><code>resample='M'</code>：以每月為單位進行再平衡。</li><li><code>resample_offset='11D'</code>：回測的基準日期設為每月的第 11 天，對應月營收數據發布後的市場反應。</li><li><code>stop_loss=0.1</code>：設定 10% 的停損機制，控制風險。</li></ul></li></ul>



<h3><strong>結果展示</strong></h3>



<p>最後以 <code>r.display()</code> 顯示回測結果，圖表呈現策略的績效數據與曲線。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>策略優勢與限制</strong></h2>



<h3><strong>1. 策略的主要優勢</strong></h3>



<ul><li><strong>多層次篩選</strong>：結合技術面與基本面條件，增強策略的穩健性。</li><li><strong>動能增強</strong>：動能指標幫助捕捉短期市場熱點。</li><li><strong>基本面支持</strong>：營收增長確保選股具有實質業績基礎，降低投資風險。</li></ul>



<h3><strong>2. 策略的潛在限制</strong></h3>



<ul><li><strong>數據延遲風險</strong>：月營收數據發布有一定滯後性，可能影響市場反應的及時性。</li><li><strong>適用性限制</strong>：此策略在極端市場條件（如金融危機）中可能效果不佳。</li><li><strong>流動性問題</strong>：策略可能不適合流動性較差的股票。</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>實際應用場景與潛在改進</strong></h2>



<h3><strong>1. 適合的投資者類型</strong></h3>



<ul><li><strong>短期交易者</strong>：希望捕捉短期股價波動。</li><li><strong>成長型投資者</strong>：尋找營收增長良好的潛力股。</li></ul>



<h3><strong>2. 在不同市場環境的表現</strong></h3>



<ul><li><strong>牛市</strong>：策略表現更佳，動能與營收增長同步提升。</li><li><strong>熊市</strong>：需注意停損機制，以避免大幅回撤。</li><li><strong>震盪市</strong>：篩選出的股票可能具有相對穩定的表現。</li></ul>



<h3><strong>3. 潛在改進方向</strong></h3>



<ul><li>增加多因子模型，例如結合市值因子或財務指標進一步優化篩選。</li><li>探討不同停損比例對績效的影響，找到最適合的參數配置。</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>回測結果分析</strong></h2>



<p>根據提供的回測數據與績效表現：</p>



<h3><strong>1. 年化報酬率</strong></h3>



<ul><li>高達 <strong>33.5%</strong>，遠超大盤平均回報。</li></ul>



<h3><strong>2. 風險調整後績效</strong></h3>



<ul><li>Alpha：<strong>27.5%</strong>，顯示策略的超額收益顯著。</li><li>Beta：<strong>0.64</strong>，風險低於大盤。</li></ul>



<h3><strong>3. 歷史績效曲線</strong></h3>



<ul><li>從圖中可見，策略的累積報酬呈指數增長，顯示穩健的長期表現。</li></ul>



<h3><strong>4. 年度績效分析</strong></h3>



<ul><li>個別年份如 2024 年表現尤為亮眼，達到 <strong>86.7%</strong> 的年度回報。</li></ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>讀者常見問題 (FAQ)</strong></h2>



<h3><strong>1. 策略適合的投資期限是多長？</strong></h3>



<p>此策略適合中短期（1-3 個月）的交易者，透過每月再平衡抓住市場機會。</p>



<h3><strong>2. 如何處理月營收數據延遲的問題？</strong></h3>



<p>選擇月營收發布後的第 11 天作為基準，盡量捕捉市場反應並降低延遲影響。</p>



<h3><strong>3. 是否能結合其他因子一起使用？</strong></h3>



<p>完全可以！結合市值、估值或其他技術指標能進一步提升策略的有效性。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2><strong>結語</strong></h2>



<p>這段程式碼展示了一個將技術分析與基本面相結合的高效選股策略。其核心理念是通過動能捕捉短期機會，並結合營收數據增強選股的基本面支持。此外，策略的回測結果證實了其在歷史數據中的卓越表現。</p>



<p>量化策略並非魔法，但它能幫助我們以更理性的方式看待市場。若您對此策略感興趣，不妨嘗試運用並結合其他技術指標，進一步提升您的投資績效，讓數據為您的決策服務！</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/%e4%bd%bf%e7%94%a8%e6%9c%88%e7%87%9f%e6%94%b6%e8%88%87%e5%8b%95%e8%83%bd%e7%ad%96%e7%95%a5%e9%81%b8%e8%82%a1%e7%9a%84%e5%ae%8c%e6%95%b4%e4%bb%8b%e7%b4%b9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6420</post-id>	</item>
		<item>
		<title>Qlib 與 FinLab 整合，展現 AI 選股的神蹟。</title>
		<link>https://www.finlab.tw/qlib-finlab-implementation-source-code/</link>
					<comments>https://www.finlab.tw/qlib-finlab-implementation-source-code/#respond</comments>
		
		<dc:creator><![CDATA[FinLab - 韓承佑]]></dc:creator>
		<pubDate>Mon, 06 Jan 2025 15:47:50 +0000</pubDate>
				<category><![CDATA[AI看股票]]></category>
		<category><![CDATA[VIP限定]]></category>
		<category><![CDATA[機器學習]]></category>
		<category><![CDATA[歷史回測]]></category>
		<category><![CDATA[程式交易]]></category>
		<category><![CDATA[選股策略]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6410</guid>

					<description><![CDATA[雖然 FinLab 支援 Qlib 很久了，但一直沒有好好的跟大家介紹如何使用，於是乎，最近中小股票真的表現令 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="585" src="https://www.finlab.tw/wp-content/uploads/2025/01/image-1-1024x585.png" alt="image 1" class="wp-image-6412" srcset="https://www.finlab.tw/wp-content/uploads/2025/01/image-1-1024x585.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/01/image-1-300x171.png 300w, https://www.finlab.tw/wp-content/uploads/2025/01/image-1-768x439.png 768w, https://www.finlab.tw/wp-content/uploads/2025/01/image-1-1536x878.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/01/image-1.png 1792w" sizes="(max-width: 1024px) 100vw, 1024px" title="Qlib 與 FinLab 整合，展現 AI 選股的神蹟。 84"></figure>



<p>雖然 FinLab 支援 Qlib 很久了，但一直沒有好好的跟大家介紹如何使用，於是乎，最近中小股票真的表現令人窒息，所以就好好做研究，相信總會時來運轉的。台股權值股與中小型股差異，來到20年來最大，台積電創新高之際，已經有很多股票跌破年線了，老實說，虧很多嗎？是還好，但就是很悶，心情不受影響是不可能的，然而人生在世，就是來體驗這些喜怒哀樂，就讓我們繼續努力，看結果如何，雖然很煩，但是我還是對於未來非常樂觀！</p>



<h1>Qlib</h1>



<p>Qlib 是由微軟開源的量化投資工具庫，專注於基於機器學習的投資研究。它提供了資料處理、策略建模、回測及評估的一站式解決方案。</p>



<h1>Qlib 在 FinLab 中的應用</h1>



<p>Qlib 的演算法有非常多前人研究的心血，不是我們能夠短時間比擬的，所以要站在巨人的肩膀上，才能事半功倍！Qlib 的最大特點，就是在於</p>



<p>1. 特徵的建構 </p>



<p>2. 模型的多樣選擇</p>



<p>基於以上兩點，你都可以透過 FinLab package 將它們給接入進來使用。然而我覺得 Qlib 架構比較難與其它的生態系或 Package 整合，因為整個框架以程式系統來說，是比較封閉，沒辦法與傳統的 sklearn，或是 lgb、xgb 整合，所以才需要使用 FinLab 將其解放。</p>



<h1>Qlib vs FinLab</h1>



<p>Qlib 是通用型的 package，所以特徵都是使用價格來製作，而 FinLab 本身支援台股多樣的資料與指標，所以延伸的部分非常多！歡迎將以下的功能當成基礎版本，自己加入更多特徵來增進模型的運測能力！</p>



<h1>安裝</h1>



<p>接下來，將會使用 Colab 來進行設定，但以下範例需要 Colab Pro 版本，才能順利運行，因為 RAM 的需求太大了。假如各位沒有買 Colab 付費版，也可以在自己的主機上試試看，初次安裝，需要有以下的套件：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">!pip install finlab &gt; log.txt
!pip install ta-lib-bin &gt; log.txt
!pip install catboost &gt; log.txt</code></pre>



<p>上面的程式中，安裝 talib 的方法，是使用 ta-lib-bin，是 colab 上特別的安裝方法，假如你是在桌機上使用，要用</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">conda install conda-forge::ta-lib</code></pre>



<p>來取代。</p>



<h1>安裝 Qlib</h1>



<p>安裝 Qlib 的方式，有很多種，一種是直接將 github 上的最新版本下載下來安裝：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">!git clone https://github.com/microsoft/qlib.git
%cd qlib
!make install
!pip install .
%cd ..</code></pre>



<p>要注意，以上的程式碼是在 terminal 中使用，不是 python 語法喔！</p>



<h1>製作特徵</h1>



<p>我們可以使用 qlib 內建的功能，產生出158種，或是360種不同的價格訊號，只需要三行即可完成：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.ml import qlib as q


q.init()
q.dump()
f158 = q.alpha("Alpha158")</code></pre>



<p>然而這樣的資料量，實在是太大了，所以我們可以將資料的頻率改成「週」，大約可以減少80％的資料量，這樣的訓練方式，勉強能夠在 Colab Pro 上執行（50GB RAM）。假如是 alpha360 資料集，基本上會需要上百GB，就請有這樣硬體能力的玩家自行上手了！</p>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.ml import label as mll
from finlab.ml import feature as mlf

features = mlf.combine({
    'qlib': f158,
}, resample='W')
labels = mll.return_percentage(features.index, period=2)

is_train = features.index.get_level_values('datetime') &lt; '2020-01-01'</code></pre>



<p>接下來，我們發現，f158之中，有一個特徵都是 NaN（也就是空值），我們必須要將它刪除：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">features = features.drop('VWAP0', axis=1)</code></pre>



<p>目前原因不明，應該還有一些 BUG 需要釐清，也可以利用 `mlf.combine` 自行計算補上 VWAP 的資料。</p>



<h1>訓練模型</h1>



<p>訓練模型的環節，FinLab 提供一個超級好用的功能</p>



<pre class="wp-block-code"><code class="">model_templates = q.get_models()</code></pre>



<p>就可以將 qlib 所有的模型導入，並且直接用來訓練：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">import gc
import numpy as np
import pickle
from finlab.ml import qlib as q

model_templates = q.get_models()
is_train = features.index.get_level_values('datetime') &lt; '2020-01-01'


model_path = './models.pkl'

if os.path.isfile(model_path):
  with open(model_path, 'rb') as f:
    models = pickle.load(f)
else:
  models = {}


for name, Model in model_templates.items():
    print(name)

    if name in models:
      continue

    if name == 'DNNModel':
      continue

    try:
      X_train = features.loc[is_train]
      y_train = labels.loc[is_train]
      model = Model()
      model.fit(X_train, y_train)

    except:
      notna = X_train.replace([np.inf, -np.inf], np.nan).notna().all(axis=1) &amp; y_train.replace([np.inf, -np.inf], np.nan).notna()
      X_train = X_train.loc[notna]
      y_train = y_train.loc[notna]
      model = Model()
      model.fit(X_train, y_train)


    with open(f'models.pkl', 'wb') as f:
      pickle.dump(models, f)

    models[name] = model

    gc.collect()</code></pre>



<p>訓練的過程中，可能訓練到一半 RAM 會掛掉，所以每次訓練好新的模型，程式會將所有模型都儲存起來，方便下一次直接調用。訓練時，會將 training data 自動切出 validation data，來確保訓練時避免 overfitting。</p>



<h1>測試</h1>



<p>最後我們可以回測看看模型得效果如何：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">import pickle
import numpy as np

model_path = './models.pkl'

if os.path.isfile(model_path):
  with open(model_path, 'rb') as f:
    models = pickle.load(f)


ys = {}

for name, model in models.items():

  try:
    y = model.predict(features[~is_train])
    ys[name] = y
  except:
    y = model.predict(features[~is_train].replace([np.inf, -np.inf], np.nan).fillna(0))
    ys[name] = y

from finlab.backtest import sim
import matplotlib.pyplot as plt
from finlab import data

reports = {}
for name, y in ys.items():
  print(name)
  with data.universe('TSE_OTC'):
    close = data.get('price:收盤價')
    report = sim(y[close.notna()].is_largest(20), resample='M', upload=False)
    reports[name] = report
    report.creturn.plot(label=name)

plt.legend()
plt.show()</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" width="543" height="407" src="https://www.finlab.tw/wp-content/uploads/2025/01/image.png" alt="image" class="wp-image-6411" srcset="https://www.finlab.tw/wp-content/uploads/2025/01/image.png 543w, https://www.finlab.tw/wp-content/uploads/2025/01/image-300x225.png 300w" sizes="(max-width: 543px) 100vw, 543px" title="Qlib 與 FinLab 整合，展現 AI 選股的神蹟。 85"></figure>



<p>其實效果算是滿不錯的，實單上，經過更多的調教，我的經驗，會比當前的成果更好，有興趣的玩家可以多多嘗試！其中一些策略回測甚至可以有 40％到50％的平均年報酬率。</p>



<p>話說最近 AI 模型，這幾個月的表現可能都不太好，然而換一種想法，就是當前可能不太適合使用 AI 模型吧～不代表它以後都沒效果，而是時運不佳的關係，反而讓我的心裡有點釋懷。</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="937" src="https://www.finlab.tw/wp-content/uploads/2025/01/image-2-1024x937.png" alt="image 2" class="wp-image-6413" srcset="https://www.finlab.tw/wp-content/uploads/2025/01/image-2-1024x937.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/01/image-2-300x275.png 300w, https://www.finlab.tw/wp-content/uploads/2025/01/image-2-768x703.png 768w, https://www.finlab.tw/wp-content/uploads/2025/01/image-2.png 1464w" sizes="(max-width: 1024px) 100vw, 1024px" title="Qlib 與 FinLab 整合，展現 AI 選股的神蹟。 86"></figure>



<p>由上表可知，我們可以選擇 LightGBM 模型來選股，效果最好。</p>



<p></p>



<p>以下示範一個年平均報酬 +50%的策略，這絕對是價值數萬元的程式碼，就這麼隨便的放在這邊讓大家取用，請你跟我說，在世界上的哪一個角落，可以找到這麼神乎其技的AI模型選股績效？找不到吧！只好請大家繼續支持 FinLab，讓我們可以活下去，謝謝：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">y = ys['LGBModel']

with data.universe('TSE_OTC'):

  close = data.get('price:收盤價')
  vol = data.get('price:成交股數')
  pos = y[((vol.average(20) &gt; 200_000)) &amp; (close &gt;= close.rolling(10).max())].is_largest(10)
  report = sim(pos, resample='M', upload=False)
  report.display()</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="994" src="https://www.finlab.tw/wp-content/uploads/2025/01/image-3-1024x994.png" alt="image 3" class="wp-image-6414" srcset="https://www.finlab.tw/wp-content/uploads/2025/01/image-3-1024x994.png 1024w, https://www.finlab.tw/wp-content/uploads/2025/01/image-3-300x291.png 300w, https://www.finlab.tw/wp-content/uploads/2025/01/image-3-768x746.png 768w, https://www.finlab.tw/wp-content/uploads/2025/01/image-3-1536x1491.png 1536w, https://www.finlab.tw/wp-content/uploads/2025/01/image-3.png 1574w" sizes="(max-width: 1024px) 100vw, 1024px" title="Qlib 與 FinLab 整合，展現 AI 選股的神蹟。 87"></figure>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/qlib-finlab-implementation-source-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6410</post-id>	</item>
		<item>
		<title>Information Coefficient 是什麼，要如何使用？</title>
		<link>https://www.finlab.tw/information-coefficient/</link>
					<comments>https://www.finlab.tw/information-coefficient/#respond</comments>
		
		<dc:creator><![CDATA[FinLab - 韓承佑]]></dc:creator>
		<pubDate>Mon, 18 Nov 2024 17:40:51 +0000</pubDate>
				<category><![CDATA[PYTHON財經]]></category>
		<category><![CDATA[Python新手教學]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[程式交易]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=6396</guid>

					<description><![CDATA[Information Coefficient (IC) 我很早就知道它了，但是一直沒有時間將它整合到交易系統 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Information Coefficient (IC) 我很早就知道它了，但是一直沒有時間將它整合到交易系統裡面，今年正好有這樣的機遇，趁著教書的時間，徹底的研究 IC 在各方面的使用方法。</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="569" src="https://www.finlab.tw/wp-content/uploads/2024/11/image-6-1024x569.png" alt="image 6" class="wp-image-6397" srcset="https://www.finlab.tw/wp-content/uploads/2024/11/image-6-1024x569.png 1024w, https://www.finlab.tw/wp-content/uploads/2024/11/image-6-300x167.png 300w, https://www.finlab.tw/wp-content/uploads/2024/11/image-6-768x427.png 768w, https://www.finlab.tw/wp-content/uploads/2024/11/image-6-1536x854.png 1536w, https://www.finlab.tw/wp-content/uploads/2024/11/image-6-2048x1139.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" title="Information Coefficient 是什麼，要如何使用？ 88"></figure>



<p>先說結論，IC 就是做最佳化不可或缺的驗證方式，它有幾個優點：</p>



<h3>多樣本</h3>



<p>多樣本現象：很多人對於「模型」感到很困惑，「這不就是策略嗎」？為什麼要說的很高大尚，說這是「模型？」差別很簡單，假如你在交易一個現象，那就能夠稱為模型。</p>



<p>問題在於，很多人研發策略，只是回測出賺錢的手法，就能稱為「模型」。</p>



<p>這是一個謬誤，因為回測歷史總是會賺錢的！但賺得穩不穩定？未來報酬是否類似呢？假如你使用 MultiChart 等相關的產品，你就知道，它能做很多策略，但它並不能歸類為模型。</p>



<p>什麼叫做模型？模型是用來解釋股市現象，並且將這些現象具體用於交易的方法，例如：</p>



<ul><li>市場規則：股市中，大神如菲比斯，他曾說「要瞭解市場的規則」因為從規則中，就可以賺錢，著重在事件交易，例如信用交易、重大訊息、法說會&#8230;等等。</li><li>當然市場上，除了很顯著的規則事件外，其實有很多隱性的規律，例如小市值效應、成交量效應、均線效應、波動的效應。這些「效應」就是描述市場上的報酬，在特定的股票上，價格會有不均衡的現象。這也是 FinLab 最著重在觀察的重點。</li></ul>



<p>在事件交易中，我們可以利用事件發生前後的報酬率統計，來判斷事件對於股價的影響，而在市場的規律，就要靠 IC 來幫我們判斷。</p>



<h3>驗證有效性</h3>



<p>IC 的其中一個最重要的功能，就是幫助我們驗證這些效應是否真的有效。如果一個策略或模型的 IC 持續為正，且在不同時期、不同市場中都維持穩定，那麼我們就可以更有信心地相信這個策略的背後有其合理性與可靠性。</p>



<p>換句話說，IC 是在幫助我們確保我們看到的不是「假象」，而是真正存在的「現象」。IC 越高，代表我們模型對報酬的預測能力越好，這也意味著這個模型具有一定的可預測性。</p>



<h3>監控模型穩定性</h3>



<p>IC 也可以作為模型持續性監控的一個重要工具。市場變化迅速，很多模型在一開始可能會表現得很好，但隨著時間的推移，它們的預測能力可能逐漸下降。如果我們持續追蹤 IC 值，就能及早發現模型失效的徵兆，例如 IC 開始由正變負，或是不再穩定。我們可以根據這些指標及時調整策略，甚至放棄不再有效的模型。</p>



<h3>組合效應評估</h3>



<p>IC 也可以幫助我們比較不同的模型或因子之間的效果。不同模型之間，如果我們使用 IC 來做比較，可以清楚地知道哪個模型在預測能力上更勝一籌。甚至，我們可以透過計算 IC 的加權平均，來衡量多個因子的綜合效果，這樣有助於我們打造更為強大的投資組合。</p>



<h3>最重要的：避免過擬合</h3>



<p>當你回測每個月持有10檔股票時，每年的樣本數為 12 x 10 ，就是120個樣本。這樣的數量，只要選到一兩支暴漲的股票，就會讓你的回測績效異常優異。然而，你永遠不知道的是，究竟是你是</p>



<ul><li>發現了某個現象，捕捉到了股票標的，真的會上漲</li><li>還是為了捕捉會上漲的股票，而設計了這些條件</li></ul>



<p>上述兩件事情，都能讓回測績效優異，但對於樣本外（實單）有著天差地別的結果，此時，使用 IC 的好處，就是可以確認你真的在做「二」而非在做「一」。因為 IC 是全市場的監測，此時你的樣本就是上市櫃近 2000 檔股票標的，而且你甚至可以做 rolling 的方式，去增加樣本的數量，進而大幅度預防過擬合。</p>



<p>最簡單的方式，就是都不回測，只有最後將 IC 調整至足夠優秀後，再簡易的做出策略。</p>



<p>就像是你做料理，一定是先備料，最後組合，變成一道佳餚，而不是東拼西湊，且戰且走。</p>



<h3>IC的使用方法</h3>



<pre class="wp-block-code"><code lang="python" class="language-python">from finlab.tools.factor_analysis import ic

factor = data.get('price_earning_ratio:股價淨值比')
price = data.get('etl:adj_close')

score = ic(factor, price).mean()

print(score)</code></pre>



<p>實戰的ML預測能力，其 IC 最好能大於 0.05，一般的 Factor，盡量 IC 要大於 0.01。</p>



<h3>IC的應用場景</h3>



<ul><li>用來篩選因子</li><li>驗證策略的條件合理性</li><li>用來確認ML模型預測效果</li><li>用來檢視因子的延續性、穩定性</li><li>用來檢視模型的延續性、穩定性</li></ul>



<h2>結論</h2>



<p>假如你想要精進自己的量化交易技術，請研究 IC，將其應用於製作「模型」的所有流程中，很多人認為做一個好策略、報酬率、夏普是重點，其實不是，</p>



<p>例如你用 ML，假如用基因演算法，用暴力列舉所有參數，隨時隨地都能做出好策略，但真的有用嗎？</p>



<p>量化交易的精髓，在於預防 Overfitting，才是重點，再多的快樂表，都底不過一個能夠長期有效的策略。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/information-coefficient/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6396</post-id>	</item>
	</channel>
</rss>
