Skip to main content

What is a Strategy?

A strategy in FORJ is a set of logical rules that define how and when your trading logic reacts to market conditions. You design strategies visually in SMITH, FORJ's strategy editor.

Each strategy is represented as a set of states, transitions, and guards that together describe its decision-making process.

At a high level, a strategy answers three questions:

  1. Where am I now?
    (Which state is the strategy currently in — like Idle, Scanning, or In Position?)

  2. What just happened?
    (An event occurs — like a new market candle.)

  3. What should I do next?
    (Stay in this state, or transition to another state and run specific actions?)


Key Building Blocks

States

Each state represents a distinct phase of your strategy’s behavior.
For example:

  • Idle — Waiting for entry conditions.
  • Scanning — Monitoring the market for a trigger.
  • InPosition — Deciding whether or not to take a Trade.

Transitions

Transitions define how the strategy moves from one state to another when certain conditions are met.
Each transition:

  • Listens for a specific event (e.g., a new candle).
  • Evaluates one or more conditions (rules like RSI < 30).
  • Executes actions if the transition occurs (e.g., signal a trade, update variables).

Strategy Configuration

The Strategy Toolbar (gear icon) organizes all configuration into sections:

  • Structure — manage states, transitions, and global event handlers.
  • Runtime — configure activation rules that control when events are processed.
  • Data — subscribe to data streams so the strategy receives market events.
  • Assets — manage custom variables, indicator events, guards (conditions), and actions.
  • Trade & Alerts — configure trade plans and alert definitions.
  • Manage Draft — browse undo history or reset the draft.

See SMITH Overview for details on each section.

Events, Conditions & Actions

  • Events trigger evaluation (for example, a New Candle event every time a candle closes).
  • Conditions are true/false checks that determine whether a transition is allowed.
  • Actions are the effects executed when transitions occur.

SMITH — The Strategy Editor

SMITH is the visual editor where you design and inspect strategies at a glance. You can:

  • Drag and drop states to organize your logic visually.
  • Connect transitions to define relationships.
  • Zoom and pan freely to navigate complex logic.
  • Track outstanding work via the Checklist of required configurations.

The Creation Checklist

Every strategy must satisfy these items before it can be saved:

  • Valid Strategy Name
  • At Least Two States Configured
  • Initial State Configured
  • All States Have Transitions
  • No Infinite Transition Loops
  • Strategy Activation Valid
  • Trigger Formats Current

Once complete, the Create Strategy button becomes available.