Home
Quantitative Boxer
Cancel

Interest rate swaps in QuantLib: cash flows, fair coupons and hedging

An interest rate swap becomes easier to reason about when “pay fixed” and “receive floating” are written as signed cash flows. Its initial fair coupon is a consequence of those flows, their schedul...

Swap curves in QuantLib: separate projection from discounting

A floating-rate coupon needs a forecast of its index fixing and a discount factor for its payment date. Those are different modeling jobs. A desk implementation should make that distinction explici...

Duration, convexity and quote risk: what a bond hedge actually removes

A duration hedge can work well against a parallel rate move while leaving meaningful exposure to the shape of the curve. QuantLib makes that distinction visible when the bumped object, sign and uni...

Bond valuation in QuantLib: coupons, settlement and accrued interest

A bond valuation should be explainable one payment at a time. If a model reports a clean price, the next questions are which cash flows remain, when they settle, how they accrue, and what curve dis...

Yield curves in QuantLib: from par quotes to cash-flow discounting

A yield curve earns its place on a FICC desk by pricing dated cash flows consistently. The useful question is not how smoothly a line connects quoted rates. It is which instruments the curve reprod...

Black–Scholes–Merton in QuantLib: price, parity and the local hedge

A European option is a useful first QuantLib instrument because its price can be checked without another pricing engine. The payoff, financing assumptions and a normal-distribution formula give an ...

Money Weighted Return (Approximating with Taylor Series)

This post is about definition and approximation method for money weighted return (python code included) What is Investment Return When you invest, people might ask you how much you made profit, or...

Gaussian Segmentation: Finding a Break and Knowing It Has Happened

A vertical line placed neatly before a volatility spike can create a misleading impression of foresight. A segmentation algorithm may have needed the entire spike, and months of subsequent observat...

Market Regimes: Can a Hidden Markov Model Improve Tomorrow's Risk Forecast?

A market regime model becomes useful when its state estimate improves a decision made with information available at the time. A convincing chart of past crises is an interesting description; the ne...

Maximum Diversification: More Diversified Does Not Mean Less Volatile

Maximum diversification and minimum variance optimize different ideas of risk. Minimum variance seeks the least volatile feasible portfolio. Maximum diversification asks how much risk is removed by...