Michael R. Ludwikowski III

Logo

CSCI 496: Senior Portfolio
In partial fulfillment of the requirements for the degree of Bachelor of Science in Computer-Science (class of 2026)

View My Resume

View My Handshake Profile

View My GitHub Profile

Michael Ludwikowski

CSCI 496: Senior Portfolio

In partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science (class of 2026).

View My GitHub Profile

Back to Project Repository


Main Senior Project

Stock Trading AI Analyst - Defense Documentation

The full defense documentation is included below as the main portfolio artifact.


Stock Trading AI Analyst - Defense Documentation

Student: Michael Ludwikowski
Advisor: Dr. Hayes
Program: B.S. Computer Science
Date: April 2026

Chapter 1: Statement of Purpose (with Problem Statement)

Purpose

The purpose of this project is to create an educational stock trading platform that helps beginner traders learn stock market concepts, practice decision-making, and understand portfolio risk without using real money. The platform combines fake-money trading, market data, charts, and AI-generated analysis to create a guided learning environment.

Problem Statement

Many new traders enter the stock market with little practical experience and lose money because they do not understand market behavior, risk management, or trading discipline. Existing tools are often either too advanced for beginners or too simple to provide realistic practice. This project addresses that gap by offering a safe system where users can learn by doing, analyze results, and improve before ever risking real capital.

Project Objectives

  1. Provide a realistic but safe stock trading experience using simulated funds.
  2. Support learning through dashboards, charts, portfolio feedback, and guided pages.
  3. Integrate AI-based recommendations to explain possible buy, sell, or hold decisions.
  4. Store user activity so balances, trades, and portfolio changes can be reviewed.

Chapter 2: Research and Background

Domain Background

Stock trading education is difficult because users must learn both technical platform skills and market fundamentals at the same time. Core beginner challenges include:

Technical Background

To support those learning goals, this project combines:

Technical Expertise Developed

This project required building skills beyond normal class assignments. I had to dive into multiple technical areas to put them into one working system and troubleshoot them together:

This shows how course knowledge in programming, data structures, software engineering, and databases was expanded into a larger, production-style project workflow.

Key Constraints Discovered

  1. Free market-data APIs may have strict request limits and slower refresh times.
  2. Some intraday or premium endpoints require paid tiers.
  3. Cached data can quickly become stale if refresh logic is not handled carefully.
  4. AI output quality depends on historical data quality and prompt design.

Chapter 3: Project Language(s), Software, and Hardware

Programming Languages

Frameworks and Libraries

Development and Runtime Environment

Hardware

Chapter 4: Project Requirements

Requirements Development Progression (CSCI 497)

The project requirements were developed in stages instead of being written all at once. I started with a broad idea focused on helping beginner traders learn safely, then narrowed the scope based on advisor feedback and technical research.

As I started planning out the project, I was able to create more practical requirements tied to real system behaviors, such as account management, stock data access, and AI recommendations. As the project progressed, I adjusted the requirements to keep the project in scope with the timeline while prioritizing the most important functionalities.

This progression also helped separate completed features from future enhancements. Core workflows were kept as high priority for the final build, while advanced items such as deeper AI automation and broader account workflows were documented as partial or future work.

Core Requirements Implemented

  1. Account and user management
    • user registration and login
    • logout and password reset flow in the web interface
    • account reset back to the default starting balance
  2. Wallet and transaction controls
    • initialize new accounts with $1000 in fake money
    • prevent purchases when funds are not available
    • store holdings, balances, and transaction history in SQLite
  3. Stock data and analysis
    • search stocks by symbol
    • retrieve quote and historical data with caching
    • display historical charts and stock detail information
  4. Trading operations
    • buy and sell stock through the application
    • update holdings and portfolio value after trades
    • calculate total value and gain/loss information
  5. AI analyst support
    • generate buy, sell, or hold recommendations
    • include confidence, risk level, and a short rationale
  6. Learning and practice features
    • learning page for beginner information
    • historical simulation mode
    • practice mode with different difficulty settings
  7. Interface and display
    • dashboard with balance, holdings, and recent activity
    • portfolio page and stock detail pages
    • interactive charts using Bokeh
  8. Testing and reliability
    • test plan and written test cases
    • Python test scripts for API and AI integration work
    • transaction and balance validation in code

Partially Implemented or Future Requirements

Priority Notes


Chapter 5: Project Implementation Description and Explanation

The final project was built mainly in Python. The main controller is in src/app.py, where the core parts of the system are connected together. These parts include the trading engine, market data provider, AI prediction engine, simulation mode, practice mode, and the database layer. This made the project easier to organize and test because each major feature is separated into its own module.

The project supports both a command-line version and a Flask web version. The web version is the main interface for the final project because it is easier to demonstrate and gives a clearer view of balances, holdings, charts, and stock details. In the web app, users can register, log in, reset their account, browse stocks, view their portfolio, and make trades. There are also pages for practice mode, simulation mode, and learning content.

Market data is handled through the market_data.py module. The program can request stock quotes and historical data, cache the data, and use fallback behavior if the API is limited or unavailable. This was important because free APIs do not always respond quickly and may have usage limits. The charting portion of the project uses Bokeh so that users can view interactive stock charts instead of only seeing raw numbers.

The AI portion of the project is handled through predictor.py. The system sends recent historical data to a local Ollama model and asks for a recommendation such as BUY, SELL, or HOLD. The result also includes a confidence value, risk level, and short explanation. If the model is not available, the system still works by using a fallback prediction method based on recent price trend data. This made the project more dependable during development and testing.

Another major part of the project is the practice and simulation support. Simulation mode lets the user move through historical market data over time. Practice mode creates a guided environment with synthetic companies and events so the user can practice without depending only on live data. These features support the educational purpose of the project and make it more than a basic buy/sell demo.

Source code repository: https://github.com/MichaelLudwikowski/MLud-CSU-Senior-Project

Figures Used in This Documentation

Fig 1. Login page (web authentication entry point)

Fig 1. Login page

Fig 2. Dashboard view after login (initial account overview)

Fig 2. Dashboard view after login

Fig 3. Stock search page (symbol search and popular stock list)

Fig 3. Stock search page

Fig 4. Stock detail page for AAPL (quick trade, AI recommendation, and interactive chart)

Fig 4. AAPL stock detail page

Fig 5. Dashboard after placing a trade (cash, portfolio value, and transaction log update)

Fig 5. Dashboard after AAPL trade

Fig 6. Practice mode setup page (difficulty and session length options)

Fig 6. Practice mode setup

Fig 7. Practice mode active session (news events, progress, holdings, and gain/loss)

Fig 7. Practice mode active session

Fig 8. Practice stock detail page (generated company, AI recommendation, and chart)

Fig 8. Practice stock detail page


Chapter 6: Known Limitations and Risk Mitigation

One limitation of the project is that free market-data APIs have request limits. Because of that, the system uses caching and fallback behavior so that it can still show data even when the API cannot be called again right away. This reduces failures during demos and normal use.

Another limitation is that the AI features depend on a local Ollama setup. If Ollama is not running or the model is not installed, the full AI response will not be available. To reduce this problem, the project includes a fallback prediction method based on price trend analysis so that the application can still give a recommendation instead of failing completely.

Some planned features are not fully finished in the current version. Multiple account support exists in the data model but is not fully exposed in the user workflow. Margin trading logic also exists in code but is currently disabled. AI auto-investing and full AI training are only partially implemented. In this defense, those features should be presented as future improvements rather than as completed work.

The project is meant for education, not for real investing. Even when real market data is available, the system should not be treated as financial advice. This keeps the project focused on learning and practice instead of real-money trading.


Chapter 7: Test Results Summary

Tested Areas with Strongest Coverage

These results support the main goal of the project, which is to provide a safe educational trading platform with portfolio tracking and AI assistance.

Requirements-to-Testing Traceability

Requirement Area Evidence in Test Cases Coverage Status
Account Management TC-001 to TC-006 Implemented
Wallet and Transactions TC-007 to TC-012 Implemented
Stock Data and Analysis TC-015, TC-019, TC-047 Implemented
Trading Operations TC-013, TC-014, TC-017, TC-018, TC-020 Implemented
AI Recommendations TC-021 to TC-027 Implemented (fallback supported)
Practice and Simulation TC-028 to TC-032, TC-048 Partially Implemented (manual-heavy)
Interface and Display TC-033 to TC-035, TC-047, TC-048 Implemented (primarily manual evidence)
Testing and Reliability TC-036 to TC-046 Implemented

Test Execution Snapshot

Supporting Test Artifacts


Chapter 8: Challenges Overcome

One of the first challenges that I faced was API reliability and rate limits. Since free market-data APIs can limit requests or respond slowly, I had to add caching and fallback behavior so the app would still work during demos and testing instead of failing when the API was unavailable.

Another challenge was AI dependency. The AI recommendation feature depends on a local Ollama model, so if the model server is not running or the model is not installed, predictions can fail. To handle this, I used fallback prediction logic so the system can still return a recommendation and keep the user workflow running.

A third challenge was balancing realism with eucational usability. I wanted the platform to feel like a real trading environment, but still be simple enough for beginners. This led to design decisions like fake-money accounts, clear dashboard metrics, practice mode with guided difficulty, and simulation mode for historical learning.

I also had to manage project scope over time. Some features were designed in the data model but not fully exposed in the current user workflow, such as full multi-account operation and deeper AI automation. Instead of forcing unfinished features into the final build, I prioritized making the core flows stable and presentable.

Overall, the main challenge was integration: combining data retrieval, AI analysis, trade execution, persistence, and frontend views into one consistent system. Solving those integration issues was one of the most important outcomes of the project.


Point 9: Future Enhancements

Future work for this project includes finishing multi-account support, improving AI performance tracking, and expanding the educational side of the platform. More detailed alerts, better reporting, and additional learning activities would make the system more useful for beginner traders.

Another improvement would be better handling of real market data, especially around rate limits and refresh timing. The system could also be extended with stronger account security, more advanced portfolio analytics, and better administrative debugging tools.

Overall, the current version already demonstrates the main idea of the project, and future work would build on that foundation rather than restarting from scratch.



Point 10: Supporting Senior Project Artifacts


Programming Projects

Name and ID Parser | CSCI 315

Website Balancer and Parser | CSCI 315

Wikipedia Parser | CSCI 301

Go-Fish Project | CSCI 325


Ethics Papers

Ethics Behind Copying Others Code

Software Testing

Coding Ethics in the Workplace


Presentations

Canbus Presentation

Go-Fish Implementation Guide