Documentation

Introduction

QuantCraft is a trading platform that can also be used for creating, testing, and improving algorithmic trading strategies in Python.
It gives you one workflow for writing code, configuring tests, running backtests, and reviewing results without leaving the app.

If you are new to QuantCraft, start with Getting started and focus on this core loop:

  1. Create or open a strategy file
  2. Write strategy logic and parameters
  3. Run/backtest with selected symbols and date range
  4. Review logs, charts, and trade/performance metrics
  5. Adjust and rerun

What QuantCraft Includes (Essential)

Code Workspace

Python Editor

  • Strategy authoring in Python
  • Editor tools like undo/redo, find/replace, formatting, theme/font options
  • Dependencies (Packages UI) for libraries used by your script

Run + Backtest Execution

Built-in Strategy Runtime APIs

Results + Diagnostics

  • Output panel for logs/errors/progress
  • Test results for performance, equity/plots, and trade history
  • Export of backtest results where supported

QuantCraft AI (Optional but Useful)

  • In-IDE assistant to help explain, generate, and edit strategy code
  • Chat sessions with model selection and file-aware interactions

What You Need to Know Before First Use

  • QuantCraft strategies are Python scripts executed in the QuantCraft runtime context.
  • Backtests use a simulated account model (paper behavior, not live brokerage execution).
  • Strategy lifecycle and data modules (OHLCV, fundamentals) are your API contract.
  • Input parameters are the recommended way to tune values without editing code every run.
  • Always validate with multiple runs (different symbols/windows) before trusting performance.

Minimal “First Success” Workflow

1. Create a strategy file

2. Add a basic strategy skeleton

  • Define lifecycle callbacks
  • Start with on_init, then implement bar/tick logic, then on_finish summaries

3. Define input parameters

  • Add params so thresholds/periods can be changed from the backtest UI

4. Configure and run a backtest

5. Inspect results

  • Check logs for errors/warnings
  • Review Test results: performance/trade statistics
  • Validate indicator overlays and behavior consistency

6. Iterate

  • Refine entries/exits/risk logic
  • Re-run with changed inputs and broader test windows

Core Concepts You Must Understand

Strategy Lifecycle

See Strategy lifecycle: on_init, on_bar/on_tick, optional on_timer, on_finish.

Account State

Your strategy uses the account model (simulated portfolio). Understand how orders/positions update PnL through the run.

Data Scope

OHLCV drives most technical logic. Fundamentals are optional and may vary by symbol. Be explicit about data assumptions and warmup.

Inputs and Reproducibility

Use input parameters for consistent experiments.

  • Keep run conditions fixed when comparing strategy revisions.

Practical Rules for Reliable Use

  • Start simple; add complexity only after baseline logic is stable.
  • Log key decisions (entry/exit reasons) for easier debugging.
  • Don’t evaluate on one symbol or one short date range.
  • Verify that chart overlays align with actual trade behavior.
  • Treat unusually strong backtest results as suspicious until stress-tested.

Common Mistakes to Avoid

  • Writing all logic in one callback without clear state handling
  • Hardcoding tunable constants instead of using inputs
  • Ignoring warmup/data readiness before calculating signals
  • Overfitting to one market regime or narrow date range
  • Trusting headline return without checking drawdown/trade distribution

When to Use QuantCraft AI

Use AI when you need help with:

  • Refactoring messy strategy code
  • Adding parameterization and cleaner structure
  • Explaining callback flow bugs
  • Generating indicator/entry/exit scaffolding

Do not rely on AI output blindly—always run and validate in backtests.


Outcome You Should Expect From This Documentation

After reading the docs in order (see also Reference), you should be able to: