Use this page when you already know you want the shortest path from clone to first successful run.
If you are new to BacktestingKit, start at ONBOARDING.md instead. If you want the full docs map, start at INDEX.md.
- Xcode with Swift toolchain support for this project.
- macOS environment with command-line tools installed.
- Optional: Node.js + local JS engine checkout for parity checks in
tools/parity.
swift build
swift testIf you prefer Xcode-based verification:
xcodebuild -scheme BacktestingKit -project BacktestingKit.xcodeproj -configuration Debug buildRun the bundled demo path:
import BacktestingKit
let result = BKEngine.runDemo(dataset: .aapl)Success looks like:
- the package builds and tests cleanly
- the bundled CSV resources load without external setup
- you can inspect
summary.metrics.totalReturnfrom the returnedBKRunSummary
You can also run the trial demo from the command line:
swift run BacktestingKitTrialDemoUse these as the main top-level surfaces:
BKAppFacadeStart here for app-facing CSV import/review screens, preset-backed flows, and beginner-friendly integration.BKEngineUse this for canonical direct v2/v3 request-model execution and provider-driven data access.BacktestingKitManagerUse this when you already have candles and want manager-owned indicator, strategy, and report helpers.- Tool helpers
Use
BKValidationTool,BKExportTool,BKComparisonTool,BKScenarioTool, andBKParityToolfor validation, export, comparison, scenarios, and parity.
- User CSV -> app UI review state:
BKAppFacade.buildCSVImportScreenState(...) - User CSV -> reviewed execution:
BKAppFacade.runConfirmedCSVImport(...) - Inline CSV -> helper-backed smoke test:
BKEngine.runDemoCSV(...) - Explicit v3 request:
await BKEngine.runV3(...) - Explicit v2 request:
await BKEngine.runV2(...)
- New to the package:
ONBOARDING.md - Choosing between surfaces:
CHOOSE_YOUR_SURFACE.md - Helper and façade workflows:
HELPER_WORKFLOWS.md - Canonical engine flows:
ENGINE_GUIDE.md - CSV/provider details:
DATA_INGESTION.md - Full documentation map:
INDEX.md