<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ritiksuman07</title>
    <description>The latest articles on DEV Community by Ritiksuman07 (@ritiksuman07).</description>
    <link>https://dev.to/ritiksuman07</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3893234%2Feb54f410-5c53-4456-aaf0-4c8e23935225.png</url>
      <title>DEV Community: Ritiksuman07</title>
      <link>https://dev.to/ritiksuman07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritiksuman07"/>
    <language>en</language>
    <item>
      <title>I built an open-source AI agent that turns a trade idea into a full backtest — here's why</title>
      <dc:creator>Ritiksuman07</dc:creator>
      <pubDate>Thu, 23 Apr 2026 00:54:41 +0000</pubDate>
      <link>https://dev.to/ritiksuman07/i-built-an-open-source-ai-agent-that-turns-a-trade-idea-into-a-full-backtest-heres-why-15n1</link>
      <guid>https://dev.to/ritiksuman07/i-built-an-open-source-ai-agent-that-turns-a-trade-idea-into-a-full-backtest-heres-why-15n1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faj5y37u0iajljau6do0t.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faj5y37u0iajljau6do0t.gif" alt=" " width="980" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've spent a fair amount of time in the world of quantitative finance tooling, and the same frustration kept coming up — getting from an investment idea to an actual tested strategy requires stitching together five different libraries, three data sources, and a lot of glue code that nobody talks about.&lt;/p&gt;

&lt;p&gt;Expensive platforms like Bloomberg or FactSet solve this, but they're locked behind paywalls that make no sense for indie researchers, students, or early-stage quant teams. The open-source alternatives are powerful but fragmented — you get a backtesting library here, a data fetcher there, and you're on your own for everything in between.&lt;br&gt;
So I built QuantFlow.&lt;/p&gt;

&lt;p&gt;What it does&lt;br&gt;
The core idea is simple: you describe a trade thesis in plain English, and QuantFlow runs it through a full research pipeline automatically.&lt;br&gt;
bashpython -m quantflow run "short small-cap biotech on FDA rejection patterns" --ticker XBI --offline --verbose&lt;br&gt;
That one command kicks off a chain of agents that:&lt;/p&gt;

&lt;p&gt;Pull and score SEC filings (10-K, 10-Q, 8-K) for signals relevant to your thesis&lt;br&gt;
Measure Reddit sentiment and mention velocity around the ticker&lt;br&gt;
Convert those signals into an executable strategy with entry/exit rules&lt;br&gt;
Run a deterministic backtest and compute Sharpe ratio, max drawdown, Calmar, and CAGR&lt;br&gt;
Export an equity curve, a report, and store everything in DuckDB for reproducible analysis&lt;/p&gt;

&lt;p&gt;The output isn't just a number — it's a full run artifact you can query, compare, and build on.&lt;/p&gt;

&lt;p&gt;Why this stack&lt;br&gt;
If you look at the repo, you'll notice it's not just Python. There's Go, Rust, and DuckDB in there too. That wasn't accidental.&lt;br&gt;
Python handles the agent logic, strategy orchestration, and backtest runtime. It's where most quant research lives and it made sense to keep the core there.&lt;br&gt;
Go powers the terminal UI — a live Bubble Tea interface that shows you each pipeline stage running in real time. Demos beautifully, and Go's concurrency model makes it clean to build.&lt;br&gt;
Rust is the backtest engine scaffold. The goal is deterministic, low-latency execution — the kind of thing Python struggles with at scale. Rust handles it cleanly via a JSON-driven binary.&lt;br&gt;
DuckDB is the memory layer. Every run — filings, sentiment scores, strategy rules, backtest metrics — lands in a local DuckDB database. This means you can query across runs, compare strategies, and eventually let an LLM reason over historical results without re-fetching raw data every time.&lt;/p&gt;

&lt;p&gt;The AI part&lt;br&gt;
QuantFlow is designed around agentic workflows, but in a way that keeps things reproducible. The LLM slot is intentionally isolated in quantflow/agents/strategy.py — you can plug in Claude, GPT, or any model for strategy orchestration without touching the rest of the pipeline.&lt;br&gt;
Everything downstream of the LLM stays deterministic. The backtest engine doesn't care where the strategy came from — it just runs the rules.&lt;br&gt;
This separation was a deliberate design choice. LLM outputs can be unpredictable. &lt;/p&gt;

&lt;p&gt;Backtest results need to be reproducible. Keeping them in separate layers means you get the creativity of AI-driven thesis generation with the rigor of deterministic execution.&lt;/p&gt;

&lt;p&gt;What I learned building this&lt;br&gt;
The hardest part wasn't the code — it was resisting the urge to over-engineer the AI layer early. It's tempting to make the LLM do everything. In practice, the more you constrain what the LLM touches, the more trustworthy the outputs are.&lt;/p&gt;

&lt;p&gt;DuckDB was a revelation. I initially planned to use Postgres, but DuckDB's ability to run analytical queries on local files with zero setup changed how I thought about the memory layer entirely.&lt;/p&gt;

&lt;p&gt;The multi-language architecture also forced some useful discipline — each layer has to have a clean interface. Go talks to Python via subprocess. Rust talks to the orchestrator via JSON. That constraint made the codebase easier to reason about, not harder.&lt;/p&gt;

&lt;p&gt;Try it&lt;br&gt;
bashpython -m venv .venv&lt;br&gt;
.venv\Scripts\activate&lt;br&gt;
pip install -r requirements.txt&lt;br&gt;
python -m quantflow run "short small-cap biotech on FDA rejection patterns" --ticker XBI --offline --verbose&lt;/p&gt;

&lt;p&gt;The repo is live at github.com/Ritiksuman07/quantflow — stars, issues, and PRs are very welcome. If you're working on anything in the quant/AI agents space, I'd genuinely love to connect.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>ai</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
