Reference
Composer, Strategy IR, and SDK
Look up Composer regions, Strategy IR layers, typed inputs/parameters/rules/exits/orders, functional identity, public Python builder/plugin contracts, validation stages, and compiler/runtime boundaries.
App path
- Strategies -> Composer
- Strategies -> Strategy Library -> Inspector -> Advanced IR and History
- Strategies -> Sync Plugins
- Studies -> Strategy -> Design and Readiness
One contract, two authoring paths
Composer and the Python Strategy SDK both produce typed Strategy IR. The
runtime consumes validated, compiled StrategyProgram artifacts—not Composer
UI state and not arbitrary plugin Python.
Composer document ─┐
├─> Strategy IR (`sir1:`) -> validation -> compiler
trusted SDK plugin ┘ -> StrategyProgram -> runtimeUse Composer when its visible controls express the rule. Use the SDK for generated expression trees, specialized multi-input declarations, reusable builder code, or public IR features that are not yet practical in Composer. Keep exploratory calculations in Notebooks and reusable calculations in Signals.
Composer workspace map
| Region | Owns | Does not own |
|---|---|---|
| Toolbar | Create/edit context, Strategy identity/version, Cards/Dense view, read-only render, Save/Cancel | Study queue or runtime execution |
| Identity & Description | Stable Strategy ID during creation, name, description and authoring context | Parameters/configuration values for a particular run |
| Variables | Named typed formula/expression reuse inside the Strategy | Materialized Signal or Prepared output |
| Inputs | Typed Bar/Trade/Quote/Prepared/Feature/Signal references | Dataset/version/window binding |
| Input Series Roles | Primary/secondary logical roles and alignment intent | Final Study Dataset selection |
| Evaluation | Completed Bar, Trade, Quote or supported Timer trigger and alignment semantics | Execution fidelity/model selection |
| Rule lanes | Long/Short entry setups and exit purposes | Candidate search or optimization objective |
| Position / Orders / Risk | Side permission, signal conflict, order intent, exit ownership and risk-distance requirements | Quantity, account capital or Portfolio admission |
| Strategy checks | Client structural and semantic findings | Final backend Study/runtime readiness |
| History | Immutable saved Strategy versions and restore workflow | Mutable in-place history |
| Advanced IR | Read-only generated semantic payload for diagnosis | Alternate JSON editor |
Cards/Dense mode and panel layout are presentation state. They do not change Strategy identity.
Strategy IR layers
| Layer | Representative content |
|---|---|
| Identity | Stable Strategy ID, current semantic version, source/provenance |
| Metadata | Name, description, tags and presentation fields |
| Inputs | Stable input IDs, source kind/ref, dtype, series role, shift/alignment |
| Parameters | Stable ID, dtype, default, hard domain, enum choices and sweep eligibility |
| Variables | Typed expression/formula nodes derived from inputs and parameters |
| Evaluation | Trigger clock, completed/visible-time policy, multi-source alignment, timer behavior |
| Entries | Long/Short Entry Setups, Boolean condition trees, sequence/confirmation rules and order instruction |
| Exits | Stop Loss, Take Profit, Session Close and Other Close rules with purpose/ownership |
| Position | Long/Short permission, current-position behavior and simultaneous-signal policy |
| Risk | Maximum stop distances, bracket targets and risk-related semantic requirements |
| Execution requirements | Minimum Signal data floor and minimum execution fidelity; not a Dataset or provider selection |
The canonical IR rejects extra/invalid fields and validates cross-field semantics. A syntactically valid JSON object is not necessarily a valid Strategy.
Functional versus presentation fields
Functional changes normally create a new sir1: fingerprint:
- inputs, source references, dtypes or alignment;
- parameter declarations/domains;
- variables and expression trees;
- entry/exit rules and their order;
- evaluation timing;
- order instructions and replacement policy;
- position/risk semantics; and
- execution requirements.
Name, description, comments, editor layout and other declared presentation fields do not necessarily change functional identity. Do not bump or preserve a semantic version based on intent alone; compare canonical IR and retained hash fixtures.
Input source registry
| Source | Reference contract | Typical data floor |
|---|---|---|
| Bar Field | Exact canonical/Prepared Bar field | Bars/Arrays depending on compiler |
| Trade Field | Exact normalized trade/replay field | Tick Replay |
| Quote Field | Exact L1 market-state field | Certified L1/Quote context |
| Prepared Array Column | Prepared kind/capability plus typed column | Prepared Arrays |
| Feature Output | Exact Feature producer/output/configuration | Feature parent data floor |
| Signal Output | Structured signal_id:version:column identity | Signal's complete transitive Prepared/output graph |
Every input has a stable ID and dtype. A DataFrame column name or display label
does not establish source identity. Shifts are nonnegative prior-observation
access; shift(1) increases derived lookback and cannot access a future row.
Multi-input latest-visible alignment declares reference clock, finite staleness tolerance, and session-boundary policy. A secondary value newer than the decision time is ineligible.
Parameter registry
Supported parameter dtypes are float, integer, Boolean, and enum under their declared contracts.
| Field | Rule |
|---|---|
| Stable ID | Never reuse for a different meaning |
| Default | Finite/typed and within hard domain |
| Numeric bounds | Minimum ≤ maximum; integers use whole values |
| Enum choices | Default must be one declared choice |
| Boolean | No numeric bounds |
| Sweep eligibility | Declares whether Study authoring may vary it |
| Hard domain | Author-owned; workspace research ranges may narrow but never widen it |
Strategy parameters change decision behavior. Signal parameters belong to the Signal and its Output identity; binding a Signal does not copy its parameter declaration into Strategy IR as an unrelated Strategy parameter.
Operand and expression types
Conditions are typed expression trees, not strings. Operands include:
- input/Signal/Feature handles;
- parameter handles;
- typed literals;
- formula variables;
- supported arithmetic/transform nodes; and
- Boolean combinations.
Comparisons require compatible types. Supported control vocabulary includes ordinary comparisons, crossings and Boolean AND/OR/NOT where the authoring surface exposes them. Do not cast float to Boolean or compare unrelated enum domains silently.
Canonical normalization makes semantically identical trees stable where the IR contract says so; UI condition order remains significant when sequence or rule priority is authored.
Entry Setups and Followed by
An Entry Setup groups conditions for one Long or Short entry rule. Multiple setups act as alternative entry paths under the saved rule semantics.
Followed by is a temporal confirmation contract:
setup condition becomes eligible
-> confirmation must occur afterward
-> within the declared bound
-> without future data or an undeclared session crossingIt is not ordinary AND on the same row. Reordering or changing the bound is a functional change.
Long and Short rules are independent. The Position policy decides whether each side is allowed and what happens when both signal simultaneously (for example, enter neither under the current example policy).
Exit purposes
| Purpose | Meaning |
|---|---|
| Stop Loss | Loss-limiting exit ownership; may use Live Signal or supported Entry Bracket mode |
| Take Profit | Profit-target exit ownership; may use Live Signal or supported Entry Bracket mode |
| Session Close | Exit associated with explicit session-boundary policy |
| Other Close | Strategy invalidation or another authored close condition |
Live Signal evaluates the Strategy exit condition as the runtime progresses. Entry Bracket attaches supported protective/target intent at entry and requires matching risk-distance/target semantics plus a compatible execution model. The label alone does not make a bracket supported at every fidelity.
Orders, position, risk, and sizing
Strategy IR can declare Market, Limit, Stop, Stop-Limit, Trailing and supported replacement semantics with typed offsets and time in force. Exact availability depends on compiler/runtime/provider matrices.
Tick offsets use the governed Instrument price increment. A positive number is not meaningful without side, reference price and instruction semantics.
The Strategy owns signal-to-intent semantics. It does not own final quantity. Study Design, Portfolio policy, or Live deployment combines the saved risk distance with capital, risk budget, Instrument value and admission rules.
builder.risk() or Composer risk controls define maximum stop distances and
bracket targets; they are not an account-level risk profile.
Evaluation clocks
| Trigger | Decision boundary |
|---|---|
| Completed Bar | Evaluate from data available by the bar's completion boundary |
| Trade | Evaluate on eligible source-ordered trade events |
| Quote | Evaluate on eligible best-bid/ask state updates under exact source scope |
| Timer | Evaluate on a declared interval/offset with reference maximum age, missed-fire and late-tolerance policy |
Evaluation trigger does not select fill model. Decision time, submission time, eligibility time and fill time remain separate.
Configuration and version identities
| Object | Identity | Changes when |
|---|---|---|
| Strategy | sir1: semantic fingerprint | Functional IR changes |
| Strategy Configuration | scfg1: executable-values fingerprint | Parameter values/default market bindings owned by Configuration change |
| Composer document | Authoring source revision | Visual/source document changes; must still produce the intended IR |
| Plugin | plugin_id@plugin_version provenance | Authoring package changes under its owner |
| Compiled program | Program hash/ABI metadata | Compiler input/target/program content changes |
Saving a Strategy version does not queue a Study. Saving a Configuration pins values to an exact Strategy version. Rebase is explicit; no current/latest Strategy substitution rewrites historical Configurations, Portfolios, Studies, Results, or deployments.
Public Python SDK surface
Representative public imports include:
from arizmic.strategy_sdk import (
ExecutionRequirements,
ParameterDeclaration,
StrategyBuilder,
StrategyIR,
ValueDType,
compile_fast,
compile_vector,
discover_strategy_plugin,
validate_strategy_ir,
)StrategyBuilder provides the public construction surface for:
input()andparam()typed handles;- formula/comparison/crossing/Boolean expression trees;
long_entry(),short_entry()andexit_when();- completed-Bar, Trade, Quote and supported Timer evaluation;
- latest-visible input alignment;
- order instructions and supported replacement fields;
position_rule();- risk distances, bracket targets and exit-mode parameters; and
build()with name, description andExecutionRequirements.
The exact installed SDK signature is authoritative. Do not import internal compiler/service modules when a public builder feature is absent.
Plugin protocol
A trusted plugin module is discovered from plugin.py and exposes one
strategy_plugin object or zero-argument factory with:
plugin_id;plugin_version;- a tuple of
ParameterDeclarationvalues; and build_ir(overrides=None) -> StrategyIR.
Discovery imports and executes the module. Treat it as trusted local code: review filesystem, network, environment, subprocess and dependency behavior before installation. Plugin Python is authoring code only. Runtime engines do not call it per row/trial or use it as a fallback.
Plugin-level declarations and builder parameters must match exactly in ID, dtype, default, bounds/choices and meaning.
Validation vocabulary
| Check | Proves | Does not prove |
|---|---|---|
| Discovery/protocol | Module loads and exposes the expected plugin shape | Semantic correctness or safety of arbitrary import-time code |
| IR schema/semantic validation | Typed fields and cross-field Strategy contract are valid | Useful/casual rule or target runtime support |
| Hash fixture | Canonical functional identity matches expected content | Decision behavior parity |
| Reference decision test | Hand-calculated rule behavior on an exact fixture | Native/compiler parity or broad market validity |
| Vector compile | Vector program builder accepts IR and emits deterministic metadata | Bar/Tick/Quote/Depth, order or Live support |
| Direct Array compile | Fast/native array compiler accepts IR | Every Study family/fidelity |
| Binding/readiness | Exact Dataset/Prepared/Signal inputs can resolve for a request | Execution/evidence quality |
| Target certification | Named Study/fidelity/runtime/provider matrix passed retained fixtures | Any matrix outside that named scope |
An empty validation finding list means that owner passed. It is not a universal green light.
Minimum owner test suite
Retain tests for:
- stable plugin and Strategy identity;
- declared-versus-built parameters and edge/invalid overrides;
- exact input source/ref/dtype/alignment/requirements;
- hand-calculated entry/exit and current-position behavior;
- Long/Short conflicts;
- warm-up, null/non-finite, duplicate-time, gap/session behavior;
- future-row mutation/no-lookahead proof;
- stable
sir1:and migration fixtures; - Vector/Direct Array compile and eligible reference parity;
- order/risk/bracket/execution blockers; and
- Signal dependency failure and recovery.
Shared repository tests do not replace the plugin owner's semantic tests.
Sync and source ownership
Full Sync Plugins scans the configured root and reports discovered, synced, missing and issue outcomes. Targeted Sync reconciles one installed plugin selector without rescanning unrelated roots.
Plugin Strategies remain Python-owned. Edit source and sync; Composer restore is unavailable for plugin snapshots. Composer-authored Strategies remain Composer- owned. Converting/forking source ownership requires a new explicit identity and does not create bidirectional synchronization.
Sync stores the IR plus plugin provenance and updates the system Default Configuration where the owner specifies. It does not bind a Dataset, build Signals, certify a target, or rewrite exact historical references.
Compiler and runtime boundary
typed IR inputs + parameter slots + canonical expressions
+ evaluation + entries/exits + position/risk/order metadata
-> target compiler
-> StrategyProgram ABI + program hash + derived lookback
-> Study/Portfolio/Live evaluator under its own capability matrixNo Strategy-specific engine branch or Python fallback may bypass the ABI. Unsupported IR remains blocked at the target compiler/readiness gate.
Next
Use Composer Workspace and Inputs for every visual control, Python SDK Quickstart for a complete trusted plugin, and Strategy IR, Plugin Testing, and Sync for the verification pipeline.