Skip to main content
aifinhub

Generator

Trading System Blueprinter

Pick your data source, LLM, broker, storage, risk engine, logger. Get a Mermaid architecture diagram + starter repo scaffold (ZIP). Browser-only. Free.

Inputs
Configuration
Runtime
Instant
Privacy
Client-side · no upload
API key
Not required
Methodology
Open →

Education · Not investment advice. BaFin/EU framework. Past performance does not indicate future results. Editorial standards Sponsor disclosure Corrections

1 · Pick your stack

Data source

Where your bars / quotes / book events come from.

Broker

Who your orders route through.

LLM layer

Research + decision-support model. BYO keys.

Storage

How you persist bars, trades, decisions, dossiers.

Risk engine

What stops you from blowing up.

Logging + observability

How you see what the agent actually did.

Scheduler

How cadence is enforced.

Stack signature

Alpaca → Claude Opus 4.8 → Alpaca

7 / 7 layers chosen · risk: Fractional Kelly sizer (quarter Kelly cap)

Schedule: launchd (macOS-native)  ·  Storage: DuckDB + Parquet  ·  Logging: Heartbeat JSON + Telegram alerts

2 · Architecture (Mermaid)

flowchart LR
  SCHED["launchd"] -->|tick| DATA["alpaca"]
  DATA -->|bars / book events| NORM[Normalize + persist]
  NORM --> STORE["duckdb"]
  STORE --> RESEARCH["claude-opus-4-8 · price-blind research"]
  RESEARCH -->|proposal + confidence| RISK["fractional-kelly"]
  RISK -->|sized order| EXEC["alpaca"]
  EXEC -->|fills + errors| LOG["heartbeat-json"]
  LOG --> STORE
  LOG -.-> ALERT[Telegram / email]

Paste into any Mermaid-compatible renderer (Notion, Obsidian, GitHub, VS Code preview).

3 · Starter repo scaffold

trading-system/
├── README.md                    # start here
├── .env.example                 # API keys (never commit real values)
├── scripts/
│   ├── fetch-bars.py            # data source → local duckdb
│   ├── research.py              # LLM call (price-blind context builder)
│   ├── decide.py                # risk sizing + decision logger
│   ├── execute.py               # broker call (idempotent)
│   └── heartbeat.py             # health probe + alert
├── data/
│   ├── heartbeat.json           # last-heartbeat timestamp (watchdog reads)
│   ├── circuit.json             # {"paused": false, "reason": ...}
│   └── tickers/                 # per-ticker markdown dossiers
├── memory/
│   └── decisions.jsonl          # append-only decision log
├── plists/
│   └── com.you.trader-*.plist   # launchd-based schedules
├── tests/
│   ├── test_research_no_price_leak.py
│   ├── test_sizing_caps.py
│   └── test_idempotent_orders.py
└── pyproject.toml

Minimal, opinionated layout. Everything non-runtime lives outsidescripts/. Add pyproject / requirements to taste.

Why this shape

  • · Schedule → data → research → risk → execute → log enforces the ordering that keeps your LLM out of the price decision loop.
  • · Heartbeat + circuit breaker are first-class so you can spot dead pipelines in under one cycle.
  • · Append-only decisions.jsonl makes post-mortems possible; any LLM-driven system is unauditable without it.
  • · Tests cover the three most dangerous failure modes: price leakage, sizing blow-up, duplicate orders.

See methodology for the principle set this generator encodes.

How to use

Step-by-step

Full calculator guide →
  1. 1

    Pick your data source (Databento, Alpaca, Polygon, or Tiingo). This sets the ingestion layer in the diagram.

  2. 2

    Choose the LLM for signal generation and the broker for execution (Alpaca, IBKR, Tradier, or paper trading).

  3. 3

    Select the storage backend, risk engine (fractional Kelly, vol-target, max-drawdown kill, or no risk layer), logger, and scheduler.

  4. 4

    Read the Mermaid architecture diagram — it reflects your seven selections and shows how each layer connects.

  5. 5

    Copy the starter file tree to your clipboard. It's a scaffold — wire your own tests, secrets management, and observability before pointing it at real capital. There is no ZIP download and no compliance section.

For agents

Use in an agent

Same math, same result shape as the UI above — as a static ES module. No HTTP request, no auth, no rate limit.

import { compute } from "https://aifinhub.io/engines/trading-system-blueprinter.js";

Contract: /contracts/trading-system-blueprinter.json Full agent guide →

Glossary references

Terms used by this tool

All glossary →

Questions people ask next

FAQ

What does the blueprint output look like?

A Mermaid architecture diagram that reflects your seven picks (data source, LLM, broker, storage, risk engine, logger, scheduler) and a copyable starter file tree for the repo. It's a shape-and-scaffold tool: the diagram is the discussion artefact, the file tree is the folder skeleton — not a per-component spec or a generated codebase.

Is this for institutional or retail?

There is no scope selector. The seven dropdowns target small-team, single-strategy production — a useful starting point for any automated strategy. Choosing the paper broker gives a research-only scaffold; a live broker adds an execution layer to the diagram. Scale the file tree to your actual needs by hand.

What does it recommend for execution infrastructure?

For retail automated strategies the execution layer is a broker API (IBKR, Alpaca, Tradier, or paper), and the tool reflects your broker choice in the diagram. Colocation and direct-exchange-connectivity tradeoffs are outside what the tool models — the methodology page discusses them, but the blueprint won't generate them.

Does it cover compliance and audit logging?

It picks a logger for the diagram (heartbeat JSON, Loki/Grafana, Sentry, or stdout), but it does not generate a compliance section, trade-blotter spec, or FINRA-recordkeeping checklist. Regulatory recordkeeping is your responsibility, not something the tool outputs.

Are there template configs I can copy?

The output is a copyable file tree — a folder-and-file skeleton you paste into a new repo — plus the Mermaid diagram. There are no downloadable docker-compose files, Terraform templates, monitoring dashboards, or links to template repositories; you wire the real implementation yourself.

Complementary tools