File size: 2,387 Bytes
ea5b3dc
 
 
 
 
 
 
f8d03ab
ea5b3dc
 
 
 
 
 
2aaf2a2
9a14443
2aaf2a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9a14443
2aaf2a2
 
 
 
 
 
 
 
 
 
 
9a14443
2aaf2a2
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: Asset Class Comparison
emoji: πŸ”₯
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.44.1
python_version: "3.12"
app_file: app.py
pinned: false
license: mit
short_description: An asset class comparator for my personal usecase
---

# Asset Class Performance Comparison
![Demo 1](./attachments/images/demo-1.png)

This Streamlit app allows you to compare the performance of different asset classes over time, including stocks, bonds, gold, and fixed deposits.

## Features

- Compare multiple asset classes simultaneously
- Choose between USD and SGD currencies
- Customize investment parameters (initial amount, time period)
- View performance graphs and annualized returns
- Support for major indices and individual stocks

## How to Use

1. Select your preferred currency (USD or SGD)
2. Enter your initial investment amount
3. Choose the time period for comparison
4. Select the assets you want to compare
5. View the performance graph and returns

## Assets Available

- Fixed Deposit
- Gold
- SGS Bonds
- US Treasury Bonds
- Major Indices (NASDAQ, S&P 500, Dow Jones)
- Individual Stocks (Microsoft, Google, Nvidia, Apple, etc.)

## Technical Details

The app uses:
- Streamlit for the web interface
- yfinance for market data
- Plotly for interactive graphs
- Pandas for data manipulation

## Hosting

This app is hosted on Hugging Face Spaces. You can access it at [link to be added after deployment].

## Local Development

To run locally:
1. Clone this repository
2. Install dependencies: `pip install -r requirements.txt`
3. Run the app: `streamlit run app.py`
   - If having issues invoking a venv, use `$(which python) -m streamlit run app.py`

## Project Structure

```
asset-class-comparison/
β”œβ”€β”€ app.py                 # Main Streamlit application
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ README.md             # This file
└── utils/                # Utility functions
    β”œβ”€β”€ yfinance_utils.py # yfinance data fetching utilities
    β”œβ”€β”€ currency_utils.py # Currency conversion utilities
    β”œβ”€β”€ hdb_utils.py      # HDB related utilities
    └── fd_utils.py       # Fixed deposit calculation utilities
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.