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:
- Create or open a strategy file
- Write strategy logic and parameters
- Run/backtest with selected symbols and date range
- Review logs, charts, and trade/performance metrics
- Adjust and rerun
What QuantCraft Includes (Essential)
Code Workspace
- Workspace layout: file/folder sidebar for strategy projects
- Multi-tab Python editor
- Save, Save As, import/export workflow for
.pyfiles
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
- Running code: quick Run for fast script feedback
- Backtests: structured flow for historical evaluation
- Input parameters for configurable strategies
Built-in Strategy Runtime APIs
- Strategy lifecycle callbacks (
on_init,on_bar,on_tick,on_timer,on_finish) - Account model for positions, balances, and PnL behavior
- OHLCV and bar data for market bars
- Fundamentals (when available) for statement-level data
- Indicator series for chart overlays in results
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
- Open QuantCraft (Workspace layout)
- Create a new
.pystrategy file (or import one)
2. Add a basic strategy skeleton
- Define lifecycle callbacks
- Start with
on_init, then implement bar/tick logic, thenon_finishsummaries
3. Define input parameters
- Add
paramsso thresholds/periods can be changed from the backtest UI
4. Configure and run a backtest
- Choose symbol(s), timeframe, and date window (Backtests)
- Test (Running code) and monitor Output panel / progress
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:
- Navigate the workspace quickly
- Build a runnable strategy from scratch
- Use lifecycle callbacks correctly
- Configure backtests with meaningful inputs
- Interpret results and iterate toward robust logic