This guide walks you through setting up BreakoutAnalysis for the first time.
git clone https://github.com/your-username/BreakoutAnalysis.git
cd BreakoutAnalysis
pip install -r requirements.txt
playwright install chromiumcp config/config.example.json config/config.jsonNow edit config/config.json. The sections below explain each part.
⚠️ Never commitconfig/config.json— it's in.gitignorefor a reason.
- Create a free account at alpaca.markets
- Go to API Keys → generate a key for Paper Trading
- Set in config:
"alpaca": { "api_key": "YOUR_KEY", "api_secret": "YOUR_SECRET", "use_paper": true, "data_feed": "iex" }
| Feed | Plan | Recommendation |
|---|---|---|
"iex" |
Free | Good for getting started |
"sip" |
Algo Trader (~$9/mo) | Recommended — consolidated feed from all US exchanges, lower miss rate |
To use SIP, subscribe at alpaca.markets/data then change "data_feed": "sip".
If no Alpaca key is set, the screener still runs — historical quality filtering is simply skipped.
- Get an API key from Google AI Studio
- Set in config under all
gemini-*model entries:{ "name": "gemini-2.5-flash", "api_key": "YOUR_GEMINI_KEY" } - Set
"current_model": "gemini-2.5-flash"
- Get an API key from platform.openai.com
- Set in config under the
gpt-*model you want to use - Set
"current_model": "gpt-4.1-mini"(or your preferred model)
- Install Ollama and pull
llama3.2-visionordeepseek-r1-distill-qwen-7b - No API key needed; set
"current_model": "llama-3.2-vision"
If no LLM is configured, alerts are sent without AI analysis.
- In your Discord server: Server Settings → Integrations → Webhooks → New Webhook
- Copy the webhook URL and set in config:
You can use the same webhook for both or create two separate channels.
"discord": { "webhook_url": "https://discord.com/api/webhooks/YOUR_STOCK_ALERTS_WEBHOOK", "webhook_url_market_report": "https://discord.com/api/webhooks/YOUR_MARKET_REPORT_WEBHOOK" }
If not configured, Discord notifications are skipped silently.
Email uses Gmail OAuth2. This is the most involved setup.
- Go to Google Cloud Console
- Create a project → Enable the Gmail API
- Create OAuth2 credentials (Desktop App type) → Download as
credentials.json - Place
credentials.jsonin the project root - Run the OAuth flow:
python scripts/run_gmail_oauth_flow.py
- This generates
token.json(gitignored)
If
credentials.json/token.jsonare missing, email is skipped.
Screenshots require a TradingView account and your chart's URL ID.
- Open your chart on TradingView — copy the ID from the URL:
https://www.tradingview.com/chart/**ABC123XY**/ - Set in config:
"tradingview": { "chart_id": "ABC123XY", "cookies": { "sessionid": "...", "sessionid_sign": "...", "device_t": "..." } }
- To get cookies: open TradingView in Chrome → F12 → Application → Cookies → tradingview.com
Copy the values for
sessionid,sessionid_sign, anddevice_t
If cookies aren't set, screenshots are skipped. The screener and alerts still work.
python src/tradealerts.pyThe bot runs in a loop, checking every 15 minutes during market hours. Check the logs for startup messages confirming which integrations are active.
Instead of editing config/config.json, you can set these environment variables:
export ALPACA_API_KEY=your_key
export ALPACA_API_SECRET=your_secret
export ALPACA_DATA_FEED=sip
export GEMINI_API_KEY=your_gemini_key
export DISCORD_WEBHOOK_URL=your_webhookSee src/utils/config_loader.py for the full list of supported overrides.