A systematic S&P 500 stock scanner with a Tkinter desktop GUI. It fetches daily OHLCV data, computes technical indicators, detects trade signals, and walks candidates through a multi-step pipeline from scan to backtest.
Requires Python 3.11+ and Tkinter (included with most Python installs).
# Create a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Launch the GUI
python app.pyThe scanner runs a six-step pipeline. Each step reads the previous step's output from outputs/.
| Step | Module | Description |
|---|---|---|
| 1. Scanner | src/scanner.py |
Fetches OHLCV data, computes indicators, detects LONG/SHORT signals, outputs candidates.json |
| 2. GPT Briefs | src/gpt_briefs.py |
Generates a prompt for GPT-based fundamental analysis |
| 3. Select Trades | src/select_trades.py |
Filters candidates through hard rules and GPT scores |
| 4. Prepare Orders | src/prepare_manual_orders.py |
Computes entry ranges, stop distances, and position sizes |
| 5. Backtest | src/backtest.py |
Runs a historical backtest simulation |
| 6. Analyze | src/analyze_backtest.py |
Produces performance analytics and reporting |
trading-scanner/
app.py # GUI entry point
config.yaml # Strategy and risk parameters
requirements.txt # Python dependencies
pyproject.toml # Build metadata
src/
scanner.py # Market scanner pipeline
config.py # YAML config loader
indicators.py # Technical indicator calculations
signals.py # Signal detection (pullback, breakout, short setups)
filters.py # Price, volume, and liquidity filters
rank.py # Candidate scoring
regime.py # Market regime classification (BULL/BEAR/etc.)
risk.py # Position sizing and regime risk multipliers
data.py # OHLCV data fetching via yfinance
universe.py # S&P 500 ticker list loader
gui/
app.py # Tkinter bootstrap
main_window.py # Main window, menu bar, settings dialog
pipeline_runner.py # Step execution (subprocess or import mode)
views/ # Tabbed views (candidates, orders, backtest, etc.)
outputs/ # Pipeline artifacts (gitignored)
data_cache/ # Ticker lists, earnings data, run history
All strategy and risk parameters live in config.yaml. Key settings include account size, risk per trade, position limits, lookback period, and backtest date range. See the file for full documentation.
To run the scanner without the GUI:
python -m src.scannerTo run the full nightly pipeline (scanner + GPT briefs + auto-select):
python -m src.nightly