paper in,
backtest out.
dorq turns a quantitative research paper into a backtested trading strategy. Drop in a PDF or a URL — a local LLM extracts the strategy, a deterministic engine runs it against real market data, and you see whether the idea actually beats buy-and-hold.
A PDF file or a URL (an arXiv link works). docling
converts it to Markdown and dorq pulls out the abstract, methodology,
and results sections.
Two modes. Spec mode (default): the model produces a structured
StrategySpec — indicators, entry/exit rules, assets, date range — that a
deterministic engine executes; no model-written code ever runs, and the conditions are
editable before you run. Code mode: the model writes a pandas strategy()
you can inspect and edit, executed in an AST-validated sandbox — no imports, no
filesystem, no network.
Adjust assets, date range, position sizing, stop loss / take profit,
initial cash. Market data comes from Alpaca's free API; vectorbt simulates
the portfolio. Run as many variations as you like.
Total return against an equal-weight buy-and-hold benchmark, interactive equity and drawdown charts, Sharpe / Sortino / profit factor, a per-trade log with entry/exit markers on the price chart, run-by-run comparison — plus a chat panel for interrogating the paper and the strategy.
$ git clone https://github.com/unh0lymos3s/dorq.git $ cd dorq $ uv sync --dev
# any tag your Ollama serves — nothing is baked into the code $ ollama pull <model> # server env only — the client never sends keys (or use a .env file) $ export DORQ_OLLAMA_MODEL=<model-tag> $ export DORQ_ALPACA_API_KEY=... $ export DORQ_ALPACA_SECRET_KEY=...
Prefer an Ollama cloud tag? Your local Ollama proxies it to
ollama.com — run ollama signin once. LLM features return
503 ollama_not_configured until a model is set.
$ uv run uvicorn main:app --port 8000
Open http://localhost:8000 — the pre-built SPA in
frontend/ is served by FastAPI.
$ cd ui $ npm install $ npm run dev # Vite dev server, proxies to :8000 $ npm run build # emits ../frontend (served by FastAPI)
$ uv run pytest # the Alpaca integration test is opt-in
dorq runs on Ollama.
Strategy extraction and paper Q&A are served by a single local Ollama
instance — you bring whatever model your machine (or your ollama.com
account) can run. No provider keys, no per-token bills, no paper
leaves your box.