A Java-based Stock Trading Platform developed as part of the CodeAlpha Java Programming Internship.
This project simulates a real-world stock trading environment where users can buy and sell stocks, manage their portfolio, track profit or loss, and monitor market fluctuations through a menu-driven console application.
- 📊 View simulated stock market prices
- 📈 Dynamic market price fluctuations
- 💰 Buy stocks
- 💸 Sell stocks
- 📁 Portfolio management
- 📉 Profit/Loss analysis
- 📝 Transaction history logging
- 📊 Session statistics tracking
- 💾 File handling for data persistence
- Java
- Object-Oriented Programming (OOP)
- Java Collections Framework
- HashMap
- File Handling
- Exception Handling
- Randomized Market Simulation
CodeAlpha_StockTradingPlatform/
data/
└── portfolio.txt
src/
├── Main.java
├── Stock.java
├── Market.java
├── User.java
├── Portfolio.java
├── PortfolioLogger.java
├── SessionStats.java
└── UI.java
README.md
| Stock | Base Price |
|---|---|
| TCS | ₹3800 |
| Infosys | ₹1550 |
| Reliance | ₹2950 |
| HDFC | ₹1800 |
Prices fluctuate dynamically every time the market is viewed.
Displays the current stock market prices.
Purchase stocks and add them to your portfolio.
Displays:
- Stock name
- Quantity owned
- Average purchase price
Sell stocks from your portfolio.
Displays:
- Investment amount
- Current portfolio value
- Profit/Loss status
Displays:
- Total transactions
- Stocks bought
- Stocks sold
- Current holdings
Compile:
javac src/*.javaRun:
java -cp src MainThis project helped me strengthen my understanding of:
- Designing multi-class Java applications
- Applying Object-Oriented Programming principles
- Managing data using HashMap and Collections
- Implementing file handling
- Building menu-driven systems
- Simulating market behaviour
- Developing portfolio analysis systems
Program: CodeAlpha Java Programming Internship
Project: Stock Trading Platform
Ankit Yadav
GitHub: https://github.com/Srvankit