Stock Market Simulator

Designing and developing a portfolio management tool powered by real-time stock data

ProjectStock Market Simulation App

RoleDeveloper

TimelineJune 2024

ToolsJava, Swing, Alphavantage API

Creating portfolios, tracking investments, and querying stock data in real-time

Project Overview

Building a scalable stock portfolio manager

The Stock Market Simulator was my final project for Object-Oriented Design. Built in Java using the Swing framework, it enables users to create, manage, and analyze virtual stock portfolios using real-time data from the Alphavantage API. The project challenged me to architect a scalable application using the MVC pattern, handle external data sources, and design an intuitive GUI experience.

Challenge

Managing real-time data with efficiency and clarity

Managing real-time financial data within a desktop application required both efficient caching and clear data visualization. Additionally, I needed to ensure users could easily save, load, and modify portfolios without data conflicts or performance lag. The challenge was creating a system that balanced technical performance with user-friendly interaction.

Solution

Modular architecture with flexible interaction modes

I implemented a modular architecture using MVC principles to separate logic, UI, and data handling. The app supports both text-based and GUI modes, allowing users to perform portfolio operations interactively or through command-line input. This dual-mode approach provided flexibility while maintaining code reusability and scalability.

The Process

From design to development

1

Planning

Architecture Design

MVC Pattern

2

Development

Model & Controller

API Integration

3

Interface

GUI Design

User Testing

4

Refinement

Data Caching

Performance

Key Features

Comprehensive portfolio management capabilities



Stock Market Simulator GUI Screenshot
Technical Architecture

Structured design with MVC principles

The simulator follows the MVC (Model-View-Controller) pattern to ensure maintainability and scalability:

Model

Handles portfolio data, stock caching, and API interactions with the Alphavantage service. Manages data persistence and retrieval for efficient performance.

View

Built using Java Swing for a responsive, user-friendly interface. Provides clear visual feedback for all portfolio operations and real-time value updates.

Controller

Manages user input, command execution, and synchronization between model and view. Ensures smooth data flow and error handling across the application.

By separating responsibilities, I ensured maintainability and scalability for future enhancements, such as analytics dashboards or additional API integrations.

Data Structure

Simple and readable portfolio storage

Saved portfolios are stored as .txt files using a clean, human-readable structure that makes debugging and manual editing straightforward:

Portfolio: test3
Stock: AAPL
Quantity: 50
---
Stock: GOOG
Quantity: 25
---
Number of Stocks: 2
      
Final Application
Outcome

A robust application demonstrating software design principles

I successfully developed a fully functional stock market simulator that demonstrates strong object-oriented design principles. The application efficiently manages real-time financial data while providing an intuitive user experience through both GUI and command-line interfaces. By implementing the MVC pattern and focusing on modular architecture, I created a scalable foundation that could easily support future features like advanced analytics, portfolio comparison tools, or additional API integrations.

Reflection

Learning through architectural challenges

This project deepened my understanding of software architecture and design principles. Implementing the MVC pattern in a real-world context helped me appreciate how structure impacts scalability and readability. Overcoming challenges with caching and external APIs taught me the importance of debugging, persistence, and adaptability—skills I continue to apply in both development and design projects.

Working with financial data also reinforced the importance of data accuracy and user trust. Every feature decision needed to balance performance optimization with reliability, ensuring users could confidently manage their virtual portfolios without worrying about data inconsistencies or system failures.