Slide 1

Slide 1 text

Yo-An Lin (c9s) 2020 Nov 1 Go Crypto Trading Build your own crypto trading bot in few minutes.

Slide 2

Slide 2 text

Cryptos? Really?

Slide 3

Slide 3 text

2008 Bitcoin

Slide 4

Slide 4 text

Let’s go back to 2008

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Bank-based Financial System

Slide 7

Slide 7 text

Public Finance

Slide 8

Slide 8 text

How Government Bond Works Interest

Slide 9

Slide 9 text

How Corporate Bond Works? Interest Issue corporate bond Corporate Fund Individuals Individuals Individuals

Slide 10

Slide 10 text

How Junk Bond Works? Interest (high yield) Issue corporate bond Corporate (Low Credit Rating) Bank Investor High yield bond

Slide 11

Slide 11 text

Securitization Bundled Mortgages Bank Investor Investor Investor

Slide 12

Slide 12 text

Government National Mortgage Association 吉利美

Slide 13

Slide 13 text

Government Sponsored Enterprise 房地美

Slide 14

Slide 14 text

名稱都有 Government

Slide 15

Slide 15 text

其實都是私⼈機構

Slide 16

Slide 16 text

房利美可以購買非政府擔保的房貸債權 並證券化來發⾏抵押債券

Slide 17

Slide 17 text

吉⼒美只為抵押債券提供擔保 沒有美國政府信⽤擔保

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Bank Run 銀⾏擠兌

Slide 20

Slide 20 text

QE Corporation (Low Credit Rating) Corporation Financial Institutions Lower Interest Rate

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Yes, Your Bank Can Fail

Slide 23

Slide 23 text

This is not the first time

Slide 24

Slide 24 text

存在銀⾏裡的錢 銀⾏會拿去投資

Slide 25

Slide 25 text

不同銀⾏的投資比例不同

Slide 26

Slide 26 text

虧錢的投資變成壞帳

Slide 27

Slide 27 text

授信弊案也會變成壞帳

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

1930 年經濟⼤蕭條

Slide 30

Slide 30 text

Glass-Steagall Act 格拉斯-斯蒂格爾法案

Slide 31

Slide 31 text

對美國銀⾏系統進⾏改⾰的法律,描述了 1933年銀⾏法分離商業銀⾏和投資銀⾏ 業務的四個規定 美國聯邦存款保險公司是依此法成立。這 部法律的⽬的在於對投機採取⼀些控制措 施。

Slide 32

Slide 32 text

允許聯邦儲備系統調節存儲帳號的利息, 被1980年儲蓄機構解除管制和貨幣控制 法取消 禁⽌銀⾏控股公司擁有其它⾦融公司的規 定被1999年11⽉12⽇⽣效的⾦融服務法 現代化法案取消

Slide 33

Slide 33 text

那 2008 年之後呢?

Slide 34

Slide 34 text

沃爾克法則 由美聯儲1979-1987年的前主席、前任美國 總統經濟複蘇顧問委員會主席 Paul Volcker 提出

Slide 35

Slide 35 text

禁⽌銀⾏從事⾃營性質的投資業務 禁⽌銀⾏擁有、投資或發起對沖基⾦和私募 基⾦

Slide 36

Slide 36 text

那現在呢?

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

歷史⼀直在重演

Slide 40

Slide 40 text

⽤區塊鏈達成去中⼼化⾦融 Decentralized Finance

Slide 41

Slide 41 text

由機器來⾃動處理轉帳、放貸

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

有⼈把 Bitcoin 視為

Slide 44

Slide 44 text

美元或歐元以外的避險資產

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Bitcoin 2019~2020 1w interval

Slide 47

Slide 47 text

為何要做加密貨幣交易?

Slide 48

Slide 48 text

傳統⾦融市場

Slide 49

Slide 49 text

開盤時間 收盤時間

Slide 50

Slide 50 text

交易額度限制

Slide 51

Slide 51 text

漲停跌停

Slide 52

Slide 52 text

相對封閉的市場

Slide 53

Slide 53 text

加密貨幣⾦融市場

Slide 54

Slide 54 text

24H 全年無休交易所

Slide 55

Slide 55 text

可隨時轉出轉入全球交易所

Slide 56

Slide 56 text

新世代的交易系統

Slide 57

Slide 57 text

以及更有效率的撮合引擎

Slide 58

Slide 58 text

相對透明的交易市場

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

Slide 61

Slide 61 text

為什麼要⾃動交易?

Slide 62

Slide 62 text

情緒⼲擾交易

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

正確的交易⼼態 Trading Attitude

Slide 68

Slide 68 text

我對錢沒有興趣

Slide 69

Slide 69 text

Algorithmic Trading

Slide 70

Slide 70 text

Algorithmic trading is a method of executing orders using automated pre-programmed trading instructions accounting for variables such as time, price, and volume. This type of trading was developed to make use of the speed and data processing advantages that computers have over human traders.

Slide 71

Slide 71 text

Quantitative analysis is the use of mathematical and statistical methods (mathematical finance) in finance. Those working in the field are quantitative analysts (or, in financial jargon, a quant).

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

James Simons American mathematician, Billionaire hedge fund manager, Former research staff of the Communications Research Division of the Institute for Defense Analyses (IDA)

Slide 74

Slide 74 text

⽂藝復興是全世界名氣最響的對沖基⾦公司之⼀,其創始⼈詹姆斯· ⻄蒙斯 (James Simons) 堪稱傳奇⼈物。他有很多外號,比如“華爾 街最賺錢的數學家”、“全球最賺錢的基⾦經理”、“量化交易之 ⽗”等。 Renaissance Technologies

Slide 75

Slide 75 text

根據彭博社億萬富翁指數 (Bloomberg Billionaire Index) 顯⽰,Simons 在 2016 年的⾝家⼤約值 155 億美元左右。根據 Hedge Fund Research 報導,James Simons 在 2016 年的收入為 16 億美元,位於世界對沖基⾦經理收入榜單⾸位。

Slide 76

Slide 76 text

⼤獎章對沖基⾦ 成立於 1988 年。“⼤獎章”是⼀個典型的量化“⿊盒⼦”基⾦,其交易策 略都是基於複雜的電腦程式碼和演算法,外⼈無從知道它的交易規 則。 Medallion

Slide 77

Slide 77 text

The Man Who Solved the Market: How Jim Simons Launched the Quant Revolution

Slide 78

Slide 78 text

交易策略 Trading Strategy

Slide 79

Slide 79 text

選擇交易商品

Slide 80

Slide 80 text

定義進場與出場條件

Slide 81

Slide 81 text

• Market neutral strategy • Swing trading strategy • News trading strategy • Signal trading strategy • Day trading • ……

Slide 82

Slide 82 text

Market Neutral Strategy

Slide 83

Slide 83 text

Pure Market Making

Slide 84

Slide 84 text

Place Sell Order Place Buy Order

Slide 85

Slide 85 text

Cross Exchange Market Making

Slide 86

Slide 86 text

Hedging is a strategy for reducing exposure to investment risk. An investor can hedge the risk of one investment by taking an offsetting position in another investment. The values of the offsetting investments should be inversely correlated.

Slide 87

Slide 87 text

Cross Exchange Market Making

Slide 88

Slide 88 text

Cross Exchange Market Making

Slide 89

Slide 89 text

SELL BUY BUY BACK SELL Hedge Low Risk

Slide 90

Slide 90 text

Swing Trading

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

Grid Trading

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

Bollinger-Band Grid Trading

Slide 95

Slide 95 text

upper price lower price

Slide 96

Slide 96 text

BBGO The Open Source Crypto Trading Framework

Slide 97

Slide 97 text

BBGO Trading framework • Open Source & Transparency - you run what you can see. • KISS principle designed framework - simple, easy to use for users. • Minimalist design strategy interface - ~20 lines go code to implement a new strategy. • One config to rule them all. • Multi-exchange session support. • Run multiple strategies in one process.

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

Exchange RESTful API WebSocket FIX protocol BBGO Balance Update Trade Update Order Update Place Order Matching Engine Order Book Strategy #1 Strategy #2 Strategy #3 Public Market Data

Slide 100

Slide 100 text

Public Market Data?

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

Bid Orders Ask Orders

Slide 103

Slide 103 text

買單掛的價格未成交,會被掛在買單簿上 = maker 賣單掛的價格未成交,會被掛在賣單簿上 = maker

Slide 104

Slide 104 text

Best Bid Best Ask

Slide 105

Slide 105 text

Best Bid Sell Order @ 16,342.75 賣單直接與買單成交 = taker

Slide 106

Slide 106 text

Best Ask Buy Order @ 16,342.76 買單直接與第⼀檔賣單成交 = taker

Slide 107

Slide 107 text

One Config File to Run Multiple Strategies

Slide 108

Slide 108 text

exchangeStrategies: - on: binance bollgrid: symbol: BTCUSDT interval: 5m gridNumber: 20 quantity: 0.01 profitSpread: 30.0 策略可以掛在任何⼀個交易所

Slide 109

Slide 109 text

exchangeStrategies: - on: binance bollgrid: symbol: BTCUSDT interval: 5m gridNumber: 20 quantity: 0.01 profitSpread: 30.0 策略設定檔

Slide 110

Slide 110 text

基礎風險控制

Slide 111

Slide 111 text

riskControls: sessionBased: # "binance" is the session name that you want to configure the risk control binance: # orderExecutor is one of the risk control orderExecutor: # symbol-routed order executor bySymbol: BTCUSDT: # basic risk control order executor basic: minQuoteBalance: 100.0 maxBaseAssetBalance: 3.0 minBaseAssetBalance: 0.0 maxOrderAmount: 1000.0 下單的風險控管

Slide 112

Slide 112 text

開發⾃⼰的交易策略? Writing your own trading strategy?

Slide 113

Slide 113 text

You Only Need Two Methods

Slide 114

Slide 114 text

type Strategy struct { Symbol string `json:"symbol"` } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) { } func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error { return nil }

Slide 115

Slide 115 text

Connecting Your Strategy

Slide 116

Slide 116 text

func init() { bbgo.RegisterStrategy("skeleton", &Strategy{}) } type Strategy struct { Symbol string `json:"symbol"` } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) { session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"}) } func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error { session.Stream.OnKLineClosed(func(kline types.KLine) { _, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ Symbol: kline.Symbol, Side: types.SideTypeBuy, Type: types.OrderTypeMarket, Quantity: 0.01, }) if err != nil { log.WithError(err).Error("submit order error") } }) return nil } 註冊交易策略

Slide 117

Slide 117 text

func init() { bbgo.RegisterStrategy("skeleton", &Strategy{}) } type Strategy struct { Symbol string `json:"symbol"` } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) { session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"}) } func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error { session.Stream.OnKLineClosed(func(kline types.KLine) { _, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ Symbol: kline.Symbol, Side: types.SideTypeBuy, Type: types.OrderTypeMarket, Quantity: 0.01, }) if err != nil { log.WithError(err).Error("submit order error") } }) return nil } 策略的 struct, ⽤來讀設定

Slide 118

Slide 118 text

func init() { bbgo.RegisterStrategy("skeleton", &Strategy{}) } type Strategy struct { Symbol string `json:"symbol"` } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) { session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"}) } func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error { session.Stream.OnKLineClosed(func(kline types.KLine) { _, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ Symbol: kline.Symbol, Side: types.SideTypeBuy, Type: types.OrderTypeMarket, Quantity: 0.01, }) if err != nil { log.WithError(err).Error("submit order error") } }) return nil } 策略訂閱 K-line 資料

Slide 119

Slide 119 text

func init() { bbgo.RegisterStrategy("skeleton", &Strategy{}) } type Strategy struct { Symbol string `json:"symbol"` } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) { session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: "1m"}) } func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error { session.Stream.OnKLineClosed(func(kline types.KLine) { _, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ Symbol: kline.Symbol, Side: types.SideTypeBuy, Type: types.OrderTypeMarket, Quantity: 0.01, }) if err != nil { log.WithError(err).Error("submit order error") } }) return nil } K-line 結束就下單

Slide 120

Slide 120 text

內建布林網格通道策略 Built-in Bollinger Grid Strategy

Slide 121

Slide 121 text

網格到底賺錢嗎?

Slide 122

Slide 122 text

固定價格區間網格

Slide 123

Slide 123 text

固定價位網格獲利能⼒

Slide 124

Slide 124 text

BTC HODL

Slide 125

Slide 125 text

抱著 BTC 不動 都賺得比固定網格多

Slide 126

Slide 126 text

鄉⺠曬單通常都曬 ETH 因為波動比 BTC ⼩

Slide 127

Slide 127 text

答案是可以 但是可以賺更多嗎?

Slide 128

Slide 128 text

讓網格不要再進場

Slide 129

Slide 129 text

價格拉升速度快突破 EWMA 很多的時候預計會有拉回,不要再下買單

Slide 130

Slide 130 text

獲利多⼀倍

Slide 131

Slide 131 text

Thank You

Slide 132

Slide 132 text

Disclaimer: TradeAtYourOwnRisk

Slide 133

Slide 133 text

投資⼀定有風險,基⾦投資有賺有賠,申購前應詳閱公開說明書。

Slide 134

Slide 134 text

可能沒時間 Q & A 但可以來我們公司找我討論

Slide 135

Slide 135 text

No content

Slide 136

Slide 136 text

全台第⼀家加密貨幣實體⾨市 ⾨市⼈員與客⼾⾯對⾯介紹交易 平台產品 同時活動展演廳不定時會舉辦區 塊鏈主題講座與知識課程,活絡 加密貨幣社群與開拓新會員。

Slide 137

Slide 137 text

MAX 9USDT REFERAL https://bit.ly/max-9usdt