State and Trade Management
Arconomy provides a tiered state architecture that tracks the performance and status of your strategy at three levels — from broad strategic decisions down to fine-grained trade management. Combined with the Trade Collector rule for capturing trade IDs, this system enables hierarchical state tracking and conditional logic throughout your strategy.
The State Hierarchy
There are three levels of state that capture the performance of a strategy, an account, or a specific collection of trades. Each level provides output data fields that can be used in conditional logic and execution dependencies throughout your strategy.
| State Level | Scope | Key Use Case |
|---|---|---|
| Strategy State | Multiple accounts, multiple instruments | Global logic and strategy-level metrics |
| Account State | Single account, multiple instruments | Account-specific control and analytics |
| Trade State | Single account, single symbol | Precision analytics and micro-level control |
Level 1: Strategy State
At the highest level, Strategy State captures the holistic performance and structural metadata of the entire strategy. It is an implicit, always-available rule that generates output data for key metrics — it does not need to be added as a visible node on the canvas. The rule output data fields can be used in conditional logic throughout the execution of the strategy.
Strategy State aggregates data across all accounts and all instruments in the strategy. Metrics include:
- Maximum profit and maximum drawdown
- Total number of trades placed
- Counts of winning and losing trades
- Open profit and loss
- Number of resets
- Elapsed time since strategy initiation
- Current position status (whether any positions remain open)
Strategy State is particularly useful when designing execution dependencies. For example, in a breakout
strategy where only one open trade is permitted at a time, you can use a condition such as
Strategy State.hasOpenPositions == false to prevent duplicate entries.
See the Strategy State rule page for full details on all output fields.
Level 2: Account State
Nested within Strategy State is Account State, provided by the Trading Account rule. Account State focuses on the subset of trades specific to a single trading account. If your strategy executes across multiple accounts, each Trading Account rule provides aggregated statistics only for the trades associated with that account.
This includes similar metrics to Strategy State but scoped to a single account:
- Account-specific open profit and loss
- Cumulative trade counts
- Exposure by symbol within the account
- Equity, margin and risk metrics for the account
- Built-in risk controls including stop-out margin level, minimum trading margin and risk amount protection
While Strategy State operates across all accounts and instruments, Account State isolates trade data per account. This is essential for strategies that trade across multiple broker accounts and need account-specific control logic.
See the Trading Account rule page for full details on all output fields and built-in risk management features.
Level 3: Trade State
The most granular level is the Trade State, which provides comprehensive aggregated metrics for a specific subset of trades — typically filtered by symbol and originating rules. Because all trades in a Trade State share the same account and symbol, the analysis can be much more precise.
Trade State is built using a Trade Collector, which aggregates trade IDs dynamically. Once trade IDs are collected, the Trade State rule provides summary metrics for the current state of all those trades. Metrics include:
- Entry prices and average entry price (buy and sell separately)
- Net open or closed profit in pips or currency
- Maximum profit and maximum loss achieved throughout the trades' lifecycle
- Aggregated trade direction and position size
- Open and closed position counts, with breakdowns by direction and order type
- Margin requirements and pip values
The currency code field allows you to choose the currency for the output data currency amounts — for example, the total profit of all the trades can be converted into your preferred reporting currency. Each Trade State rule can only collect trades for a single market symbol to ensure meaningful aggregation and comparison.
See the Trade State rule page for full details on all input parameters and output fields.
Trade Collector
The Trade Collector rule captures trade IDs from multiple trading rules and combines them into a single, deduplicated list. It is the primary mechanism for building the set of trades that a Trade State rule analyses.
The Trade Collector must execute each time you want it to update the list of trade IDs collected. To achieve this, make it an execution dependency of the trade placement rules it needs to track. For example, in a breakout strategy with two Place Trade rules — one for long positions and one for short — the Trade Collector should be an execution dependency of both rules so it captures every new trade.
The Trade Collector's list of trade IDs is updated cumulatively each time the rule executes. It does not remove any previously collected trade IDs unless the rule is reset. This makes it useful for two key purposes:
- Passing trade IDs to action rules. Route the collected trade IDs to a Trade Filter to narrow down the list, or directly to rules such as Close Positions or Stop Loss to take action on the collected trades.
- Capturing trades for analysis. Pass the collected trade IDs to a Trade State rule to get aggregated metrics for the entire set of trades. This is covered in more detail in the Trade State section above.
See the Trade Collector rule page for full details on all input parameters and output values.
Using State in Source Selectors
When configuring a rule's input fields, state data is accessed through the source selector. The three state rules appear under a dedicated source option:
- From State — displays the three state rules: Strategy State, Account State (Trading Account) and Trade State. Select the appropriate state level and then choose the specific output field you need.
This is separate from the other source options (From Strategy Configuration, From Data Source and From Rule) to make it easy to find state metrics when building conditional logic and execution dependencies.
This tiered architecture enables hierarchical state tracking and conditional logic from broad strategic decisions down to fine-grained trade management. All three state levels are built-in and accessible for constructing robust, intelligent trading systems.
Was this helpful? Let us know