Python tool for analyzing US Treasury yield trends, calculating daily returns, and assessing fixed income portfolio risk using historical data.
Quantitative analysis tool built to monitor US Treasury yield movements, compute daily return distributions, and assess portfolio risk through VaR analysis. Designed for fixed income analysts who need a fast, repeatable way to evaluate yield-curve behavior and exposure.
| Metric | Description |
|---|---|
| Average Yield | Mean yield over the analysis period |
| Yield Volatility | Standard deviation of daily return series |
| 95% VaR | Value at Risk — worst expected daily loss at 95% confidence |
- Treasury Yield Tracking — Fetches 10-year US Treasury yield data (
^TNX) via yfinance - Daily Return Analysis — Computes percentage changes to measure day-over-day yield movements
- VaR Calculation — 95th percentile Value at Risk using historical simulation
- Yield Curve Visualization — Interactive plots of yield trends over time
- Volatility Assessment — Standard deviation of returns as a proxy for yield risk
| Component | Technology |
|---|---|
| Language | Python 3.9+ |
| Data | yfinance (US Treasury yields) |
| Analytics | pandas, NumPy |
| Visualization | Matplotlib |
| Risk Model | Historical VaR (95% confidence) |
git clone https://github.com/RHarmit/Fixed-Income-Portfolio-Risk-Performance-Tracker.git
cd Fixed-Income-Portfolio-Risk-Performance-Tracker
pip install yfinance pandas numpy matplotlib
python FI.PYTreasury Data → Daily Returns → Risk Metrics (VaR, Volatility) → Yield Trend Charts
- Fetch — Downloads historical 10Y Treasury yield via
^TNX - Transform — Calculates daily percentage returns, cleans NaN values
- Analyze — Computes average yield, volatility, and 95% VaR
- Visualize — Plots yield trend over time with grid overlay