States & Transitions
States and transitions are the core structure of a strategy.
- States describe the mode the strategy is currently in.
- Transitions describe how the strategy moves from one state to another.
Adding states
Every strategy needs at least two states.
- Open the Strategy Toolbar.
- Select Manage States.
- Click New State.
- Enter a unique state name and save.
The state appears on the canvas as a node.
Working with state nodes
On the canvas, each state node gives you direct controls for:
- Edit State Name
- Delete State
- Add Transition
- Initial State toggle
Use the canvas when you are laying out the flow visually. Use Manage States when you want the centralized list view.
Setting the initial state
One state must be marked as the initial state.
You can do that in either place:
- on the state node itself, or
- from Manage States
Only one state can be initial at a time.
Adding transitions
You can create a transition in two ways:
- Click Add Transition on a state node, or
- open Manage Transitions and click New Transition.
The manager flow first asks for the source state, then opens the same transition editor used from the canvas.
What a transition contains
Each transition contains:
- a trigger
- optional guards
- optional actions
Guards are reusable strategy assets. Each guard is built from one or more conditions. Conditions are also used inside conditional action steps, but they are not attached directly to transitions as their own reusable top-level object.
Trigger types
| Trigger | When it evaluates | Requires data stream |
|---|---|---|
| Event | When a matching runtime event arrives | Yes |
| Always | Immediately on state entry | No |
| After | After a configured delay from state entry | No |
Event triggers
Event triggers are the most common option. They react to subscribed data streams.
- Candle-series streams produce candle events.
- Event-series streams produce named custom events.
If you do not have the right stream subscribed yet, open Subscribing Strategies to Streams first.
Always and After triggers
These triggers do not need a stream subscription, but they still operate within the same state machine and can reference the latest available context and indicator values.
Refining transitions
After the transition exists, open it in the transition inspector or through Manage Transitions to attach:
Building a valid loop
Every state needs at least one outgoing transition. For a minimal strategy, build a loop such as:
Watching -> ActiveActive -> Watching
That satisfies the checklist and gives the machine a complete path through its states.