QuantCraft documentation reference
QuantCraft ships two complementary kinds of documentation: in-app topics you read inside the IDE, and strategy reference Markdown bundled with the product for deeper API detail. Together they describe how to write strategies, run backtests, and use the IDE. These web docs mirror many of those topics — start with Introduction or Getting started.
Where to read docs in the app
- Open QuantCraft from the main app.
- Expand the right sidebar (if it is collapsed).
- Open the Documentation tab (alongside QuantCraft AI).
You land on a searchable index of topics. Type in the search box to filter by title, summary, or embedded keywords (for example on_finish, PaperAccount, chart_indicator_series).
Tap a topic card to open the full article. Use Back to return to the index.
Topic index (in-app)
Topics are grouped into two sections, matching the Documentation sidebar.
Getting started
| Topic | What you will learn |
|---|---|
| Fundamentals | Financial statement data, date-keyed tables, how fundamentals align to bars, and how to read them in a strategy. |
| Fama-French factors | Global monthly FF3/FF5 factor returns via fama_french.qc (Premium; no callback argument). |
| Account | PaperAccount: balances, positions, orders, PnL, and performance metrics exposed during a backtest. |
| Life cycle | Callback order: on_init, on_bar, on_tick, optional on_timer (forward only), on_finish — including multi-symbol basics and optional full-series on_finish(bars). |
Reference
| Topic | What you will learn |
|---|---|
| Input parameters | Declaring quantcraft.inputs.params (legacy ide.inputs_module / quantcraft.inputs_module), types, and how values are supplied from run modals (backtest, bulk forward, chart forward). |
| Run presets (.qcs) | Save and reload run modal settings as .qcs files in your workspace. |
| Debugging | Debug Run vs Debug Test, breakpoints, stepping, call stack and variables. |
| Auto Trading | Local forward runs for algorithms and agents, New Bulk / Agent Bulk Run, and monitoring bulk / chart jobs. |
| Quant Cloud | Bulk forward runs on cloud runners when your PC is off (desktop user guide). |
| Agents | Visual node-based automations — backtest on paper; forward / live via Alpaca when configured. |
| OHLCV | Bar shape (OhlcvBarView), loaders (Alpaca vs B2), time ranges, and using bar data in callbacks. |
| Indicator series | Building chart_indicator_series overlays (lines, histograms, panes) on backtest result charts. |
Any card in the index that does not open a full article yet is labeled Soon in the UI.
How the in-app docs relate to your workflow
Use this quick map when you are doing something in the IDE:
| You want to… | Start with |
|---|---|
| Configure symbols, dates, fundamentals, and run a simulation | Strategy lifecycle + OHLCV; then Running code (Test) and Test results. |
| Size positions, stops, or read Sharpe / drawdown | Account model |
| Let users tune thresholds without editing code | Input parameters |
| Plot custom series on the equity chart | Indicator series |
| Mix price and filings / statements | Fundamentals |
| Mix price and global factor returns | Fama-French factors |
| Combine primary and secondary timeframes | OHLCV and bar data — Additional timeframes + rt.get_bar |
| Reuse backtest or forward modal settings | Run presets (.qcs) |
| Pause on a line and inspect variables | Debugging |
| Run algos forward on your own machine | Auto Trading |
| Run algos on a remote runner | Quant Cloud |
| Build an automation from visual nodes | Agents |
The in-app articles are written for strategy authors and IDE users. Server operator setup for Quant Cloud is not covered in these public docs.
Strategy imports
New strategy code should use the quantcraft.* namespace with suffix-free module names (for example quantcraft.inputs, not quantcraft.inputs_module). Legacy ide.*_module and intermediate quantcraft.*_module imports remain fully supported — existing strategies do not need to change unless you want to adopt the new style.
| Primary import | Legacy imports | Used for |
|---|---|---|
quantcraft.backtest.runtime | ide.backtest.runtime | account, chart_indicators, qc_fundamentals, qc_fama_french, get_bar (via import quantcraft.runtime as rt) |
quantcraft (Timeframe) | — | Timeframe enum for rt.get_bar(Timeframe.DAILY, shift=1) (primary and additional TFs) |
quantcraft.runtime | — | import quantcraft.runtime as rt — rt.get_bar for primary and additional timeframes |
quantcraft.inputs | ide.inputs_module, quantcraft.inputs_module | params from run modals |
quantcraft.backtest.ohlcv | ide.backtest.ohlcv_module, quantcraft.backtest.ohlcv_module | QcOhlcv, qc_ohlcv |
quantcraft.fundamentals | ide.fundamentals_module, quantcraft.fundamentals_module | QcFundamentals |
quantcraft.fama_french | ide.factors_module | QcFamaFrench, fama_french.qc |
quantcraft.account | ide.account_module, quantcraft.account_module | PaperAccount, OpenPosition |
quantcraft.backtest.indicator_series | ide.backtest.indicator_series_module, quantcraft.backtest.indicator_series_module | ChartIndicatorSeries, coerce_chart_time |
Shorter re-exports also work: quantcraft.indicator_series, quantcraft.account. For Fama-French, prefer from quantcraft import fama_french and read fama_french.qc inside callbacks.
Fama-French row access: dataset["rows"] is a YYYYMM → values dict, not a list. Prefer fama_french.qc.latest_row("ff3_monthly"), .row(...), or .rows_chronological(...). Do not use rows[0] / rows[-1].
Do not use internal packages such as quantcraft.b2.ohlcv.*, quantcraft.b2.fundamentals.*, quantcraft.b2.factors.*, or quantcraft.ai_assistant.* in strategy scripts — those are server-side helpers, not the strategy API. Do not confuse quantcraft.backtest.ohlcv (strategy OHLCV API) with quantcraft.b2.ohlcv (internal data layer).
Bundled strategy reference (Markdown)
For line-level module behavior, callback contracts, and engine details, the product also includes Markdown under the quantcraft-dev bundle (conceptually: “QuantCraft strategy reference”). A typical table of contents looks like this:
| Document | Focus |
|---|---|
| IMPORTS | Primary quantcraft.* vs legacy ide.* import paths |
| BACKTEST_README | High-level backtest package overview |
| BACKTEST_ENGINE | Engine orchestration, config, callbacks, result payload |
| BACKTEST_MODULE | WebSocket backtest entry from the IDE |
| IDE_BACKTEST_RUNNER | Subprocess runner next to the Python service |
| RUNTIME | Runtime globals: account, chart_indicators, get_bar / primary and additional timeframes |
| INPUTS_MODULE | params wiring from run modals |
| RUN_CONFIG_QCS | .qcs run preset format and cross-modal mapping |
| ACCOUNT_MODULE | PaperAccount trading API, commission / slippage |
| OHLCV_MODULE | QcOhlcv loaders, bar in callbacks, secondary timeframes |
| INDICATOR_SERIES_MODULE | Chart series payload and helpers |
| FUNDAMENTALS_MODULE | Fundamentals JSON shape and API |
| FAMA_FRENCH | Global Fama-French factors / fama_french.qc / YYYYMM row dict |
| DEBUGGING | Debug Run / Debug Test, breakpoints, call stack and variables — user page is Debugging |
| AUTO_TRADING | Local forward runs (algo + agent bulk) and the New Run modal — user page is Auto Trading |
| QUANT_CLOUD | Bulk forward jobs on cloud runners — user page is Quant Cloud |
| AGENTS | Visual agents; paper Test vs Alpaca forward/live — user page is Agents |
| AI_ASSISTANT | The IDE AI chat, custom LLMs, Tools, MCP servers — user page is QuantCraft AI |
Those files are aimed at strategy authors who need exact names and contracts. Advanced topics such as BACKTEST_MODULE (WebSocket backtest entry) and IDE_BACKTEST_RUNNER (subprocess runner) are included in the bundle for contributors but are not primary user paths. QuantCraft AI in the IDE is preloaded with this material so answers stay aligned with the shipped modules.
Other help surfaces in QuantCraft
These are not the Documentation tab but are part of the same “reference ecosystem” for users:
- QuantCraft AI — Ask natural-language questions; answers can cite the same dev corpus. Requires your own model API key (see your product guide for Connect model).
- Import and export — Move
.py(and related) files between disk and the workspace. - Test results — Equity chart, metrics, trades, and HTML export after a backtest.
Search tips
- Prefer short tokens that appear in code:
on_finish,params,chart_indicator_series,coerce_chart_time,pane_id. - If nothing matches, clear the search — the index lists every topic by section.
- Cross-topic ideas (for example “fundamentals +
on_bar”) often need two articles: open Fundamentals for data shape, then Strategy lifecycle for when it is available.
Document history
In-app Documentation is maintained alongside the strategy runtime. When the Python modules or backtest payload change, the in-app topics and bundled Markdown are updated together so examples and names stay in sync. Strategy import examples use suffix-free quantcraft.* paths as primary; legacy ide.*_module and quantcraft.*_module paths remain documented where still supported.
