gitmyhub

quant-alpha

Python ★ 1 updated 6d ago

An AI research agent that invents quantitative trading signals, prunes the weak ones, and accumulates memory to propose better signals over time, graded by a deterministic backtest that cannot be fooled.

PythonGoogle GeminiMongoDB AtlasVoyage AIFastAPIViteDigitalOceansetup: hardcomplexity 4/5

DARWIN is a Python-based research system that automatically invents quantitative trading signals (called alphas), tests each one against historical stock market data, keeps the ones that work, and uses memory of past results to get progressively better at proposing new signals. The core claim is that the improvement is measured by a deterministic backtest, not by an AI judging itself.

The system runs in generations. Each generation, it evaluates every signal currently in its library against a trailing window of data using metrics like information coefficient, turnover, and transaction costs. Weak or redundant signals get pruned. A language model then proposes new candidate signals based on a memory store of every past success and failure. These candidates are tested in a sandboxed backtest on data the proposer has not seen, and only the ones that pass get added to the library. The whole fleet is then scored on the next out-of-sample block.

The memory layer is the key piece. In a controlled experiment across 600 US stocks from 2013 to 2024, the system with memory enabled discovered 68 keeper signals with positive out-of-sample quality, compared to 31 without memory and 21 from random formula search, which averaged negative quality. Memory more than doubled the number of useful signals found.

The tech stack combines Google Gemini 2.5 Flash as the primary alpha proposer, MongoDB Atlas with Voyage AI embeddings for the memory and similarity search layer, a managed agent called Antigravity that spins up an isolated cloud environment to browse research literature and write code for new signals, and MiniMax M2.5 served on DigitalOcean Gradient as an alternative reasoning model.

The demo dashboard runs locally with one shell script and replays a committed research run offline. A live mode is also available for proposing or researching new signals in real time.

The README is upfront about limitations: net of realistic trading costs the book does not make money, and the 2024 holdout was not exceptional. The contribution is the improving research loop itself, not a profitable trading strategy.

Where it fits