This is a local stock market simulator made using Python and SQLite. The simulator uses live stock market data and lets users buy and sell stocks through virtual money.
- User creation and login
- Password hashing before storing passwords
- Live stock prices using the Finnhub API
- Company information (market cap, industry, exchange, open/high/low)
- Historical stock graphs using Yahoo Finance
- Buying and selling stocks
- Portfolio management
- Net worth calculation
- Transaction history with timestamps
- Input validation and error handling
- Colored terminal interface
- sqlite3
- hashlib
- requests
- python-dotenv
- pyFiglet
- plotext
- yfinance
The project contains four tables.
- users
- stocks
- portfolio
- transactions
Currently, there are 9 stocks available for trading.
| Symbol |
|---|
| AAPL |
| TSLA |
| NVDA |
| MSFT |
| GOOGL |
| AMZN |
| META |
| AMD |
| INTC |
Every transaction stores:
- Stock symbol
- Buy/Sell type
- Share quantity
- Trade price
- Total value
- Timestamp
A Linux executable Linux (x86_64) is available in the release section.
./Main- The sim stores its data in a local SQLite database (
stock_sim.db)
- requests
- python-dotenv
- pyfiglet
- plotext
- yfinance
Clone the repository.
git clone https://github.com/Eraxty/Stock-Market-Simulator.git
cd Stock-Market-SimulatorCreate a virtual environment.
python -m venv .venvActivate it.
source .venv/bin/activateFor Fish shell:
source .venv/bin/activate.fishInstall the required packages.
pip install -r requirements.txtRun the program.
python Main.py- Create an account
- Log in
- Browse live stock prices
- View company information and graphs
- Buy stocks
- Track your portfolio and net worth
- View transaction history
- Sell stocks
- Profit/Loss tracking
- Watchlist
- Search stocks
- GUI version
-Built as a Python and SQLite learning project.



