Skip to main content

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.

  1. Open the Strategy Toolbar.
  2. Select Manage States.
  3. Click New State.
  4. 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:

  1. Click Add Transition on a state node, or
  2. 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

TriggerWhen it evaluatesRequires data stream
EventWhen a matching runtime event arrivesYes
AlwaysImmediately on state entryNo
AfterAfter a configured delay from state entryNo

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 -> Active
  • Active -> Watching

That satisfies the checklist and gives the machine a complete path through its states.