A Python tool that analyzes global market trends using the VWRA.L
ETF (Vanguard FTSE All-World UCITS ETF) and provides relevant market news.
- Market trend analysis using price movement and moving averages
- Visual representation of market trends
- Relevant news articles based on market sentiment
- Configurable analysis parameters
- Clone the repository
- Install dependencies using Poetry:
poetry install
- Start docker containers
docker-compose up -d # redis & postgres
- Set up Telegram bot with BotFather - OPTIONAL
- Sign up with BotFather
- Create a bot and get the token
- Send the bot a message and check for your chat ID in getUpdates endpoint
- Set up environment variables
poetry run market_trend
The tool will:
- Analyze the market trend using VWRA.L data
- Generate a visualization
- Display relevant market news
- 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
📅 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
poetry run telegram_bot
stunk/
config.py
: Configuration settingsmarket_trend.py
: Main entry pointmarket_analyzer.py
: Market trend analysis logicvisualizer.py
: Market visualization toolsnews_fetcher.py
: News fetching functionalityutils.py
: Utility functionstelegram_bot.py
: Telegram bot integrationmodels.py
: Data Models and Utility classesstorage/
init_db.py
: Database initialization scriptmodels.py
: Actual Database Modelsdatabase.py
: SQLAlchemy session managementcache.py
: Cache implementationconnections.py
: Database & Cache connection management
tests/
conftest.py
: Shared fixturestest_market_analyzer.py
: Tests for market trend analysistest_market_trend.py
: Tests for market trend generationtest_news_fetcher.py
: Tests for news fetchingtest_telegram_bot.py
: Tests for Telegram bottest_visualizer.py
: Tests for market visualization
Adjust analysis parameters in stunk/config.py
- Analysis period
- Moving average periods
- Visualization settings
- News search queries
- docker
- docker-compose
- python
- poetry
- postgres
- redis
- yfinance
- pandas
- matplotlib
- newsapi-python
- python-dotenv
- python-telegram-bot
- sqlalchemy
- redis
- psycopg2-binary