Documentation

QuantCraft documentation reference

QuantCraft ships two complementary kinds of documentation: in-app topics you read inside the IDE, and developer 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

  1. Open QuantCraft from the main app.
  2. Expand the right sidebar (if it is collapsed).
  3. 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

TopicWhat you will learn
FundamentalsFinancial statement data, date-keyed tables, how fundamentals align to bars, and how to read them in a strategy.
Fama-French factorsGlobal monthly FF3/FF5 factor returns via fama_french.qc (Premium; no callback argument).
AccountPaperAccount: balances, positions, orders, PnL, and performance metrics exposed during a backtest.
Life cycleCallback order: on_init, on_bar, on_tick, on_timer, on_finish — including multi-symbol basics and optional full-series on_finish(bars).

Reference

TopicWhat you will learn
Input parametersDeclaring 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.
Quant CloudRemote forward and bulk runs when your PC is off (desktop user guide).
OHLCVBar shape (OhlcvBarView), loaders (Alpaca vs B2), time ranges, and using bar data in callbacks.
Indicator seriesBuilding 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 simulationStrategy lifecycle + OHLCV; then Running code (Test) and Test results.
Size positions, stops, or read Sharpe / drawdownAccount model
Let users tune thresholds without editing codeInput parameters
Plot custom series on the equity chartIndicator series
Mix price and filings / statementsFundamentals
Mix price and global factor returnsFama-French factors
Reuse backtest or forward modal settingsRun presets (.qcs)
Run algos on a remote runnerQuant Cloud

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 importLegacy importsUsed for
quantcraft.backtest.runtimeide.backtest.runtimeaccount, chart_indicators, qc_fundamentals, qc_fama_french
quantcraft.inputside.inputs_module, quantcraft.inputs_moduleparams from run modals
quantcraft.backtest.ohlcvide.backtest.ohlcv_module, quantcraft.backtest.ohlcv_moduleQcOhlcv, qc_ohlcv
quantcraft.fundamentalside.fundamentals_module, quantcraft.fundamentals_moduleQcFundamentals
quantcraft.fama_frenchide.factors_moduleQcFamaFrench, fama_french.qc
quantcraft.accountide.account_module, quantcraft.account_modulePaperAccount, OpenPosition
quantcraft.backtest.indicator_serieside.backtest.indicator_series_module, quantcraft.backtest.indicator_series_moduleChartIndicatorSeries, 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 developer reference (Markdown)

For line-level module behavior, message formats, and engine orchestration, the product also includes Markdown under the quantcraft-dev bundle (conceptually: “QuantCraft development docs”). A typical table of contents looks like this:

DocumentFocus
IMPORTSPrimary quantcraft.* vs legacy ide.* import paths
BACKTEST_READMEHigh-level backtest package overview
BACKTEST_ENGINEEngine orchestration, config, callbacks, result payload
BACKTEST_MODULEWebSocket backtest entry from the IDE
IDE_BACKTEST_RUNNERSubprocess runner next to the Python service
RUNTIMERuntime globals: account, chart_indicators, qc_fundamentals, qc_fama_french (optional OHLCV handles)
INPUTS_MODULEparams wiring from run modals
RUN_CONFIG_QCS.qcs run preset format and cross-modal mapping
ACCOUNT_MODULEPaperAccount implementation details
OHLCV_MODULEQcOhlcv loaders and bar types
INDICATOR_SERIES_MODULEChart series payload and helpers
FUNDAMENTALS_MODULEFundamentals JSON shape and API
FAMA_FRENCHGlobal Fama-French factors / fama_french.qc / YYYYMM row dict
QUANT_CLOUDCloud runner operations (operator / maintainer detail — user-facing summary is Quant Cloud)

Those files are aimed at advanced users and contributors who need exact names and contracts. 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.