Skip to content

Check if the world is burning or not by tracking the VWRA.L ETF

Notifications You must be signed in to change notification settings

wiredmatt/stunk

Repository files navigation

stunk - Market Trend Analyzer

A Python tool that analyzes global market trends using the VWRA.L ETF (Vanguard FTSE All-World UCITS ETF) and provides relevant market news.

Features

  • Market trend analysis using price movement and moving averages
  • Visual representation of market trends
  • Relevant news articles based on market sentiment
  • Configurable analysis parameters

Screenshots

Example Visualization

Mobile Demo Desktop Demo

Installation

  1. Clone the repository
  2. Install dependencies using Poetry:
poetry install
  1. Start docker containers
docker-compose up -d # redis & postgres
  1. Set up Telegram bot with BotFather - OPTIONAL
  1. Set up environment variables
    • cp .env.example .env
    • Sign up at NewsAPI to get a free API key
    • Set TELEGRAM_ALLOWED_CHAT_IDS with the value of your chat ID (from step 4) - OPTIONAL

Usage

Run the analysis

poetry run market_trend

The tool will:

  1. Analyze the market trend using VWRA.L data
  2. Generate a visualization
  3. Display relevant market news
  4. Save everything into the local reports directory

Generated Sample below

📊 View Sample Generated Report

Market Analysis

Price Change 📈

Current Price: $143.78

Change: +3.02%

Market Momentum

Short MA (5d): $143.12

Long MA (10d): $142.20

Trend: Bullish 📈

Recent Market News

📰 Lululemon's international sales were its saving grace this quarter

📅 2024-12-06

📰 Why ConocoPhillips (COP) Has the Biggest Upside Potential Among Oil Stocks

📅 2024-12-03

📰 Amazon plans to ramp up cloud work with Accenture and other consulting firms, according to internal document

📅 2024-12-03

📰 3 Dividend Stocks To Consider With Up To 4.9% Yield

📅 2024-12-03

📰 Morgan Stanley Analyst Says Meta Platforms (META) ‘Farthest Along’ in AI Monetization

📅 2024-12-02

Sample Visualization


Run the Telegram bot

poetry run telegram_bot

Project Structure

  • stunk/
    • config.py: Configuration settings
    • market_trend.py: Main entry point
    • market_analyzer.py: Market trend analysis logic
    • visualizer.py: Market visualization tools
    • news_fetcher.py: News fetching functionality
    • utils.py: Utility functions
    • telegram_bot.py: Telegram bot integration
    • models.py: Data Models and Utility classes
    • storage/
      • init_db.py: Database initialization script
      • models.py: Actual Database Models
      • database.py: SQLAlchemy session management
      • cache.py: Cache implementation
      • connections.py: Database & Cache connection management
    • tests/
      • conftest.py: Shared fixtures
      • test_market_analyzer.py: Tests for market trend analysis
      • test_market_trend.py: Tests for market trend generation
      • test_news_fetcher.py: Tests for news fetching
      • test_telegram_bot.py: Tests for Telegram bot
      • test_visualizer.py: Tests for market visualization

Configuration

Adjust analysis parameters in stunk/config.py

  • Analysis period
  • Moving average periods
  • Visualization settings
  • News search queries

Dependencies

Core

  • docker
  • docker-compose
  • python
  • poetry
  • postgres
  • redis

Libraries

  • yfinance
  • pandas
  • matplotlib
  • newsapi-python
  • python-dotenv
  • python-telegram-bot
  • sqlalchemy
  • redis
  • psycopg2-binary

About

Check if the world is burning or not by tracking the VWRA.L ETF

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages