Skip to content

It is java based application for virtual stock market simulation that helps users learn investment strategies using flexible and inflexible portfolios—all without risking real money.

Notifications You must be signed in to change notification settings

tejal04/VirtualStockApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

302 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Virtual Stock

Virtual Stock is an educational simulation tool designed to help beginners understand how investments grow over time—without using real money. Inspired by the concept of "virtual gambling", users can create and manage virtual portfolios, try investment strategies, and observe how their choices affect the portfolio's value.


🚀 Features

1. Portfolio Management

  • Two types of portfolios:

    • Inflexible: Cannot be modified after creation.
    • Flexible: Can be updated (buy/sell more stocks).
  • Portfolio Creation Options:

    • Start with a blank portfolio.
    • Load saved portfolios from a local file.
    • Import portfolios from a CSV file:
      • Inflexible format:
        portfolio_name, ticker_symbol, quantity, false
        
      • Flexible format:
        portfolio_name, ticker_symbol, quantity, true, date, commission, buy/sell
        
  • Error Handling:

    • Validates quantity, commission, and ticker symbol.
    • Handles file I/O exceptions gracefully.

2. View Portfolio List

  • Displays all saved portfolios (flexible/inflexible) for the current user.

3. Portfolio Composition

  • Shows stocks and their quantities as a percentage of the portfolio.
  • Flexible portfolios can display composition as of a given date.
  • Inflexible portfolios show static composition.

4. Portfolio Value Calculation

  • Calculates total value of a portfolio on a specific date.
  • Flexible portfolios consider transaction history up to the selected date.
  • Inflexible portfolios are valued based on the latest known prices.

5. Cost Basis (Flexible Portfolios Only)

  • Displays the total investment cost including commission fees up to a certain date.

6. Portfolio Performance Over Time

  • Text-Based Chart:

    • Graphical representation using ASCII asterisks.
    • Scales based on value ranges.
  • GUI-Based Chart:

    • Java Swing-based bar chart.
    • Displays yearly value performance.

7. Dollar Cost Averaging Strategy (Flexible Portfolios Only)

  • Invest a fixed amount at regular intervals over a time range.
  • Users specify:
    • Start/End Dates
    • Frequency (in days)
    • Investment amount and commission
    • Percentage distribution among stocks
  • Supports fractional share buying.

8. Persistent Storage

  • Portfolios are saved as CSV files:
    • Inflexible:
      portfolio_name, ticker, quantity, false
      
    • Flexible:
      portfolio_name, ticker, quantity, true, date, commission, buy/sell
      

🧑‍💻 Interface Options

1. Text-Based UI

Run with:

java -jar virtual-stock.jar -text

Supports:

  • Creating/Viewing flexible and inflexible portfolios
  • Portfolio composition and valuation
  • Buying/selling shares
  • Cost basis & performance visualization

2. GUI-Based UI

Run with:

java -jar virtual-stock.jar -gui

Supports:

  • Creating flexible portfolios
  • Portfolio composition and performance
  • Investing by quantity or dollar amount
  • Dollar-cost averaging strategy

About

It is java based application for virtual stock market simulation that helps users learn investment strategies using flexible and inflexible portfolios—all without risking real money.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages