Skip to content

About

A Qt Widgets application that displays basic stock screener data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Stock Screener

A Qt 6 desktop app with a dark, Finviz-style table: Reddit r/wallstreetbets sentiment, SEC EDGAR fundamentals, World Bank US CPI, a Stooq portfolio snapshot, plus Finnhub (quote, metrics, analyst trends) and Twelve Data (RSI, MACD, EMA) per ticker. Data is merged into a single QTableView model.

image

Tech stack

  • C++17
  • Qt 6 (Core, Widgets, Network)
  • CMake

Project layout

Path Role
src/main.cpp Application entry
src/ui/mainwindow.* Main window, toolbar, table, log, status bar, stylesheet
src/ui/sentimentdelegate.* Custom delegate for the Sentiment column (value + mini bar)
src/network/apiclient.* All HTTP clients, throttled queue for Finnhub/Twelve, signals
src/models/screenermodel.* QAbstractTableModel (16 columns, colors, sorting roles)
src/models/stockdata.h Row struct (ticker, fundamentals, market / technical fields)
src/core/utils.h Header-only parsers and helpers (Reddit, SEC, CPI, Stooq, Finnhub & Twelve JSON)

Requirements

  • CMake ≥ 3.16
  • Qt 6 development packages: Core, Widgets, Network
  • C++17 compiler
  • Optional: clang-format, gdb (see Makefile targets)

Build and run

CMake

cmake -S . -B build
cmake --build build -j
./build/StockScreener

Makefile shortcuts

make build
make run

Other targets: configure, debug, format, format-check, clean (see Makefile).

UI notes

  • Table: Fixed column widths and Qt::ElideNone so labels like EPS, CPI, Beta, and Analyst (Neutral / Bullish / Bearish) are not truncated with …. Widen the window or adjust widths in mainwindow.cpp if you add longer headers.
  • Theme: Dark QSS in MainWindow::applyStylesheet() (#0d1117, #161b22, #30363d, etc.).
  • Status bar: Tags for SEC, WSB, Portfolio, Econdb (World Bank CPI), Finnhub, Twelve Data (✓ / ✗ / —).

Data flow

  1. Fetch / Refresh runs Reddit, World Bank CPI, Stooq (query ticker or default), optional SEC for the typed ticker, and queues Finnhub + Twelve jobs for every row currently in the table (if the table is empty until Reddit returns, fetch again after rows appear).
  2. Finnhub and Twelve Data share a single FIFO queue in ApiClient: at most one Finnhub request every 200 ms and one Twelve request every 8 seconds (free-tier friendly). Other APIs are unchanged and not throttled on that queue.

API sources (reference)

Source Usage
Reddit WSB hot JSON Sentiment scores for a fixed watchlist
SEC EDGAR company facts EPS, revenue (per CIK / ticker)
World Bank US CPI inflation indicator
Stooq CSV Portfolio / snapshot line for selected ticker
Finnhub Quote (c, dp), stock/metric, stock/recommendation
Twelve Data rsi, macd, ema (daily, outputsize=1)

API keys for Finnhub and Twelve are embedded in src/network/apiclient.cpp for this demo. For production, move them to environment variables or a local config file and do not commit secrets.

SEC: Requests must use a descriptive User-Agent (see apiclient.cpp).

utils.h helpers (Finnhub / Twelve)

Shared JSON helpers used by ApiClient include:

  • jsonGetDouble — numeric field from a QJsonObject (uses existing toDoubleSafe)
  • finnhubQuotePriceAndChangePct, finnhubExtractMetrics, finnhubAnalystScoreFromRecommendationJson
  • twelveDataFirstValuesRow, twelveDataApiErrorMessage, twelveDataFirstSeriesDouble, twelveDataMacdMinusSignal

Code style

.clang-format (LLVM-based, Allman braces, 4 spaces). Run make format or make format-check.

Limitations

  • Third-party APIs may change schemas or rate limits without notice.
  • Finnhub/Twelve queues are sequential; many tickers imply a long total refresh time.
  • Tracked Reddit tickers and CIK map are curated in code (utils.h / apiclient patterns), not a full market database.

About

A Qt Widgets application that displays basic stock screener data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages