Skip to content

cpablomrod/Stock-price-tracker

Repository files navigation

Stock Price Tracker

A desktop GUI application built with Python and tkinter that allows you to track real-time stock prices and view historical price charts.

Features

  • Real-time Price Updates: Get current stock prices with automatic refresh every 30 seconds
  • Price History Charts: View 30-day price history charts for selected stocks
  • Multiple Stock Tracking: Add and remove multiple stocks from your watchlist
  • Persistent Storage: Your tracked stocks are saved and restored when you restart the app
  • Color-coded Changes: Price changes are displayed in green (up) or red (down)
  • Company Information: View company names alongside stock symbols

Requirements

  • Python 3.8 or higher
  • Required Python packages (see requirements.txt):
    • yfinance
    • matplotlib
    • pandas
    • numpy

Installation

  1. Clone or download this project to your local machine
  2. Navigate to the project directory
  3. Create a virtual environment:
    python3 -m venv venv
  4. Activate the virtual environment:
    source venv/bin/activate  # On macOS/Linux
    # or
    venv\\Scripts\\activate  # On Windows
  5. Install the required dependencies:
    pip install -r requirements.txt

Usage

  1. Easy way: Run the shell script (recommended):

    ./run.sh
  2. Manual way: Activate virtual environment and run:

    source venv/bin/activate
    export TK_SILENCE_DEPRECATION=1
    python run_stock_tracker.py
  3. Adding Stocks:

    • Click the "Add Stock" button
    • Enter a valid stock symbol (e.g., AAPL, GOOGL, MSFT, TSLA)
    • The stock will be added to your watchlist
  4. Viewing Stock Information:

    • Click on any stock in the left panel
    • View current price, change, and company information
    • See the 30-day price history chart on the right
  5. Removing Stocks:

    • Select a stock from the list
    • Click the "Remove Stock" button
  6. Auto-refresh:

    • The app automatically refreshes stock data every 30 seconds
    • You can disable/enable this feature using the checkbox
    • Use "Refresh All" button for manual refresh

Stock Symbols

You can track stocks from major exchanges. Some popular symbols include:

  • Tech: AAPL (Apple), GOOGL (Google), MSFT (Microsoft), TSLA (Tesla)
  • Finance: JPM (JPMorgan), BAC (Bank of America), WFC (Wells Fargo)
  • Retail: AMZN (Amazon), WMT (Walmart), TGT (Target)
  • ETFs: SPY (S&P 500), QQQ (NASDAQ), VTI (Total Stock Market)

Data Source

This application uses Yahoo Finance data through the yfinance library. The data is free but may have slight delays and is subject to Yahoo Finance's terms of service.

Troubleshooting

  1. "Invalid stock symbol" error: Make sure you're using the correct stock ticker symbol
  2. Network errors: Check your internet connection
  3. Slow loading: Stock data fetching depends on network speed and Yahoo Finance response time

Files

  • stock_tracker.py: Main application file
  • requirements.txt: Python dependencies
  • tracked_stocks.json: Automatically created file to store your stock list
  • README.md: This documentation file

License

This project is for educational purposes. Please respect Yahoo Finance's terms of service when using this application.

About

Real-Time stock price tracker with interactive charts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors