Skip to main content

Global Event Handlers

A global event handler is a special transition that isn't tied to a specific source state — it can fire from any state your strategy is currently in.

This is useful for logic that should apply universally, regardless of which state the strategy occupies. For example, an emergency exit condition or a universal alert trigger.

Creating a Global Event Handler

  1. In SMITH, open the Strategy Toolbar (gear icon).
  2. Select Add Global Event Handler.
  3. Configure:
    • Target state — where the strategy should move to when this handler fires
    • Trigger — the event that causes evaluation (candle, custom event, time-based, or always)
    • Conditions (optional) — rules that must pass for the transition to execute
    • Actions (optional) — what to do when the transition fires

When to Use Global Handlers

Global handlers are best for cross-cutting concerns:

  • Emergency stop — move to a safe state if a critical condition is met, no matter where the strategy is
  • Universal alerts — trigger an alert on any event that matches a pattern
  • Reset logic — return to the initial state when a specific signal arrives

Viewing Global Handlers

Global event handlers appear in the Transitions Manager alongside regular transitions. They're labeled with a globe icon and grouped under "Global Event Handlers" in the Category sort view.

info

Global handlers are evaluated alongside the current state's own transitions. If both a state-specific transition and a global handler could fire on the same event, the state-specific transition takes priority.