SlideShare une entreprise Scribd logo
1  sur  78
Télécharger pour lire hors ligne
Be A GambleR
Chia-Chi@OpenCommunityCamp
20160827
大家好 ...
我是家齊 ...
TW.R & MLDM Monday 共同創辦人
木刻思股份有限公司 共同創辦人
TW.R & MLDM Monday
成立於 2012/09 ... 第一次聚會在 2012/10/15
每年 10 月週年慶時 ... 都總會回顧一下 ...
這個社群 &聚會 ... 是怎樣開始的 ... ?
今天比較特別 ...
所以 ... 想分享一個比較少人知道的故事 ...
一開始 ...
其實 ... 我是看了一本書 ...
看到另一個社群 ...
所以 ...
我決定仿照它弄一個 ...
Logo 很像吧 !
有點想去做新版 Logo 的貼紙
如果有人認識優質貼紙店
請推薦給我 ... !
快四年了 ...
TW.R & MLDM Monday
有著數不盡的人
所共同付出而達成的
沒有他們 ...
就沒有社群 ...
11
http://www.meetup.com/Taiwan-R/
後來有一天 ...
出現了 RLadies ...
詳細情形大家去問主持人 Yen + 1 (共同創辦人)
14
特別感謝 ... George哥@木刻思 ...
長期在社群付出奉獻 ... 大家才有穩定的影片能看 ...
我不會運彩 ...
雖然 ... 木刻思危險基金會投注運彩 ... XD
以個人來說 ... 我主要的投資標的是選擇權 ...
然後偶爾玩玩樂透 ...
所以 ... 今天的主題 ...
會 Cover 到一點點 quantmod & quantstrat
還有很多很多的樂透機率算 !
在開始演講前
想先調查一下現場聽眾
近一年內 ...
有買過樂透的朋友 ?
你買彩卷時 ...
不知道當年度最常出現的號碼的 ?
一向都用電腦選號的 ?
你相信 ...
彩卷的號碼是有規律的 ?
你相信 ...
彩卷的號碼是沒有規律的 ?
對於,不相信的朋友 ...
是驗證過,嘗試過,發現沒有 pattern,才不相信?
還是是沒驗證過,沒嘗試過,直接不相信?
對賭徒來說 ...
最重要的兩件事
瘋險控管
不對稱資訊
瘋險的種類 ?
● 猜錯行情 (Prediction)
○ 在該下注時,不下
○ 再不該下時,拼命下
● 下注數量控制失衡 (Position Sizing)
○ 輸的時候,下注過大
○ 贏得時候,下注太小
● 陷入負期望值,而未自覺
瘋險控管的核心
(1) 套利 Versus 套損
(2) 勝率 Versus 賠率
以股票為例
什模是賺錢的唯一法則呢 ?
賺錢的唯一法則 ?
低買高賣
賺錢的唯一法則 ?
● 行情向上時,先低買,後高賣
● 行情向下時,先高賣,後低買
市場上有兩種 Trader
Buy-Side / Sell-Side
Trend Follower / Mean Reversion
high p, low WLR / low p, High WLR
什麼是高?什麼是低?
標準是 ...... ?
兩種 Traders:
● Type I (Trend Follower)
○ 順勢操作,追高殺低
○ 低勝率,高報酬
● Type II (Mean Reversion)
○ 逆勢操作,買黑賣紅
○ 高勝率,低報酬
套損 Versus 套利
E = pW - (1-p)L - T > 0
套損 Versus 套利
假設 T = 0, WLR = W/L
p > 1 / (1+WLR)
對賭徒來說 ...
最重要的兩件事
瘋險控管
不對稱資訊
以 coin tossing 為例 ...
你相信 ...
投擲硬幣正面和反面的機率是平均的 ?
你覺得 ...
投擲硬幣正面和反面的機率是多少呢 ?
這些機率,受到什模影響呢 ?
大家覺得 ...
P(H) = ? and P(T) = ?
P(H| ?? ) = ? and P(T | ??) = ?
大家覺得 ...
什模是 "機率" ?
(這其實是今天演講中,最重要的問題之一 !)
樂透的空間 pattern
各個號碼出現的次數 ?
tidyr::
gather ->
<- spread
<- Spread
平均 ... ?
但如果看條件機率呢 ?
利用條件機率進行預測
P(Xt | Xt-1)
利用條件機率進行預測
P(Xt | Xt-k)
策略回測
E = W*p - L*(1-p)
首先 ...
要知道 W =? L =?
Avoid Overfitting
Walk Forward Analysis
Walk Forward Analysis
樂透的時間 pattern
各個號碼出現的 Stopping Time ?
怎樣才是 ...
正確的週期 ?正確的時間尺度 ?
來看空間的 pattern !
進擊的條件機率進行預測
P(DISTt | DISTt-1)
如果您覺得 ...
以上內容還不錯精彩 ...
希望自己也能擁有相關的概念和技能 …
歡迎到木刻思粉絲團許願開爬蟲課
或是報名正在招生的 ETL & DataViz 課程
quantmod 101
zoo / xts / TTR
Key Features in quantmod
● Time Series Object: zoo, xts
● Data Importers: getSymbols
● Technical Analysis: TTR
● Draw Candlestick Lines: chartSeries
quantstrat 101
quantmod / blotter / FinancialInstrument /
PerformanceAnalytics / foreach
https://r-forge.r-project.org/R/?group_id=316
Key Features in quantstrat
● Strategy Construction Tools:
○ Indicator
○ Signal
○ Rule
● Transaction-Oriented Trading Systems:
○ [blotter] Portiforlio
○ [blotter] Account
○ [quantstrat] Order
在國內 ... 蒐集金融資料 ...
如果要跟 R 對接 ... 通常都少不了 …
R.NET & MRO & MRS
(因為國內期貨商都只有 Win APIs)
可以選擇 ...
microsoft-r-open-blas
或是
intel MKL (RevoMath in ArchLinux)
感謝大家 !
c3h3.tw@gmail.com
如果想學習更多 ...
關於多機器 Cluster 的架構與部屬的話 ...
可以參考一下 PhillipZ 之後的 Docker 進階課 ...
不過 ... 這門課的內容真的非常進階唷 ... !
聽說會學到很潮的 Docker Swarm Cluster …
好像還有 Nvidia Docker 可以跑 Deep Learning ...

Contenu connexe

En vedette

What is data engineer?資料工程師是什麼?
What is data engineer?資料工程師是什麼?What is data engineer?資料工程師是什麼?
What is data engineer?資料工程師是什麼?Anna Yen
 
資料視覺化的力量
資料視覺化的力量資料視覺化的力量
資料視覺化的力量Johnson Hsieh
 
华为软件定义存储架构分析
华为软件定义存储架构分析华为软件定义存储架构分析
华为软件定义存储架构分析Liang Ming
 
Tensor flow (1)
Tensor flow (1)Tensor flow (1)
Tensor flow (1)景逸 王
 
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)Ye (Julia) Li
 
Hadoop程式開發環境
Hadoop程式開發環境Hadoop程式開發環境
Hadoop程式開發環境立鼎 蘇
 
第二讲 Python基礎
第二讲 Python基礎第二讲 Python基礎
第二讲 Python基礎juzihua1102
 
萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普Poga Po
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classificationYiwei Chen
 
Spark Introduction
Spark IntroductionSpark Introduction
Spark IntroductionKevin Zhang
 
数据挖掘理论与实践
数据挖掘理论与实践数据挖掘理论与实践
数据挖掘理论与实践medcl
 
Fundonomy线路图与团队
Fundonomy线路图与团队Fundonomy线路图与团队
Fundonomy线路图与团队Avtar Sehra
 
elastic search分析与实践
elastic search分析与实践elastic search分析与实践
elastic search分析与实践williams2014
 
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置Liu Kate
 
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立Xiaoli Wu
 
Yisou intro
Yisou introYisou intro
Yisou introSong Hou
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆KAI CHU CHUNG
 

En vedette (17)

What is data engineer?資料工程師是什麼?
What is data engineer?資料工程師是什麼?What is data engineer?資料工程師是什麼?
What is data engineer?資料工程師是什麼?
 
資料視覺化的力量
資料視覺化的力量資料視覺化的力量
資料視覺化的力量
 
华为软件定义存储架构分析
华为软件定义存储架构分析华为软件定义存储架构分析
华为软件定义存储架构分析
 
Tensor flow (1)
Tensor flow (1)Tensor flow (1)
Tensor flow (1)
 
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
 
Hadoop程式開發環境
Hadoop程式開發環境Hadoop程式開發環境
Hadoop程式開發環境
 
第二讲 Python基礎
第二讲 Python基礎第二讲 Python基礎
第二讲 Python基礎
 
萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classification
 
Spark Introduction
Spark IntroductionSpark Introduction
Spark Introduction
 
数据挖掘理论与实践
数据挖掘理论与实践数据挖掘理论与实践
数据挖掘理论与实践
 
Fundonomy线路图与团队
Fundonomy线路图与团队Fundonomy线路图与团队
Fundonomy线路图与团队
 
elastic search分析与实践
elastic search分析与实践elastic search分析与实践
elastic search分析与实践
 
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置
高雄醫學大學醫務管理暨醫療資訊學系專題成果報告書 - 老人衰弱指標系統之建置
 
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立
9月8日-分会场8-行业解决方案-06-基于AWS的国际个人基因组服务-吴晓立
 
Yisou intro
Yisou introYisou intro
Yisou intro
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆
 

Plus de Chia-Chi Chang

how to learn quantmod and quantstrat by yourself
how to learn quantmod and quantstrat by yourselfhow to learn quantmod and quantstrat by yourself
how to learn quantmod and quantstrat by yourselfChia-Chi Chang
 
Communicate with your data 20170104
Communicate with your data 20170104Communicate with your data 20170104
Communicate with your data 20170104Chia-Chi Chang
 
20161110 quantstrat in seattle
20161110 quantstrat in seattle20161110 quantstrat in seattle
20161110 quantstrat in seattleChia-Chi Chang
 
20130506 mldm monday intorduction to quantmod package
20130506 mldm monday intorduction to  quantmod package20130506 mldm monday intorduction to  quantmod package
20130506 mldm monday intorduction to quantmod packageChia-Chi Chang
 
Computing Probabilities With R: mining the patterns in lottery
Computing Probabilities With R: mining the patterns in lotteryComputing Probabilities With R: mining the patterns in lottery
Computing Probabilities With R: mining the patterns in lotteryChia-Chi Chang
 
PyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessPyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessChia-Chi Chang
 
20160827 open community camp
20160827 open community camp20160827 open community camp
20160827 open community campChia-Chi Chang
 
20130325 mldm monday spide r
20130325 mldm monday spide r20130325 mldm monday spide r
20130325 mldm monday spide rChia-Chi Chang
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Chia-Chi Chang
 
素食丙級考試流程重點整理
素食丙級考試流程重點整理素食丙級考試流程重點整理
素食丙級考試流程重點整理Chia-Chi Chang
 

Plus de Chia-Chi Chang (13)

Power BI x R
Power BI x RPower BI x R
Power BI x R
 
how to learn quantmod and quantstrat by yourself
how to learn quantmod and quantstrat by yourselfhow to learn quantmod and quantstrat by yourself
how to learn quantmod and quantstrat by yourself
 
Communicate with your data 20170104
Communicate with your data 20170104Communicate with your data 20170104
Communicate with your data 20170104
 
20161110 quantstrat in seattle
20161110 quantstrat in seattle20161110 quantstrat in seattle
20161110 quantstrat in seattle
 
20130506 mldm monday intorduction to quantmod package
20130506 mldm monday intorduction to  quantmod package20130506 mldm monday intorduction to  quantmod package
20130506 mldm monday intorduction to quantmod package
 
Computing Probabilities With R: mining the patterns in lottery
Computing Probabilities With R: mining the patterns in lotteryComputing Probabilities With R: mining the patterns in lottery
Computing Probabilities With R: mining the patterns in lottery
 
ETL in R
ETL in RETL in R
ETL in R
 
PyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darknessPyData SF 2016 --- Moving forward through the darkness
PyData SF 2016 --- Moving forward through the darkness
 
20160827 open community camp
20160827 open community camp20160827 open community camp
20160827 open community camp
 
20130325 mldm monday spide r
20130325 mldm monday spide r20130325 mldm monday spide r
20130325 mldm monday spide r
 
20130107 MLDM Monday
20130107 MLDM Monday20130107 MLDM Monday
20130107 MLDM Monday
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
 
素食丙級考試流程重點整理
素食丙級考試流程重點整理素食丙級考試流程重點整理
素食丙級考試流程重點整理
 

20160827 open community camp