Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-kit/llms.txt

Use this file to discover all available pages before exploring further.

The @backtest-kit/sidekick package scaffolds a backtest-kit project where all wiring is visible and editable in your own project files. Think of it as the eject path from @backtest-kit/cli --init: instead of infrastructure being hidden inside the CLI package, the exchange adapter, frame definitions, risk rules, strategy logic, and the runner script all live as editable TypeScript source files directly inside your project. You own every line.

Sidekick vs CLI

@backtest-kit/cli@backtest-kit/sidekick
Infrastructure locationHidden inside CLI packageIn your project files
CustomisationConfig flags onlyFull source-level control
Best forFast startup, standard setupsCustom adapters, advanced control
Entry pointnpm start via CLI binaryYour own runner.ts
If you later find the CLI too restrictive, Sidekick gives you the equivalent starting point with all wiring exposed — a clean eject without starting from scratch.

Key Features

Zero Config Startup

One command scaffolds a complete, working project. No manual dependency wiring or configuration required.

Complete Template

Includes a backtest strategy, risk management rules, frame definitions, exchange adapter, and a runner script — all as editable source files.

AI-Powered

Pre-configured with a DeepSeek → Claude → GPT-5 fallback chain so LLM-powered strategies work out of the box.

Technical Analysis

Built-in 50+ indicators via @backtest-kit/signals are included in the template with multi-timeframe support.

Environment Setup

Auto-generates a .env file with all API key placeholders for every supported exchange and LLM provider.

Best Practices

Production-ready code structure with examples for signal validation, risk rules, and LLM context injection.

Getting Started

1

Scaffold a new project

npx -y @backtest-kit/sidekick my-trading-bot
Sidekick generates the full project into the my-trading-bot/ directory.
2

Enter the project and install dependencies

cd my-trading-bot
npm install
3

Configure your environment

Open the generated .env file and fill in your exchange API keys and LLM provider tokens. All placeholders are pre-labelled.
4

Run the bot

npm start
The scaffolded runner script starts the backtest or live session depending on your environment configuration.

What Gets Generated

Sidekick creates a fully working project with the following structure:
FilePurpose
exchange.tsExchange adapter wired to CCXT with getCandles and price formatting
frames.tsFrame definitions — start/end dates and candle intervals for backtesting
risk.tsRisk rules — TP distance checks, R/R ratio validation, position limits
strategy.tsLLM-powered getSignal function with multi-timeframe candle fetch
runner.tsEntry point that registers all schemas and starts Backtest.background
.envAPI key placeholders for exchange, OpenAI, Claude, DeepSeek, and more
Because every file lives in your project, you can modify the exchange adapter to connect to a private data feed, rewrite the risk rules for your specific requirements, or swap out the LLM provider — none of these changes require forking or patching any package.

When to Use Sidekick

Use @backtest-kit/sidekick when:
  • You need a custom exchange adapter beyond what the CLI flags expose
  • Your risk rules are complex enough to require full TypeScript logic
  • You want to inspect, version-control, and code-review every piece of the setup
  • You are building a team project where the infrastructure must be auditable
  • You need to integrate backtest-kit into an existing monorepo with shared utilities

Build docs developers (and LLMs) love