builder_compileValidate and freeze the strategy into a revision, ready to backtest.
Area
Strategy Builder
Group
Compile
Access
Write
Risk
May change server state
Details
Full description
Details
Validate then freeze the strategy — call when ready to backtest, after all entries/exits/gates are attached and sizing/risk are configured.
Validates completeness first. Bidirectional strategies may contain one long and one short entry group and must use flat-only single-position market execution. If validation has errors it raises VALIDATION_ERROR with the specific problems and does not create a revision — fix the issues and call again. Warnings (e.g. no exit attached) do not block compilation and are returned in the result.
The returned entry_behavior makes reversal semantics explicit: same-bar reversal is disabled. An opposite signal on an exit bar cannot enter; its complete group must fire again on a later bar while flat. Directional exits expose applies_to; an exit applying to both sides reports [long, short].
Returns a blueprint and revision_id; the next call is run_backtest(strategy_id=...), which uses the latest revision. Safe to call repeatedly; each call snapshots the current state into a new revision.
Capabilities
Bounded options and operating modes surfaced above the full JSON schema.
Required Inputs
strategy_idstringStrategy ID to compile