@maxtrader/backtest-protocol
v0.1.1
Published
Shared public contracts for the MaxTrader backtesting engine workspace.
Readme
@maxtrader/backtest-protocol
Shared public contracts for the MaxTrader backtesting engine workspace.
Purpose
- Defines core engine interfaces and runtime contracts.
- Provides type-safe shared models across core, browser runtime, and adapters.
- Acts as the API boundary for integrators and contributors.
Key Exports
- engine interfaces:
BacktestEngine,AsyncBacktestEngine - runtime config/state:
BacktestEngineConfig,BacktestState - events:
BacktestEventType,BacktestEvent - execution/accounting/journal types
- analytics and Monte Carlo request/result types
- broker and mode contracts (
BacktestMode,BrokerAdapter,BrokerRiskGuards) - visual link contracts (
VisualEngineLinkAdapter, drawing SL/TP sync types)
Example
import type { BacktestEngineConfig, OrderRequest } from "@maxtrader/backtest-protocol";
const config: BacktestEngineConfig = {
symbol: "EURUSD",
timeframe: "M1",
initialBalance: 10_000,
seed: 0
};
const order: OrderRequest = {
type: "MARKET",
side: "BUY",
lots: 0.1
};Notes
- Prefer additive changes to maintain compatibility.
- Keep protocol updates synchronized with
docs/api-reference.md.
