Skip to content

Strategy anatomy

Typed values and labels

Structure strategy revisions are typed. Nodes produce typed values, node inputs expect typed values, and labels expose named typed outputs to the rest of the revision.

Types are part of what make a revision inspectable. They help Structure validate that a graph can evaluate safely before the revision is saved, compiled, or used by a live deployment, paper deployment, or backtest job.

Common value categories include:

  • Boolean values used for branch conditions.
  • Integer values used where whole-number behavior is required.
  • Decimal values used for quantities, prices, percentages, and other fractional values.
  • Numeric values used by functions that can accept more than one numeric representation.

The exact node palette depends on the product surface, but the principle is stable: a node output must match what the downstream input expects.

A label is a named typed value produced by the graph. Labels are the bridge between calculation and behavior.

Use labels when a computed value needs to be used outside the local graph path:

  • A state-transition branch can read a Bool label.
  • A target-position action, the current public strategy action type, can read a numeric quantity label.
  • A value can be named so it is easier to review when inspecting the revision.

Labels should be named for the meaning they carry, not just the node that produced them. For example, a label like entry_signal_active is easier to review than a label that only describes a comparison node.

Many functions in a Structure strategy accept the Numeric type. That means the function can work with numeric values without forcing you to choose the exact representation in every place.

When a function accepts Numeric, Structure safely uses the integer or decimal form when one is available. If there is no specific integer or decimal form available, Structure treats the value as decimal behavior for validation purposes.

From a user point of view, this mostly matters when you are wiring values into memory writes, group inputs, labels, or target-position quantities.

Because Numeric falls back to decimal behavior, some places in the editor expect a decimal input even when the value looks like a whole number. That is why feeding a direct integer into a numeric memory write or a group input typed as numeric can raise a validation error.

In those cases, you should wire a decimal typed value when possible.

Types make the revision safer to inspect and validate. When a value is used by a branch, action, memory slot, or group interface, make its type explicit and label it clearly.

If a strategy field or function accepts Numeric, it usually behaves smoothly across numeric values. When writing into numeric memory, feeding a numeric group input, or exposing a target quantity, decimal is the conservative choice and avoids validation issues.

Once typed values are clear, the next question is how the revision moves between states. That is the focus of State machines.