Strategy anatomy
Source events and evaluation
A source event is an event that can cause part of a strategy revision to evaluate. It is the canonical Structure term for the trigger that tells a source-event container when to run its graph paths.
Source events can be market data events, such as book updates, trades, funding-rate updates, or other supported inputs made available to the revision. The exact sources depend on the product surface and the selected venue and instrument. Timer-based source events are future functionality, not a current Structure capability.
Source-event containers
Section titled “Source-event containers”Graph logic is organized inside source-event containers. A container collects the graph paths that should re-evaluate when that source event arrives.
This organization matters because a strategy may need to respond differently to different events. A book update, for example, may drive one set of signal calculations, while a trade update or funding-rate update may drive another set of values used by later decisions.
Event timing vs data access
Section titled “Event timing vs data access”A source event answers the timing question: “When should this graph logic run?” The nodes inside the source-event container answer the data question: “What values should be read and computed when it runs?”
Those are related, but they are not the same thing. The event may carry data the graph uses directly, such as a trade or book update. It may also simply cause the graph to perform calculations that read other available values at the time of the event.
For example, a revision might recompute a statistic for instrument A only when the book for instrument B updates. The strategy may never trade instrument B. The book update for instrument B is still useful as the source event because it defines when Structure should re-evaluate that container’s graph paths.
Graph paths
Section titled “Graph paths”Inside a source-event container, each disconnected starting node is the beginning of a graph path. When the source event arrives, Structure evaluates the paths in that container.
A graph path can include:
- Input accessors.
- Constants.
- Typed computations.
- Memory reads.
- Memory writes.
- Group imports.
- Labels used by state transitions or strategy actions.
The canvas layout is for readability. The dependency structure defines evaluation order. If one node needs the output of another node, the upstream node must evaluate first.
Reusable logic across containers
Section titled “Reusable logic across containers”If the same calculation belongs in more than one source-event container, use a group instead of rebuilding the same node pattern in each container. A group gives the repeated calculation a typed interface and lets each container import that interface where it needs the logic.
Labels as evaluation outputs
Section titled “Labels as evaluation outputs”Labels are the named typed values that let graph output affect the rest of the revision.
For example:
- A
Boollabel can become the condition for a state transition branch. - A numeric label can become the quantity used by a target-position action, the current public strategy action type.
- A label can expose a calculated signal so it is easy to inspect later.
Good labels make a revision easier to review because they name the important values that cross from calculation into behavior.
Evaluation across runtime paths
Section titled “Evaluation across runtime paths”The same revision model is evaluated across three paths:
| Path | Data source | Execution destination | Lifetime |
|---|---|---|---|
| Live deployment | Live market data server | Live exchange gateway | Long-running deployment |
| Paper deployment | Live market data server | Venue Simulator | Long-running deployment |
| Backtest job | Historical market data server | Venue Simulator | Finite job |
The path changes the data source, execution destination, and lifetime. The revision’s graph, state machine, strategy actions, memory definitions, groups, validation state, and compile output remain attached to the saved revision.
Practical takeaway
Section titled “Practical takeaway”Source events answer the question: “What causes this logic to evaluate?” Graph paths answer the question: “What values are computed when that happens?” Labels answer the question: “Which computed values affect state transitions or strategy actions?”