Nightly analysis of a retail swing-trader's watchlist with automated paper-trade execution via Alpaca Markets.
Every day at 8:30 PM Central Time, the system:
- Pulls closing prices for every symbol on your watchlist.
- Fetches recent news from Yahoo Finance.
- Computes support & resistance levels using pivot-point clustering.
- Runs multi-timeframe trend analysis (10/20/50-day MAs, ADX, RSI, ATR).
- Generates a plain-English recommendation for each stock:
- Whether to scalp, swing (1-3 days), or hold a continuation trade (multi-day/week).
- Key levels to watch and estimated days for a $10 move.
- Optionally submits bracket orders (market entry + take-profit + stop-loss) to your Alpaca paper-trading account.
- Manages existing positions: closes trades whose trend alignment has broken.
AAPL NVDA MU UNH TSLA MSTR AMD MSFT
AMZN TSM BIDU PLTR XLB SLV SIL PAAS
AG CDE SVM
# 1. Clone the repo
git clone <repo-url> && cd <repo>
# 2. Create a virtual environment
python3 -m venv .venv && source .venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure API keys
cp .env.example .env
# Edit .env and add your Alpaca paper-trading keys
# Get them at https://app.alpaca.markets/paper/dashboard/overview# Run the report once (no scheduling, no orders)
python main.py --once
# Run the report once AND submit paper trades to Alpaca
python main.py --once --trade
# Start the 8:30 PM CT daily scheduler (report only)
python main.py
# Start the scheduler with auto paper-trading enabled
python main.py --trade
# Override the default watchlist
python main.py --once --symbols "AAPL,TSLA,NVDA"
# Check Alpaca account status
python main.py --account
# List open positions
python main.py --positions
# Cancel all open orders
python main.py --cancel-ordersEach symbol in the nightly report includes:
| Field | Description |
|---|---|
| Close | Most recent closing price |
| News | Up to 8 recent headlines with links |
| Support | Up to 4 clustered support levels below current price |
| Resistance | Up to 4 clustered resistance levels above current price |
| Trend (10/20/50d) | Bullish / Bearish / Neutral per timeframe |
| ADX | Trend strength (>25 = trending, >30 = strong) |
| RSI | Overbought (>70) / Oversold (<30) |
| ATR | Average daily dollar range |
| Recommendation | Scalp vs. swing vs. continuation advice |
| $10 Move Estimate | Days needed at current ATR |
- Trend continuation: All timeframes aligned + ADX >= 25 → bracket order in trend direction.
- ADX >= 30: TP = 2.5x ATR, SL = 1x ATR (multi-day hold)
- ADX 25-30: TP = 1.5x ATR, SL = 1x ATR (swing)
- Mean-reversion: RSI <= 30 near support → buy; RSI >= 70 near resistance → sell.
- Nightly review: close positions whose trend alignment breaks or ADX < 20.
- Position sizing: 5% of equity per trade, capped at 1% risk per ATR.
- Maximum 10 concurrent positions.
├── main.py # CLI entry point
├── src/
│ ├── config.py # All configuration and constants
│ ├── data_fetcher.py # Price history and news from Yahoo Finance
│ ├── technical_analysis.py# S/R levels, trend metrics, recommendations
│ ├── strategy.py # Trade idea generation and position management
│ ├── alpaca_trader.py # Alpaca paper-trading API wrapper
│ ├── scheduler.py # 8:30 PM CT scheduler loop
│ └── report_generator.py # Nightly report text builder
├── tests/ # Test suite
├── reports/ # Saved nightly reports (gitignored)
├── requirements.txt
├── .env.example
└── .gitignore
