Mark Hsu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 財務演算法 ### Basic Financial Mathematics 基礎財務數學 - 複利(Compounding)公式:$FV=PV(1+r)^n~\rightarrow~FV=PV(1+r/m)^{nm}$ - 折現(Discounted)公式:$~~~~~PV=FV(1+r)^{-n}$ - $r:年利率。~~~m:複利頻率。$ - 房貸:$m=12$,一年後$(1+\frac{r}{12})^{12}$ - 公債:$m=2$,一年後$(1+\frac{r}{2})^{2}$ - $m=\infty$,一年後$e^r$ - Annuty年金:每年支付C元,持續n年 - $FV=\sum\limits_{i=0}^{nm-1} C(1+r/m)^i=C\frac{(1+r/m)^{nm}-1}{r/m}$ - $PV=\sum\limits_{i=1}^{nm} C(1+r/m)^{-i}=C\frac{1-(1+r/m)^{-nm}}{r/m}$ - Mortgage房貸 - 可以看成每期償還:本金 principal / 利息 interest。 - 貸款loan元,n年還清,每年利率 r%,則每期要還金額C為 - $c=loan\times \frac{r/m}{1-(1+r/m)^{-nm}}$ = 該期本金+該期利息 - 在第k期時,想付完remaing principal - $\sum\limits_{i=1}^{nm-k} C(1+r/m)^{-i}$ - Yield 殖利率 - MEY:房價等價報酬率 - BEY:債券等價報酬率 - IRR:內部報酬率 - 算根的方式 - 方法一:Bisection Method - 方法二:Newton-Raphson Method - 方法三:Secant Method - 雙變數:Jacobian - 實務上:解跟很麻煩,直接使用套件操作。 - Bond 債券 - Zero-Coupon Bonds 零息債券 - n 期後付 F 元 - 理論現值 P = $\frac{F}{(1+r/m)^n}$ - Level-Coupon Bonds 平息債券 - n 期後付 F 元,且每期付 C 元 **(C=F $\times$ coupon rate / m)** - 理論現值 P = $\sum\limits_{i=1}^{n}\frac{C}{(1+r/m)^i}~+~\frac{F}{(1+r/m)^n}$ &emsp;&emsp;&emsp; = $C\frac{1-(1+r/m)^{-n}}{r/m}~+~\frac{F}{(1+r/m)^n}$ - 該公式中F,C,m都為給定的,因此可以得知 P 和 r 的關係 - YTM 到期收益率:滿足債券現值、F、C的那一個報酬率 r - 給定P越大,YTM越小,其圖形為凸向原點 - **在市場均衡的情況下,可以由債券價格判斷coupon rate跟市場利率的關係** - Par Bonds:P=F時,coupon rate=市場利率 - Premium Bonds:P>F時,coupon rate>市場利率 - Discount Bonds:P<F時,coupon rate<市場利率 - DayCount - Actual/Actual:實際有幾天 - 30/360: - 360×(y2−y1) + 30×(m2−m1) + (d2−d1) - 360×(y2−y1) + 30×(m2−m1−1) + max(30−d1,0) + min(d2,30). - 應計利息 - 假設離付息日還有 w % 天。 - Accured interest = C $\times$ (1-w) - &emsp;**Full price = Clean Price + Accrued Interest = $\sum\limits_{i=0}^{n-1}\frac{C}{(1+r/m)^{w+i}}~+~\frac{F}{(1+r/m)^{w+n-1}}$** ### Bond Price Volatility 債券價格波動性 - Price Volatility價格波動性 = $-\frac{\frac{\partial P}{\partial y}}{P}$ - 負號:價格和利率變化是負向波動,但希望是正值 - $-\frac{\frac{\partial P}{\partial y}}{P}=-\frac{(C/y)n-(C/y^2)((1+y)^{n+1}-(1+y))-nF}{(C/y)((1+y)^{n+1}-(1+y))+F(1+y)}\gt 0$ - $Macaulay Duration(MD)=\frac{1}{P}\sum\limits_{i=1}^{n}\frac{C_i}{(1+y)^i}i=-(1+y)\frac{\partial P}{\partial y}\frac{1}{P}$ - 代表存續期間(零息債券:MD=n,含息債券:MD<n) - 也代表波動性 - 只有建立在C,F,n都和yield 互相 independent 的前提下 - $Modified~Duration=-\frac{\partial P}{\partial y}\frac{1}{P}=\frac{MD}{(1+y)}$ - **價錢變化量 = - Modified Duration * 利率變化量** - $Effective~Duration=\frac{P_--P_+}{P_0~(y_+-y_-)}$ - 某些商品無法代公式,只能用近似值 - 也可能只帶入$\frac{P_0-P_+}{P_0~\Delta y}$ - $Dollar~Duration=Modified~Duration * P$ - 可以用來衡量利率變動如何影響價錢變動 - 把部位的大小考慮進來 - $Convexity=\frac{\partial^2P}{\partial y^2}\frac{1}{P}$ - 高凸性適合投資 - 但理論上不能套利(因為理論中都假設利率變化是瞬間) - $convexity~in~years=\frac{convexity~in~ periods}{k^2}$ - **價錢變化量 = -Duration\*利率變化量 + $\frac{1}{2}$convexity$\Delta y^2$** - $D_{\%}=D,~~C_\%=C/100$ - $Effective~Convexity=\frac{P_++P_--2P_0}{P_0(0.5\times(y_+-y_-))^2}$ - 實務上如何選擇$\Delta y$是一件困難的事情。 ### Term Structure Of Interest Rate 利率期限結構 - Term Structure Of Interest Rate - 評估資產價值的第一步驟,核心為看不同到期日下的YTM變化 - Spot Rate(即期利率) - $S(i)$:i期零息債券的YTM - $d(i)=[1+S(i)]^{-i}$:貼現因子 - 如何得到spot rate: - 定義:藉由i期零息債券,$P=\frac{F}{[1+S(i)]^i}$,算出S(i) - 變化:藉由1期到n期含息債券,依序算出S(1),...S(n) - 稱為bootstraping,存在O(n)算完所有spot rate的演算法。 - 利率會隨著時間波動,第i期現金流量要用S(i)折現 - $P=\sum\limits_{i=1}^{n}{\frac{C}{[1+S(i)]^{i}}}+{\frac{F}{[1+S(n)]^n}}=\sum\limits_{i=1}^{n}C_id(i)$ - Yield Spread報酬率價差 - risk和riskless債券,YTM的差異。 - $P<\sum\limits_{t=1}^{n}\frac{C_t}{[1+S(t)]^t}$ - Static Spread零波動率價差 - 滿足$P=\sum\limits_{t=1}^{n}\frac{C_t}{[1+s+S(t)]^t}$ 的那個s - Forward Rate遠期利率 - The maturity strategy:$[1+S(j)]^j$ - The rollover strategy:$[1+S(i)]^i[1+S(i,j)]^{j-i}$ - i期後S(i,j)多少時,可以兩策略報酬率相同 - $f(i,j)=[\frac{[1+S(j)]^j}{[1+S(i)]^i}]^{1/(j-i)}-1$ - Instantancous forward rate - $S(i,i+1)$的forward rate - ![](https://i.imgur.com/jMBUPLQ.png) - yield curve表示用含息債券算出的YTM - spot rate curve表示用零息債券算出的YTM - forward rate curve是給定spot rate後算出 - Forward Rate和Spot Rate關係為$[1+S(n)]^n=[1+S(1)][1+f(1,2)]...[1+f(n-1,n)]$ - spot rate是forward rate的幾何平均 - Forward Loan未來貸款 - 買:n期現值$1/(1+S(n))^n$元債券, (一張) - n期後可得到$1$元 - 賣:m期現值$1/(1+S(n))^n$元債券, ($(1+S(m))^m/(1+S(n))^n$張) - m期後要還$(1+S(m))^m/(1+S(n))^n$元 - 相當於未來貸款,第n~m期有$f(n,m)$的報酬率 - spot rate curve必須滿足,所有$f(n,m)\geq0$,否則可以套利。 - Synthetic Bond合成債券 - 當買不到特定期限的零息債券時可以使用 - n-period zero - m-period zero $\rightarrow$ forward loan - n-period zero + forward loan $~\rightarrow$ m-period zero - 連續複利模型 - $P=\sum\limits_{i=1}^{n}Ce^{-iS(i)}+Fe^{-nS(n)}$ - 貼現因子:$d(n)=e^{-nS(n)}$ - $nS(n)=f(0,1)+f(1,2)+...+f(n-1,n)$ - $f(i,j)=\frac{jS(j)-iS(i)}{j-i}$ - $f(j,j+1)=ln\frac{d(j)}{d(j+1)}$ - Unbiased Expectations Theory - $f(a,b)=E[S(a,b)]$ - 很直觀,但實務上不對 - $E[\frac{1}{1+S(1,2)}]=\frac{1}{E[1+S(1,2)]}$ ### Fundamental Statical - 動差 - $~~~~~Var[X]=E[(X-\mu_X)^2]$ - $Cov[X,Y]=E[(X-\mu_X)(Y-\mu_Y)]$ - 相關 - $\sigma_x=\sqrt{Var[X]}$ - $\rho_{X,Y}=\frac{Cov[X,Y]}{\sigma_X~~\sigma_Y}$ - 線性組合變異數 - $Var[\sum a_iX_i]=\sum\sum a_ia_jCov[X_i,x_j]$ - 條件期望值 - $E[X]=E[~E[X|I]~]$ - 如果$I_1\subset I_2$ ,則 $E[X|I_1]=E[~E[X|I_2]~|I_1]$ - 常態分佈 : $X\sim N(\mu,\sigma^2)$ - PDF:$\frac{1}{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/2\sigma^2}$ - MGF:$\theta_X(t)=exp[\mu t+\frac{\sigma^2t^2}{2}]$ - There are some methods that can generate Normal Distribution. - 多變數常態分佈 : - $\sum\limits_iX_i\sim N(\sum\limits_i\mu_i,\sum\limits_i\sigma_i^2)$ - $\sum t_iX_i\sim N(\sum t_i\mu_i,\sum\sum t_it_jCov[X_i,X_j])$ - There are some methods that can generate Bivariate Normal Distribution. - 對數常態分佈 $lnY\sim N(\mu,\sigma^2)$ - $\mu_y=e^{\mu+\sigma^2/2}$ - $\sigma^2_y=e^{2\mu+\sigma^2}(e^{\sigma^2}-1)$ - $E[lnY]=ln(\mu/\sqrt{1+(\sigma/\mu)^2})$ - $Var[lnY]=ln(1+(\sigma/\mu)^2)$ ### Option Basics - Call 買權 - 可以有在到期日,用strike price(X)買回股票的權利 - Call value = C = max(S-X,0),可以代表intrinstic value - Put 賣權 - 可以有在到期日,用strike price(X)賣出股票的權利 - Put value = P = max(X-S,0),可以代表intrinstic value - Option Premium 合約價 - 現在交易的價格 - 選擇權價格 = 內在價格 + 時間價格 - Premium = Instrinctive Value + Time Value - 種類 - 美式選擇權:可以提早履約 - 歐式選擇權:不行提早履約 - In the money:價內,可賺錢。 - At the money:價平。 - Out of money:價外,會賠錢。 - ![](https://i.imgur.com/Vlr793q.png) - Dividend 股利 - 現金股利 Cash Dividend - 發現金股利之後,股價下跌 - 對call不利 - 對put有利 - 股票股利 Stock Split and Stock Dividend - 不考慮對option的影響 - 一般option會再股票股利後調整 - Covered Position 掩護性策略: - Hedge - Covered Call:買股票 + short call - Protective put:買股票 + long put - Spread - 買權多頭價差:買低call + 賣高call - 賣權多頭價差:買低put + 賣高put - 買權空頭價差:買高call + 賣低call - 賣權空頭價差:買高put + 賣低put - Butterfly call spread:買低call + 買高call + 賣2中call - Combination - Straddle:買call + 買put - Arbitrage套利理論 - 報酬率為零的商品,現值必為零 - 兩個商品的報酬率相同,現值必相同 - Theorem 1:PV Formula的折現必為正確的。 - Theorem 2:選擇權價值必為非負的。 - 買權賣權等價理論( Put-Call Parity ) - 對同一標的資產、同一履約價格、同一到期日之買權與賣權來說 - C - P = S - PV(X) - Lemma 3:美式買權和歐式買權,如果沒有股息發放,不會比內在價值貴。 - Lemma 4:歐式賣權中,$P\ge max(PV(X)-S,0)$ - Theroem 5:美式買權中,如果沒有股息發放,不會提早履約 - Theroem 6:美式買權,如果提早履約,只會在發放股息日獲前一日。 - Theroem 7:Piecewise Linear的獲利,必可用買權和賣權組合出相同的收益函數。 - Corollay 8:任何well behaved的獲利,可用Piecewise Linear逼近。 ### Option Pricing Models - Notation - $C$:買權價值 - $P$:賣權價值 - $X$:履約價 - $S$:股價 - $\hat{r}$:一期無風險利率 - $R=e^\hat{r}$:一期總收益 - Binomial Option Pricing Model (BOPM)二項期權定價模型 - 時間是離散的 - 現在股價是$S$ - 有 $q$ 的機率變成 $Su$ - 有 $1-q$ 的機率變成 $Sd$ - 必定有關係式 $d < R < u$ - ![](https://i.imgur.com/5VyZsZX.png) - **單期無股息,買權模型** - 如果股價 moves to $Su$,買權價值為 $C_u=max(0,Su-X)$ - 如果股價 moves to $Sd$,買權價值為 $C_d=max(0,Sd-X)$ - ![](https://i.imgur.com/P8nIKFR.png) - 複製模型 (用 portfolio 來複製 call) - 已知$C_u$和$C_d$,如何用股票和債券來定價出C值 - 用 $hS + B$ 元來買 - ![](https://i.imgur.com/vbCX62W.png) 股股票,**又稱為hedge ratio、 delta** - ![](https://i.imgur.com/TEfsz4N.png) &emsp;元債券 - 如果股價漲:$hSu + RB = C_u$ - 如果股價跌:$hSd + RB = C_d$ - **因此,根據無套利理論: $C = hS + B$ (投資組合等價)** - 美式買權中,考慮提早履約: - $C = max(hS + B, S − X)$ - $hS + B$: 買權本身的價值 - $S − X$: 履約之後的獲利 - 註:定理五說,如果沒有股息,提早履約沒有好處。 - **單期無股息,賣權模型** - 用 $hS + B$ 元來買 - $h=$ ![](https://i.imgur.com/UnMdjd2.png)股股票 - ![](https://i.imgur.com/x8IzpSt.png)元債券 - $P_u = max(0,X − Su)$ - $P_d = max(0,X − Sd)$ - 歐式賣權價值: $hS + B$ - 美式賣權價值: $max(hS + B,X − S)$ - 註:美式賣權,每一期都有可能提早履約 - **選擇權的價值,只與 $u~和~d$ 有關,和 $q$ 沒有關連性** - **Pseudo Probability** ![](https://i.imgur.com/HOfkKNx.png) - ![](https://i.imgur.com/JcfSCEM.png) - $R$: 折現 - ![](https://i.imgur.com/HOfkKNx.png) **為人工機率** - ![](https://i.imgur.com/o2mYbYI.png) - Risk-Neutral Probability 風險中立測度 - $p$: 風險中立測度 - 投資組合報酬率的期望值 must be 無風險利率 - ![](https://i.imgur.com/nq166Hy.png) - **多期無股息,不考慮提早履約** - ![](https://i.imgur.com/5g7bGoe.png) ![](https://i.imgur.com/G7NQHKK.png) - 演算法:Backward Induction - (1) ![](https://i.imgur.com/lY90rYh.png) - (2) $C =$![](https://i.imgur.com/eCNA34L.png) - $~~C$![](https://i.imgur.com/iU0KlSr.png) - 一般性: - ![](https://i.imgur.com/AoHzxE9.png) - ![](https://i.imgur.com/KNeQuAu.png) - 如果我們定義 - ![](https://i.imgur.com/eq9GqjG.png)**稱為state price** - 則![](https://i.imgur.com/qYQNhyx.png) - Binomial Distribution - ![](https://i.imgur.com/WixtrYx.png) - $b(j; n, p)$ 是出現 j 次正面的機率。 - **First fundamental theorem of asset pricing** - 風險中立測度存在 $\Leftrightarrow$ 沒有套利的可能性 - Self-Financing 自我融資 - 動態的在portfolio中,改變資產配置 - 動態的改變Delta - The Binomial Option Pricing Formula - 其實,![](https://i.imgur.com/iSPtx1o.png),有很多項一開始就為0了。 - ![](https://i.imgur.com/qFhZhaH.png)是最小的非負整數,滿足![](https://i.imgur.com/ndrYP1Y.png) - 則$C$![](https://i.imgur.com/41ERZ26.png) - 價內:![](https://i.imgur.com/YQsCXJX.png) - 價外:0 - Binomial Tree Algorithms - European Options - Time:$O(n)$、Memory:$O(1)$ - American Options - Time:$O(n^2)$、Memory:$O(n)$ - 因為每一期都有可能提早履約 - Toward the Black-Scholes Formula **???QAQ** - The binomial model 有兩個不實際的假設 - 一期後股價只會有兩種價格 - 只會在離散點的時間上交易 - Notation - $T$: 幾年到期 - $r$: 年利率 - $n$: 期數 ( 每一期間格$\frac{T}{n}$年 ) - $\hat{r} = r \times \frac{T}{n}$ 一期利率 - $R = e^{\hat{r}}$ 一期總報酬 - **CRR binomial model** - 定義 - ![](https://i.imgur.com/3zlgur0.png) - ![](https://i.imgur.com/3AWSIT9.png) - In BOPM - ![](https://i.imgur.com/lzSAnYW.png) - stock’s true continuously compounded - $n\hat{\mu}=μT$ - $n\hat{\sigma}^2=σ^2 T$ - $σ$為stock’s (annualized) volatility - 目標:使 ![](https://i.imgur.com/Maa0E05.png) - 假設 $ud = 1$ - **結果:** - ![](https://i.imgur.com/yOuA5xE.png) - 中央極限定理 - $\ln{(\frac{S_T}{S})} \sim N(\mu T, \sigma^2 T)$ - $\ln{(S_T)} \sim N(\mu T + \ln{S}, \sigma^2 T)$ - $S_T \sim \ln{N}$ - 註:$X \sim N$, $Y = e^X \sim \ln{N}$ - Lemma 11: $\ln{(\frac{S_T}{S})} \sim N((r - \frac{\sigma^2}{2}) T, \sigma^2 T)$ - 股價到期日的期望值為$S e^{rT}$ - 股價年利率的期望值為$r$. - **Thm 12:The Black-Scholes Formula** - ![](https://i.imgur.com/vKEynIM.png) - BOPM and Black-Scholes 的比較 - Black-Scholes : $S$, $X$, $σ$, $τ$, $r$. - BOPM : $S$, $X$, $u$, $d$, $r$, $n$. - 關聯為 : ![](https://i.imgur.com/mIrEyqz.png) - Implied Volatility隱含波動率 - 用市場上的交易價格以及 Black-Scholes formula 去計算 $\sigma$ - 根據過去歷史資料 - 問題:微笑曲線 (the Smile) - 解決方式:volatilities are often combined to produce a composite implied volatility (CIV) - Bermudan Options 百慕大期權 - 只能在特定離散時間點履約的選擇權 - Time-Dependent Volatility 波動性和時間有關 - 波動性隨時間改變, 取決於 $σ(t)$ 而不是 $σ$. - Variance of $ln(Sτ/S)$ : ![](https://i.imgur.com/AH2rICI.png) - The annualized volatility : ![](https://i.imgur.com/GOPKsEy.png) - For the binomial model, $u$ and $d$ depend on time: - ![](https://i.imgur.com/ojm9BNi.png) ## 其他 - [HW2 亞式選擇權+barrier+美式](https://hackmd.io/6NHqq9_NQt2H0WzE9kbN8w) - [HW3 Least-squares Monte Carlo](https://hackmd.io/q2HSTckpRHW2XtVjU7J_og)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully