<?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>徵稿活動 &#8211; FinLab</title>
	<atom:link href="https://www.finlab.tw/tag/%E5%BE%B5%E7%A8%BF%E6%B4%BB%E5%8B%95/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.finlab.tw</link>
	<description>深入淺出的量化投資，讓你在在茫茫股海中，找到專屬於自己的投資方法</description>
	<lastBuildDate>Wed, 25 May 2022 07:45:56 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.9</generator>

<image>
	<url>https://www.finlab.tw/wp-content/uploads/2020/07/favicon.png</url>
	<title>徵稿活動 &#8211; 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>Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正</title>
		<link>https://www.finlab.tw/finlab_submit2/</link>
					<comments>https://www.finlab.tw/finlab_submit2/#respond</comments>
		
		<dc:creator><![CDATA[安 正]]></dc:creator>
		<pubDate>Sun, 13 Feb 2022 12:58:00 +0000</pubDate>
				<category><![CDATA[AI看股票]]></category>
		<category><![CDATA[徵稿活動]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=3301</guid>

					<description><![CDATA[營業利益率選股 原理 營收 (Revenue) 是一間公司「做多少生意」的指標，然而做多少生意不表示賺多少錢， [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="營業利益率選股">營業利益率選股</h2>



<h3 id="原理">原理</h3>



<p><strong>營收 (Revenue)</strong> 是一間公司「做多少生意」的指標，然而做多少生意不表示賺多少錢，營收再高也不代表賺更多的錢，中間還要扣除銷貨成本得到的<strong>營業毛利 (Gross profit)</strong>，營業毛利扣掉費用後得到的<strong>營業利益 (Operating profit)</strong>，而後還有營業外支出，利息與所得稅等等，東扣西扣最後才是代表轉多少錢的指標<strong>稅後淨利 (Net income)</strong>。</p>



<p>先不論一間公司在外面做多少生意，繳多少利息與所得稅等等這些支出，衡量公司賺錢真本事的剩下營業毛利與營業利益這兩個指標。而營業毛利取決於行業類別，例如航運與鋼鐵業，毛利平均 10% 左右；晶圓代工與光學鏡頭，毛利平均在 40% 以上，難以用一個數字去衡量所有公司的好壞。而營業利益表是一間公司控管費用的能力，更能代表這間公司營運能力。</p>



<h3 id="計算營業利益率">計算營業利益率</h3>



<p>營業利益率 = 營業利益 / 營業收入合計</p>



<p>使用 <strong>Finlab API</strong>：</p>



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

operating_income = data.get('financial_statement:營業收入淨額')
operating_profit = data.get('financial_statement:營業利益')
operating_profit_ratio = (operating_profit / operating_income) * 100
</code></pre>



<p>其中：<br><code>operating_income</code>： 營業收入合計<br><code>operating_profit</code>： 營業利益<br><code>operating_profit_ratio</code>： 營業利益率</p>



<h3 id="如何評估營業利益率">如何評估營業利益率</h3>



<p>了解營業利益是評估一間公司營運能力的基礎之後，希望找出營業利益穩定成長，若沒有穩定成長，至少要穩定，因此考慮到季與季之間不能下跌過大。</p>



<p>再來，營業利益率若長期都是負值，再怎麼穩定也是枉然。</p>



<p>因此，對以下條件進行量化：</p>



<ol><li class="">營業利益率連續 <code>seasons</code> 季，下跌不超過某個數值 <code>drop</code>，認為是穩定。</li><li class="">營業利益率連續 <code>seasons</code> 季都是正值。</li></ol>



<p>以上的 <code>seasons</code> 與 <code>drop</code> 都是變數。</p>



<p>先把要量化的公式寫出來：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">condition1 = (((operating_profit_ratio - operating_profit_ratio.shift(1)) / 
           abs(operating_profit_ratio.shift(1))).rolling(seasons-1).min()) * 100 &gt; drop
condition2 = operating_profit_ratio.rolling(seasons).min() &gt; 0

position = condition1 &amp; condition2
</code></pre>



<p>上式計算出連續 <code>seasons</code> 個季度，季與季之間的變化百分比(例如近 4 季就有 3 次變化)至少高於某個數值 <code>drop</code>。</p>



<pre class="wp-block-code"><code lang="python" class="language-python">def get_return_by_seasons(seasons):
  ret = {}
  return_dataset = {}
  for drop in range(-50, 10, 10):
    condition1 = (((operating_profit_ratio - operating_profit_ratio.shift(1)) / 
           abs(operating_profit_ratio.shift(1))).rolling(seasons-1).min()) * 100 &gt; drop
    condition2 = operating_profit_ratio.rolling(seasons).min() &gt; 0

    position = condition1 &amp; condition2
    
    report = backtest.sim(position.loc['2014':], resample="M", upload=False)
    return_series = report.creturn
    return_dataset['seasons'] = seasons
    return_dataset[f"{drop}"] = report.creturn
  return_dataset = pd.DataFrame(return_dataset)
  return return_dataset

return_season_df = pd.concat([get_return_by_seasons(s) for s in [8, 7, 6, 5, 4, 3, 2]])
</code></pre>



<p>上面程式碼分別回測連續 2 到連續 8 個季度，季與季之間變化幅度大於 <code>-50%, -40%, -30%, -20%, -10%, 0%</code> 的情形，使用 <strong>plotly express</strong> 模組，繪製如下：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">import plotly.express as px

fig = px.line(return_season_df, facet_row='seasons', height=1000, title='operating profit ratio backtest')
fig.show()
</code></pre>



<figure class="wp-block-image"><img src="https://i.imgur.com/NMSWGv8.png" alt="NMSWGv8" title="Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正 1"></figure>



<p>觀察到，<code>season = 4</code> 的圖表，較能看出一字排開的現象，表示近 4 季(3 次變化)，可以明顯地區分出各下跌百分比。且報酬率以季與季變化大於 0% 最好。</p>



<p>放大顯示：</p>



<figure class="wp-block-image"><img src="https://i.imgur.com/MSzf1kE.png" alt="MSzf1kE" title="Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正 2"></figure>



<h3 id="營業利益率-vs-股價">營業利益率 v.s. 股價</h3>



<p>有了上述的基礎之後，再來想要知道可否運用較少的資金，也就是選擇股價較低但滿足上述條件的公司買入，取得較高的報酬。<br>因此進一步將股價區分，對不同股價區間的公司作回測，得到最終到報酬率的柱狀圖如下：</p>



<pre class="wp-block-code"><code lang="python" class="language-python">close = data.get('price:收盤價')

def get_return_by_percentage(drop):
  condition1 = (((operating_profit_ratio - operating_profit_ratio.shift(1)) / abs(operating_profit_ratio.shift(1))).rolling(3).min()) * 100 &gt; drop
  condition2 = operating_profit_ratio.rolling(4).min() &gt; 0

  price_range = np.arange(0, 120, 10)
  ret = []
  for s,e in zip(price_range, price_range[1:]):
    condition3 = (close &gt; s) &amp; (close &lt; e)
    position = condition1 &amp; condition2 &amp; condition3
    r = backtest.sim(position.loc['2014':], resample="M", upload=False)
    return_series = r.creturn
    ret.append({'%':drop, 'price_range':f"{round(s,1)}-{round(e,1)}", 'return':return_series[-1]})
  df = pd.DataFrame(ret)
  return df

return_percentage_df = pd.concat([get_return_by_percentage(percentage) for percentage in [-50, -40, -30, -20, -10, -5, 0, 5, 10]])
</code></pre>



<figure class="wp-block-image"><img src="https://i.imgur.com/IWxIwZB.png" alt="" title="Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正 3"></figure>



<p>看起來符合預期，在營業利益率季與季之間變化大於 5% 的族群中(倒數第二欄柱狀圖表)，股價介於 30~40 間的公司報酬率最好，代表著有機會以較低的資金取得較好的報酬。</p>



<p>將績效曲線繪製出來如下：</p>



<figure class="wp-block-image"><img src="https://i.imgur.com/H3z9V5V.png" alt="H3z9V5V" title="Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正 4"></figure>



<h3 id="進一步過濾：好中選好">進一步過濾：好中選好</h3>



<p>只是選擇營業利益穩定的中低股價公司就有不錯的報酬，是否可以進一步過濾出更好的股票呢？</p>



<p>嘗試加入以下兩個條件試試：</p>



<ol><li class="">這季營益率大於上季 ⇒</li></ol>



<p>經營能力變好。 近三月營收平均大於近十二月營收平均 ⇒</p>



<ol><li class="">最近營收成長。</li></ol>



<p>回測績效如下：</p>



<figure class="wp-block-image"><img src="https://i.imgur.com/dSUTkGg.png" alt="dSUTkGg" title="Finlab 量化平台徵稿活動得獎作品 營業利益率選股-安正 5"></figure>



<p>結果也進一步地提升績效，看起來是個不錯的策略。</p>



<h2 id="後續探討">後續探討</h2>



<ul><li class="">試圖加入技術指標或其他濾網</li><li class="">使用其他指標來對營業利益率的分類：<br>有些資本密集的公司(晶圓代工)，由於股本較大，公司本身對費用控管能力較好，卻屬於中低股價。因此本篇用股價區間來區分難免有些偏頗。<br>希望可以改用其他指標(本益比、股價淨值比 …)，找出資本較小，卻有優異的營運管理能力的公司，在股價相對低點買入，以期獲得更好的報酬。</li></ul>



<h2 id="Colab-範例程式碼"><a href="https://colab.research.google.com/drive/1Fx7NoJHHICHSXMJ2_Ny6x6ien1UpPeLs?usp=sharing" class="rank-math-link" target="_blank" rel="noopener">Colab 範例程式碼</a></h2>



<hr class="wp-block-separator"/>



<p><strong><a href="https://hackmd.io/" target="_blank" rel="noreferrer noopener"></a></strong> 28</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/finlab_submit2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3301</post-id>	</item>
		<item>
		<title>徵稿送 FinLab VIP 量化平台會員</title>
		<link>https://www.finlab.tw/finlab_platform_solicit_article_activity/</link>
					<comments>https://www.finlab.tw/finlab_platform_solicit_article_activity/#respond</comments>
		
		<dc:creator><![CDATA[Ben]]></dc:creator>
		<pubDate>Tue, 02 Nov 2021 09:01:38 +0000</pubDate>
				<category><![CDATA[生產力]]></category>
		<category><![CDATA[選股策略]]></category>
		<category><![CDATA[徵稿活動]]></category>
		<guid isPermaLink="false">https://www.finlab.tw/?p=2892</guid>

					<description><![CDATA[只要你信仰科學投資，千萬別錯過這次發光的機會。 FinLab Package 讓大家用最親民的 Python  [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote"><p>只要你信仰科學投資，千萬別錯過這次發光的機會。</p></blockquote>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="497" src="https://www.finlab.tw/wp-content/uploads/2021/11/Picture1-1024x497.png" alt="Picture1" class="wp-image-2923" srcset="https://www.finlab.tw/wp-content/uploads/2021/11/Picture1-1024x497.png 1024w, https://www.finlab.tw/wp-content/uploads/2021/11/Picture1-300x146.png 300w, https://www.finlab.tw/wp-content/uploads/2021/11/Picture1-768x373.png 768w, https://www.finlab.tw/wp-content/uploads/2021/11/Picture1.png 1443w" sizes="(max-width: 1024px) 100vw, 1024px" title="徵稿送 FinLab VIP 量化平台會員 6"></figure>



<p>FinLab Package 讓大家用最親民的 Python 程式語言進入量化交易的大千世界，程式交易的門檻很高，要撰寫爬蟲、數據處理、資料分析、回測設計、資料視覺化、策略調校等等繁瑣的工程。如今 FinLab 打造好了舞台，化繁為簡，為大家省下搭建基礎建設的時間成本與進入門檻，讓量化交易不再難如登天。</p>



<p>目前測試期間，所有 VIP 功能都讓大家免費使用！光是下載這些財經數據，就值回票價，但是這個燒錢的項目，最終還是希望透過永續經營的商業模式達到收支平衡，並透過用戶的參與激盪出更多可能性。</p>



<p>未來到付費制的時候，大家要如何免費來使用呢？不用擔心，我們將舉辦徵稿活動，只要你的文章入選並刊登在 FinLab 部落格，將獲得 VIP 3 個月，相當於台幣近 2000 元的平台使用權利，這個活動目前朝向長期辦理，只要入選 4 次，就可以當一年的 VIP 了！順便來試試看 Finlab Package 的強大之處！不論入選與否，你都能在撰寫文章的過程中增強交易思維，成為更好的量化交易者，可說是穩賺不賠，這麼簡單好康的活動，趕快往下看徵文辦法來參加吧！</p>



<h2>徵文辦法</h2>



<h3>徵文主題</h3>



<p>如何用 FinLab package 玩轉投資科學？<br>可以是研發策略、玩數學、做統計、應用AI演算法、任何可能To the moon的想法我們都歡迎!</p>



<h4>想不到主題嗎？</h4>



<p>可參考 <a href="https://www.finlab.tw/finlab-tw-stock-peg-strategy/" class="rank-math-link">FinLab 部落格文章 : 本益成長比策略</a>以及其他 FinLab 部落格上的內容，如果你的文章段落分明、圖文並茂，又還有清晰簡潔的程式碼，那得獎者非你莫屬！</p>



<h3>獎勵方式與名額</h3>



<p>FinLab 量化平台 VIP 會員權限 3 個月 * <strong>10 名</strong>。</p>



<p>FinLab 亦提供得獎作品發表管道，經得獎者授權同意後，將作品發表於 <a href="https://www.finlab.tw/">Finlab 部落格</a>，讓你除了成為 VIP，還能成為發揮知識影響力的 KOL!</p>



<h3>收件及截稿日期</h3>



<p>自 2021/11/15 起開始收件，2021/12/31 截稿，不要再猶豫了，好好把握這難得的活動！有得學又有得獎機會，一定要參加啦！</p>



<h3>得獎名單揭曉及頒獎日期</h3>



<p>預計於 2022/1/5公佈得獎名單，名單公佈於 <a href="https://www.facebook.com/finlab.python" class="rank-math-link" target="_blank" rel="noopener">FinLab 臉書粉絲團</a>、<a href="https://discord.com/invite/tAr4ysPqvR" class="rank-math-link" target="_blank" rel="noopener">FinLab Discord 官方公告頻道</a>。名單公佈後隔日以 email 寄送 VIP coupon 至獲獎者報名資料留的郵件信箱。擇日公告主辦方評審心得與給投稿者的反饋，我們一起讓知識流動~</p>



<h3>收件方式</h3>



<p>投稿內容以 email 方式寄至 <a href="mailto:finlab.company@gmail.com" class="rank-math-link">finlab.company@gmail.com</a>，<br>信件格式規定如下:</p>



<ul><li>信件標題:<br>FinLab 量化平台徵稿-題目-投稿人姓名，ex: FinLab 量化平台徵稿-動能策略-蔡小倫。</li><li>信件副件:<br>報名表 word 檔 &#8211;<a href="https://docs.google.com/document/d/1o8CL8CNye-j_jAt3WWlr8k-VAs6W7LO0FXyr_EHoj3o/edit?usp=sharing" class="rank-math-link" target="_blank" rel="noopener">下載連結</a>。<br>報名表名稱寄送時請改成 FinLab 量化平台徵稿報名資料-題目-投稿人姓名，ex:  FinLab 量化平台徵稿報名資料-動能策略-蔡小倫。<br>投稿內文使用<a href="https://hackmd.io/?nav=overview" class="rank-math-link" target="_blank" rel="noopener">hack.md編輯器</a>撰寫，hack.md文檔連結填寫於報名資料文件內。<br>著作權同意書使用電子簽名簽署(或貼上簽名截圖)後回傳。</li></ul>



<h3>徵文規定</h3>



<ul><li>須以中文創作。</li><li>每個人僅可投稿一篇。</li><li>內容需用到 FinLab 模組或網站功能，想知道模組如何使用可以參考這篇 <a href="https://www.finlab.tw/finlab_platform_intro/" class="rank-math-link">入門文章</a> 喔！我們有詳細的 <a href="https://ai.finlab.tw/document" class="rank-math-link" target="_blank" rel="noopener">API 文檔</a> 與豐富的 <a href="https://ai.finlab.tw/database" class="rank-math-link" target="_blank" rel="noopener">資料庫</a> 等你來探索。</li><li>格式不限，字數不限。</li></ul>



<h3>評審方式</h3>



<p>評判標準為邏輯合理性、策略體質、代碼清晰度、實戰可行性、思維創新、延伸發展潛力、整體內容完整性。<br>由 Finlab團隊審核。作品如未達水準，得由評審決定從缺。</p>



<h3>注意事項</h3>



<ol><li>請依照參賽辦法寄送規定的信件內容與檔案，缺件者會通知補件事宜，但僅以一次為限。</li><li>因內容會被評審觀看或於得獎後發表於 Finlab 部落格，若策略涉及個人隱私或 保密性質，內容請自行拿捏或斟酌投稿與否，邏輯概念可點到為止，評審自有判斷。</li><li>若對徵稿活動或程式開發上遇到任何問題，可來信 finlab.company@gmail.com 附上你的問題來洽詢意見，或到 <a href="https://discord.com/invite/tAr4ysPqvR" target="_blank" rel="noopener">FinLab Discord</a> 討論。</li><li>抄襲或者侵害他人著作權之作品，除取消得獎資格、追回獎項，並公布違規情形事實外，投稿者終生不得參加 Finlab 徵文活動，且一切法律責任由參加者自行負責。</li><li>得獎者同意無償授權芬嚮資訊有限公司（ FinLab 財經實驗室）將得獎作品發表於 FinLab 部落格，並以合理方式利用，不需另支稿酬及版稅。</li><li>本辦法如有未盡事宜，得隨時修訂補充。</li></ol>
]]></content:encoded>
					
					<wfw:commentRss>https://www.finlab.tw/finlab_platform_solicit_article_activity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2892</post-id>	</item>
	</channel>
</rss>
