[Review Notes] Introduction to Financial Computing
来源:互联网 发布:java https请求带证书 编辑:程序博客网 时间:2024/05/29 12:30
Basic Financial Arithmetic
Simple and Compound Interest
- Simple Interest :
TotalProceed=Principal×(1+interestrate∗daysyear) - Compound Interest :
TotalProceed=Principal×(1+interestrate∗daysyear)N - Interest Rate:
- The period for which the investment/loan will last
- The absolute period to which the quoted interest rate applies
- The frequency with which interest is paid
Nominal and Effective Rates
-
-
Daily Compounding
-
Continuous Compounding
-
Time Value of Money
for simple invest :
for compound invest :
-
- IRR
IRR : The one single interest rate used when discounting a series of future value to achieve a given net present value.
Example:

Basic Financial Modeling
Money Market
Eurodeposit
- LIBOR
The rate dealers charge for lending money (they offer funds) - LIBID
The rate dealers pay for taking a deposit (they bid for funds) - In London, quote (offered rate – bid rate), Other places, quote (bid rate – offered rate)
- Rule: pay the higher rate for a loan, receive the lower for a deposit
- LIBOR
DAY/YEAR Conventions
Interestpaid=interestratequoted×daysinperioddaysinyear - Most money markets use ACT/360
Interest rate on 360-day basis = Interest rate on 360-day basis×360365 - Exceptions using ACT/365:
Interest rate on 365-day basis = Interest rate on 365-day basis×365360 - International and domestic:
Sterling, Hong Kong dollar, Singapore dollar, Malaysian ringgit, Taiwan dollar, Thai baht, South African rand. - Domestic (but not international):
Japanese yen, Canadian dollar, Australian dollar, New Zealand dollar
- International and domestic:
Money Market Instruments
- CD - Pricing
Price=presentvalue maturityproceeds=facevalue×(1+couponrate×couponperiod(days)year Price=facevalue×(1+couponrate×couponperiod(days)year)1+interestrate×dayspurchasetomaturityyear - CD - Return
yield=(FVPV−1)×yeardays yield=(salepricepurchaseprice−1)×yeardaysheld yield=((1+interestratepurchase×dayspurchasetomaturityyear)(1+interestratesale×dayssaletomaturityyear)−1)×yeardaysheld - Discount rate quote
Price=FaceValue×(1−DiscountRate×daystomaturityyear) Price=FaceValue1+yield×daystomaturitysyear yield=discountrate1−discoutrate×daystomaturityyear discountrate=yield1+yield×daystomaturitysyear
Forward Rate Agreements (FRAs)
Forward-forward
- A cash borrowing or deposit which starts on one forward date and ends on another forward.
- The term, amount and interest rate are all fixed in advance.
forward−forwardrate=[(1+iL×dLyear)(1+iS×dSyear)−1]×yeardL−dS
L and S stand for longer and shorter period respectively
Forward Rate Agreements
- off-balance sheet instrument
- fix a future interest rate
- on the agreed date (fixing date), receives or pays the difference between the reference rate and the FRA rate on the agreed notional principal amount
- Principal is not exchanged
- Settles at the beginning of the period
His flow will therefore be : - LIBOR
Usually two days before the settlement date, the FRA rate is compared to the agreed reference rate (LIBOR).
Settlement Paid
- Period < 1year
- Period > 1year
如果参照利率(e.g., LIBOR)比协议利率为高(>), 卖方需支付给买方合约差额;
反之,如果参照利率比协议利率为低(<),买方需支付给卖方合约差额。
Constructing a strip
The interest rate for a longer period up to one year =
Futures Contract
Futures
- A contract in which the commodity being bought or sold is considered as being delivered (may not physically occur) at some future date
- Exchange traded (vs OTC in “forward”)
- Contract standardized by exchange
- Pricing depends on underlying commodity
Quotation
Futures & FRAs are in opposite directions :
Dealing
- Open outcry
buyer and seller deal face to face in public in the exchange’s “trading pit” - Screen trading
designed to simulate the transparency of open outcry
Clearing
Following the confirmation of a transaction, the clearing house substitutes itself as a counterparty to each user and becomes
- the seller to every buyer and
- the buyer to every seller
Margin Requirements
- Initial Margin
- Collateral for each deal transacted
- Protect clearing house for the short period until position can be revalued
- Variation (Maintenance) Margin
- Marking to market
- Paid daily based on adverse price movements

Profit and Loss
Profit/los s on long position in a 3-month contract :
Hedging FRA with Futures
- Settlement for FRA = Profit or loss on sold futures
- Hedge required is the combination of the hedges for each leg
e.g.,• Sell 3x6 FRA + Sell 6x9 FRA, hence hedged by• Sell 10 June futures + Sell 10 Sept futures
Imperfect FRA Hedging with Futures
- Future contracts are for standardized amount
- Futures P&L are based on 90-day period rather than 91 or 92 days as in FRA
- FRA settlements are discounted but futures settlements are not.
- Future price when the Sept contract is closed out in June may not exactly match the theoretical forward- forward rate at that time
- Slight discrepancy in dates.
Open Interest : number of purchases of contract not yet been reversed or “close out”
Volume : total number of contracts traded during the day
3v8 FRA:
5v10 FRA:
Arbitrage
Any must win strategy?
buy-buy / sell-sell
Interest Rate Swaps (IRS)
Definitions
- A swap is a derivative in which two counterparties agree to exchange one stream of cash flows against another stream.
- These streams are called the legs of the swap.
- An interest rate swap is a derivative in which one party exchanges a stream of interest payments for another party’s stream of cash flows.
Hedging with FRA
Hedging with IRS
Characteristics of IRS
- Similar to FRA
- No exchange of principal
- Only interest flows are exchanged and netted
- Different from FRA
- Settlement amount paid at the end of relevant period
Motivation: win-win
Type of Swap
- Coupon Swap
Party A pay fixed interest rate and receive floating interest rate from party B - Basis Swap
Floating vs floating but on different rate basis
e.g., - Index Swap
The flow in one / other direction are based on index
e.g.,
Valuation of Swap
- Long Swap = + Long a Fixed rate bond - Floating rate borrowing
- Swap Value = + PV of Fixed leg cashflow - PV of floating leg cashflow
- Swap = NPV of Fixed leg cashflow
- At inception, NPV = 0
where:
Construction of Yield Curve
Definitions
- The relationship of interest rate for different maturity
- Market rate of interest for:
- theoretical zero coupon instrument
- matures at any future date
- Derived from
- prices of real financial instrument
- trade in a liquid market
Type
- Curve Shape
- positive
- negative
- flat
- Curve Categories
- Par Yied Curves
- Zero Coupon Yield Curve
- Forward Rate Yield Curve
Example
forward rate =
Therefore,
Base on that and construct further, and this formula use again & again to construct the yield curve.
Quick Recap
Over night
Money Market
e.g.,
FRA
where,
SWAP Valuation
(点与点之间可以通过一次函数求解)
Zero Coupon Rate
Options
Options Basic
Options:
gives the buyer the right to buy or sell a specified quantity of an underlying asset at a specific price (premium) within a specified period of time.Terminology
- Feature of Option
- Exercise style
- European option : An option that can only be exercised on the day of expiry
- American option: An option that can be exercised at anytime from the date of purchase until it expires (More expensive)
- Option Exercise Settlement
- Physical Settlement : the option is actually delivered with the underlying. The option seller of the option must deliver to the buyer of the option with the pre- defined amount of underlying
- Cash Settlement : cash is settled for the difference between the underlying market price and the option strike price
- OTC vs Exchange
- OTC:(over the counter)
customized contacts between 2 counterparties - Exchange Trade Contract
The standardized contracts listed in Exchange
Margin call system with daily mark-to-market
Exchanges include: SIMEX, LIFFE, CBOT, CME , etc
- OTC:(over the counter)
- Exercise style
Option Price
Option Price = Intrinsic Value + Time value
- Intrinsic Value
- Call option : Intrinsic value = Underlying price – Strike price
- Put option : Intrinsic value = Strike price – Underlying price
- Time Value
- Time value = option price – Intrinsic value
- The risk that the option will move in the money before expiry
where
X = Strike / Exercise price;
S = Underlying asset price
- Complex Strategy
- Straddles
Long Straddles: buying a call and put at the same strike - Strangles
Long Strangles: buying a call and put at different strike (call strike > = put strike)
- Straddles
Option Pricing
Put Call Parity Relationship
The arbitrage relationship which links European options markets to cash markets.
C = Call premium
P = Put premium
X = Option strike price
T = Time to maturity
1. Alternative 1: C + long Bond PV(X)
Buy 1 Call (C) with strike X and long Bond at PV of strike X.
2. Alternative 2 : P+
Long Put (P) with strike X and long Physical Stock at
Both alternatives have same payoff at T
Therefore, to avoid arbitrage at
or
or
or
Binomial Model
- Assumption
- The stock price follows a random walk
- In each time step, it has a certain probability of moving up or down by a certain amount
- Arbitrage opportunities do not exist
- In the riskless portfolio, the return it earns must equal the risk-free interest rate
- Binomial Model Parameter
- Input parameter
S = Current Stock Price
X = Stock Call Option Strike/Exercise Price
T = Option life expiration in year
σ = Volatility
r = Risk free interest rate
n = no. of steps in bonomial tree - Intermediate calculated parameter
p = Risk neutral probability of up jump size
u = Up jump size (e.g.ΔS = 10%, u = 1.10)
d = Down jump size
∆t = period interval in each binomial nodes = T/n - To estimate
f=Currentoptionprice
- Input parameter
Generalization
where ∆ is Hedge Ratio
Then, Derivative Price
r = risk-free interest rate
PV of portfolio =
Thus,
where
Thus,
At last,
Black Sholes Model
- Recall Ito’s Lemma
dx=a(x,t)dt+b(x,t)dz
IfG(x,t) is some function of x and t,dG=(∂G∂xa+∂G∂t+12∂2G∂x2b2)dt+∂G∂xbdz - Black Sholes Model
dS=μSdt+∂Sdz
Witha=μS ,b=∂S , applying to Ito’s Lemma, takingG=C=max(ST−X,0)
we havedC=(∂C∂SμS+∂Cpartialt+12σ2S2∂2C∂S2)dt+∂C∂SσSdt‾‾√
Option Greeks
- Delta
- Gamma
- Vega
- Theta
- Rho
Risk Management
There is no return without risk
- Market Risk
- Credit Risk
- Liquidity Risk
- Operational Risk
- Model Risk
- Settlement Risk
- Regulatory Risk
- Legal Risk
- Tax Risk
- Accounting Risk
- Sovereign and Political Risk
- [Review Notes] Introduction to Financial Computing
- Introduction to Parallel Computing
- Introduction to GPU Computing
- Introduction to C++ for Financial Engineers-Study Notes 1(Ch1-Ch7)
- Introduction to C++ for Financial Engineers-Study Notes 2(Ch8-Ch)
- Datacamp Notes: Introduction to R
- 并行计算概述 (Introduction to Parallel Computing)
- Introduction to Parallel Computing 阅读笔记
- How to Design Programs: An Introduction to Programming and Computing
- Perl Notes(III) -- Introduction To Berkeley Sockets
- Introduction to Oracle Wait Interface notes
- JavaTech, an Introduction to Scientific and Technical Computing with Java
- Introduction to Computing and Programming with Java : A Multimedia Approach
- Introduction to Generic Accelerated Computing with Libra SDK
- Altera笔记:Introduction to Parallel Computing with OpenCL
- Financial application- computing future tuition
- Cloud Computing Application Notes
- CLRS(Introduction to Algorithms 2nd) reading notes 1
- java 函数形参传值和传引用的区别
- 根据当前日期获取下一个编号的SQL语句
- NSUserDefaults standardUserDefaults中在最后使用synchronize的作用
- Hybrid移动APP开发(一):Cordova+Ionic+Angularjs环境配置
- Hive Metastore实践总结
- [Review Notes] Introduction to Financial Computing
- Objective-C语言_设置器和访问器
- 关于计算机教育的一些思考
- Quicksort
- android:layout_gravity和android:gravity的区别
- Android 的搜索机制 I-创建一个搜索框
- IOS 文件处理
- Linux设备驱动中的阻塞和非阻塞I/0,
- [转载]Linux 内核源码中likely()和unlikely()