Skip to main content
Contents
10 min read

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.

CODE
Composer document ─┐
                   ├─> Strategy IR (`sir1:`) -> validation -> compiler
trusted SDK plugin ┘                            -> StrategyProgram -> runtime

Use 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

RegionOwnsDoes not own
ToolbarCreate/edit context, Strategy identity/version, Cards/Dense view, read-only render, Save/CancelStudy queue or runtime execution
Identity & DescriptionStable Strategy ID during creation, name, description and authoring contextParameters/configuration values for a particular run
VariablesNamed typed formula/expression reuse inside the StrategyMaterialized Signal or Prepared output
InputsTyped Bar/Trade/Quote/Prepared/Feature/Signal referencesDataset/version/window binding
Input Series RolesPrimary/secondary logical roles and alignment intentFinal Study Dataset selection
EvaluationCompleted Bar, Trade, Quote or supported Timer trigger and alignment semanticsExecution fidelity/model selection
Rule lanesLong/Short entry setups and exit purposesCandidate search or optimization objective
Position / Orders / RiskSide permission, signal conflict, order intent, exit ownership and risk-distance requirementsQuantity, account capital or Portfolio admission
Strategy checksClient structural and semantic findingsFinal backend Study/runtime readiness
HistoryImmutable saved Strategy versions and restore workflowMutable in-place history
Advanced IRRead-only generated semantic payload for diagnosisAlternate JSON editor

Cards/Dense mode and panel layout are presentation state. They do not change Strategy identity.

Strategy IR layers

LayerRepresentative content
IdentityStable Strategy ID, current semantic version, source/provenance
MetadataName, description, tags and presentation fields
InputsStable input IDs, source kind/ref, dtype, series role, shift/alignment
ParametersStable ID, dtype, default, hard domain, enum choices and sweep eligibility
VariablesTyped expression/formula nodes derived from inputs and parameters
EvaluationTrigger clock, completed/visible-time policy, multi-source alignment, timer behavior
EntriesLong/Short Entry Setups, Boolean condition trees, sequence/confirmation rules and order instruction
ExitsStop Loss, Take Profit, Session Close and Other Close rules with purpose/ownership
PositionLong/Short permission, current-position behavior and simultaneous-signal policy
RiskMaximum stop distances, bracket targets and risk-related semantic requirements
Execution requirementsMinimum 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

SourceReference contractTypical data floor
Bar FieldExact canonical/Prepared Bar fieldBars/Arrays depending on compiler
Trade FieldExact normalized trade/replay fieldTick Replay
Quote FieldExact L1 market-state fieldCertified L1/Quote context
Prepared Array ColumnPrepared kind/capability plus typed columnPrepared Arrays
Feature OutputExact Feature producer/output/configurationFeature parent data floor
Signal OutputStructured signal_id:version:column identitySignal'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.

FieldRule
Stable IDNever reuse for a different meaning
DefaultFinite/typed and within hard domain
Numeric boundsMinimum ≤ maximum; integers use whole values
Enum choicesDefault must be one declared choice
BooleanNo numeric bounds
Sweep eligibilityDeclares whether Study authoring may vary it
Hard domainAuthor-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:

CODE
setup condition becomes eligible
  -> confirmation must occur afterward
  -> within the declared bound
  -> without future data or an undeclared session crossing

It 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

PurposeMeaning
Stop LossLoss-limiting exit ownership; may use Live Signal or supported Entry Bracket mode
Take ProfitProfit-target exit ownership; may use Live Signal or supported Entry Bracket mode
Session CloseExit associated with explicit session-boundary policy
Other CloseStrategy 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

TriggerDecision boundary
Completed BarEvaluate from data available by the bar's completion boundary
TradeEvaluate on eligible source-ordered trade events
QuoteEvaluate on eligible best-bid/ask state updates under exact source scope
TimerEvaluate 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

ObjectIdentityChanges when
Strategysir1: semantic fingerprintFunctional IR changes
Strategy Configurationscfg1: executable-values fingerprintParameter values/default market bindings owned by Configuration change
Composer documentAuthoring source revisionVisual/source document changes; must still produce the intended IR
Pluginplugin_id@plugin_version provenanceAuthoring package changes under its owner
Compiled programProgram hash/ABI metadataCompiler 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:

CODE
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() and param() typed handles;
  • formula/comparison/crossing/Boolean expression trees;
  • long_entry(), short_entry() and exit_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 and ExecutionRequirements.

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 ParameterDeclaration values; 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

CheckProvesDoes not prove
Discovery/protocolModule loads and exposes the expected plugin shapeSemantic correctness or safety of arbitrary import-time code
IR schema/semantic validationTyped fields and cross-field Strategy contract are validUseful/casual rule or target runtime support
Hash fixtureCanonical functional identity matches expected contentDecision behavior parity
Reference decision testHand-calculated rule behavior on an exact fixtureNative/compiler parity or broad market validity
Vector compileVector program builder accepts IR and emits deterministic metadataBar/Tick/Quote/Depth, order or Live support
Direct Array compileFast/native array compiler accepts IREvery Study family/fidelity
Binding/readinessExact Dataset/Prepared/Signal inputs can resolve for a requestExecution/evidence quality
Target certificationNamed Study/fidelity/runtime/provider matrix passed retained fixturesAny 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:

  1. stable plugin and Strategy identity;
  2. declared-versus-built parameters and edge/invalid overrides;
  3. exact input source/ref/dtype/alignment/requirements;
  4. hand-calculated entry/exit and current-position behavior;
  5. Long/Short conflicts;
  6. warm-up, null/non-finite, duplicate-time, gap/session behavior;
  7. future-row mutation/no-lookahead proof;
  8. stable sir1: and migration fixtures;
  9. Vector/Direct Array compile and eligible reference parity;
  10. order/risk/bracket/execution blockers; and
  11. 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

CODE
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 matrix

No 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.