29 Commits

Author SHA1 Message Date
Michael Simard
e1485aa8df Fix market open price to show opening price instead of stale close
- Extract opening price from Finnhub quote response (field 'o')
- At market open, if current price equals previous close, use opening price
- Prevents showing yesterday's close when market just opened at 9:30 AM ET
- Adds logging when opening price is used

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 12:22:37 -06:00
Michael Simard
8792c03e64 Remove weekend gaps from candlestick charts
- Use index positions instead of datetime for x-axis
- All candles now evenly spaced (no gaps for weekends/holidays)
- Date labels still show actual dates at regular intervals
- Updated example chart to reflect changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 12:17:40 -06:00
Michael Simard
7d88edb6e7 Add example candlestick chart to examples directory
- Save AAPL 30-day candlestick chart as reference
- Add README explaining chart features and data source
- Example shows green/red candles with dark theme

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 12:15:27 -06:00
Michael Simard
1325863837 Switch to candlestick charts with 30-day daily data
- Replace line charts with candlestick charts for better visualization
- Green candles for up days, red for down days
- Daily resolution (30 days) - free tier compatible
- Auto-detect intraday vs daily data for proper time/date formatting
- Note: 5-min intraday requires paid Polygon tier ($199/month)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 12:14:15 -06:00
Michael Simard
f5d05192b9 Fix Polygon API date range to avoid missing data
- End date now uses yesterday to ensure data availability
- Polygon may not have current day data immediately
- Successfully tested with AAPL and TSLA charts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 12:06:28 -06:00
Michael Simard
639abc71f6 Replace Yahoo Finance with Polygon.io for chart data
- Add Polygon.io API client for reliable historical data access
- Update bot to use Polygon instead of Yahoo Finance for charts
- Add POLYGON_API_KEY to config and environment example
- Polygon free tier: 5 API calls/minute, more reliable than Yahoo
- Fallback to FinViz chart URL when Polygon unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 11:48:42 -06:00
Michael Simard
6bbf389a60 Fix chart display by adding FinViz fallback
- Add has_chart_attachment parameter to create_stock_embed()
- Use attachment://chart.png only when chart file is attached
- Fall back to FinViz chart URL when Yahoo Finance chart fails
- Prevents broken image references in Discord embeds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 00:29:10 -06:00
Michael Simard
71e70b77b0 Add matplotlib-based chart generation with Yahoo Finance data
- Add chart_generator.py with price and candlestick chart support
- Implement Yahoo Finance candle data fetching for free historical data
- Update bot to generate and attach charts to stock embeds
- Add matplotlib dependency to requirements.txt
- Configure dual API approach: Finnhub for quotes, Yahoo for charts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 00:25:00 -06:00
Michael Simard
3040ab3cc1 Add earnings calendar feature with command and scheduled delivery
Implement comprehensive earnings calendar functionality that displays upcoming earnings for major companies (market cap > $10B). Feature includes both manual command access and automated weekly delivery.

Key additions:
- Finnhub API integration for earnings calendar data with market cap filtering
- Discord embed formatting grouped by day with EPS/revenue estimates
- !earnings command for manual queries (current or next week)
- Weekly scheduled task (Sunday 6PM ET) for automatic delivery
- Configuration options for market cap threshold and schedule timing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:18:00 -06:00
Michael Simard
02783de4f3 Add custom company name for AMD ticker
Display AMD as "Advanced Money Destroyer" in stock notifications.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 20:21:53 -06:00
Michael Simard
45d9965638 Update stock notifications with company names and new schedule times
Add full company names to stock price notifications displayed alongside tickers. Update scheduled message times from hourly to three specific times: market open (9:30 AM ET), noon (12:00 PM ET), and market close (4:00 PM ET).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 20:18:08 -06:00
Michael Simard
c35771c77a Add Unraid shell alias tip to deployment documentation
Document creating a 'discord' alias on Unraid server for quick navigation to the bot directory.

Useful productivity tip: typing 'discord' instead of the full path after SSH.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:54:02 -06:00
Michael Simard
1a81b584ab Add requests library dependency for crypto API
Required for CoinGecko API HTTP requests in crypto_api.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:44:58 -06:00
Michael Simard
bde07f676f Add cryptocurrency price command via CoinGecko API
New features:
- !crypto <SYMBOL> command to query cryptocurrency prices
- CoinGeckoAPI integration (free, no API key required)
- Support for 20+ popular cryptocurrencies (BTC, ETH, DOGE, etc.)
- 24-hour price change and volume data
- Colored embeds matching price movement
- Alias: !c for quick crypto queries

Uses CoinGecko's free /simple/price endpoint with 30 calls/min rate limit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:44:45 -06:00
Michael Simard
6a6716c4cc Change startup announcement title to 'Bot Restarted'
Update embed title from "Bot Update" to "Bot Restarted" for clearer messaging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:37:56 -06:00
Michael Simard
65fab3ee35 Add dedicated channel for startup announcements
Add STARTUP_ANNOUNCEMENT_CHANNEL_ID to control where startup announcements are sent.

Changes:
- New config: STARTUP_ANNOUNCEMENT_CHANNEL_ID
- Announcements sent only to specified channel
- Falls back to first CHANNEL_ID if not set
- Prevents announcement spam in all stock update channels

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:34:00 -06:00
Michael Simard
388430780d Add optional startup announcement feature
Bot can now send a one-time announcement to all configured channels when it starts.

Configuration:
- Set STARTUP_ANNOUNCEMENT in .env with your message
- Leave empty to disable announcements
- Prevents duplicate announcements on reconnects

Usage example:
STARTUP_ANNOUNCEMENT=Bot updated! New features: colored prices and charts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:32:32 -06:00
Michael Simard
76516a4e73 Remove grey background from price change text
Remove ANSI code block formatting from price change field to eliminate grey background box. Price change now displays as plain text while maintaining color indication via embed border.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:31:02 -06:00
Michael Simard
9e64d2793f Revert to FinViz daily charts, remove custom chart generation
Remove Finnhub + QuickChart candlestick chart code. Chart generation will be handled by a separate service in the future.

Simplified back to FinViz daily charts for reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:36:16 -06:00
Michael Simard
6f6b6360ca Implement custom 5-minute candlestick charts via Finnhub + QuickChart
Replace FinViz charts with custom-generated candlestick charts:
- Fetch 5-minute OHLC data from Finnhub API
- Generate candlestick chart images via QuickChart API
- Display last 50 candles with time-based x-axis
- Fallback to FinViz daily chart if intraday data unavailable

New FinnhubAPI methods:
- get_intraday_candles(): Fetch 5-min candle data
- generate_chart_url(): Create QuickChart URL from candle data

Chart specifications: 800x400px, Chart.js v3, candlestick type

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:31:18 -06:00
Michael Simard
30ebd85712 Switch from 5-minute intraday to daily chart
Changed chart timeframe from 5-minute intraday (p=i5) to daily (p=d) for better reliability and availability on FinViz free tier.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:27:23 -06:00
Michael Simard
c5251a05da Embed FinViz 5-minute intraday chart in stock updates
All stock price embeds now include a FinViz candlestick chart showing 5-minute intraday data with technical analysis indicators.

Chart displays below price information in embed format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:24:38 -06:00
Michael Simard
2cdf37191a Add colored text for price change in embeds
Price change values now display with ANSI color formatting matching the embed border color:
- Red text for negative price changes
- Green text for positive price changes
- Blue text for no change

Improves visual clarity by color-coding the percentage change field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:14:37 -06:00
Michael Simard
3728649900 Fix permission denied error on Unraid deployment
Resolved Docker container startup failures on Unraid /boot partition.

Changes:
- Remove development volume mount from docker-compose.yml
- Container now uses files baked into image during build
- Remove obsolete docker-compose version attribute
- Add permission fix in deploy.sh for /boot partition

The volume mount was causing permission issues by exposing /boot files
with restrictive permissions directly to the container.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:07:04 -06:00
Michael Simard
327e7e0914 Add multi-channel support for stock updates
Bot now supports sending updates to multiple Discord channels simultaneously.

Changes:
- CHANNEL_ID accepts comma-separated list of channel IDs
- Config parses and validates multiple channel IDs
- Hourly and market close updates sent to all configured channels
- Update .env.example to show multi-channel format
- Document multi-channel configuration in README

Example: CHANNEL_ID=1442203998932304035,9876543210123456789

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 19:01:01 -06:00
Michael Simard
584ad2a4f4 Add market close updates and update deployment path for Compose Manager
Bot enhancements:
- Add scheduled update at market close (4:00 PM ET on trading days)
- Implement is_trading_day() method to check weekdays/holidays
- Market close update sends PYPL price at end of trading day

Deployment changes:
- Update all scripts to use Docker Compose Manager plugin path
- New path: /boot/config/plugins/compose.manager/projects/discord-stock-bot
- Container now integrates with Unraid Docker UI Compose section
- Update documentation with plugin integration details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:57:13 -06:00
Michael Simard
770701e293 Document git-based deployment flow and update scripts
- Add comprehensive deployment architecture documentation to DEPLOYMENT.md
- Include ASCII diagram showing local → Gitea → Unraid flow
- Document all three deployment scripts with examples
- Update scripts to use root@192.168.2.61 for SSH authentication
- Add automatic SSH config setup in deploy.sh for git server port 28
- Include troubleshooting section for common deployment issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:52:44 -06:00
Michael Simard
859f011dda Add automated deployment scripts for Unraid
Implements git-based deployment workflow with three scripts:
- setup-unraid.sh: One-time SSH and git configuration
- deploy.sh: Automated deployment via git pull and docker compose
- manage.sh: Remote management utilities (logs, restart, status)

Configuration targets 192.168.2.61 at /mnt/user/docker/custom-dockers/discord-stock-bot

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:45:09 -06:00
Michael Simard
3b6f0cbe4a Initial commit: Discord stock bot with hourly PYPL updates
Functional Discord bot with automated hourly stock price updates during NYSE trading hours. Supports manual queries for any ticker via prefix commands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:25:37 -06:00