Skip to main content

Configure Context

The Context defines global settings and variables that your strategy depends on. This includes the trading instrument, candle timeframe, and any custom variables or indicator subscriptions your logic requires.

Opening the Context Panel

  1. Click the Gear icon at the bottom center to open the Strategy Toolbar.
  2. Choose Configure Context.

You can revisit this panel at any time to adjust settings.

Strategy Variables (Required)

Fill out these fields in the Strategy Variables section:

FieldPurposeExample
SymbolThe instrument your strategy listens to.EURUSD
Candle LengthHow often your strategy receives New Candle events.1m, 5m, 1h
DirectionBullish (Buy) or Bearish (Sell). Controls the side of trades created by "Execute Trade" actions.Bullish
SL/TP PipsDefault Stop Loss and Take Profit pip values for "Execute Trade" actions.20 / 40

Custom Variables

Custom variables let you store values that persist across state transitions and are available throughout your strategy's lifecycle. They act as your strategy's memory.

When to Use Custom Variables

Use a custom variable whenever your strategy needs to remember something between events or across states:

  • Counting occurrences — track how many consecutive candles met a condition before entering a position.
  • Storing a price level — capture the close price at entry so you can compare against it later.
  • Accumulating values — sum profit/loss across multiple trades within a session.
  • Flagging state — set a boolean to indicate that a particular event has occurred (e.g., "breakout confirmed").

How Custom Variables Work

  1. Define them in the Context panel by giving each variable a name and an initial value (number, string, or boolean).
  2. Update them in Actions — for example, an action on a transition can set tradeCount to tradeCount + 1 or store the current close price into entryPrice.
  3. Read them in Conditions — for example, a condition can check whether tradeCount < 3 or whether close > entryPrice.

Variable values carry forward automatically as the strategy moves between states. They reset to their initial values only when the strategy is disabled and re-enabled.

Example: Tracking Consecutive Bullish Candles

VariableInitial ValuePurpose
bullishCount0Number of consecutive bullish candles observed
  • Action on Watching → Watching transition: if the candle is bullish, set bullishCount = bullishCount + 1; otherwise reset to 0.
  • Condition on Watching → Ready transition: bullishCount >= 3 — only transition after three bullish candles in a row.

Indicator Subscriptions

You can subscribe to technical indicators (SMA, EMA, RSI, etc.) from the Context panel. Subscribed indicator values are automatically computed on each new candle and are available for use in conditions and actions, just like custom variables.

See Indicators for the full list of supported indicators and configuration options.

Checklist

Refer to the Context subsection's Checklist at the bottom of the panel to confirm all required items are complete. When satisfied, the main Creation Checklist item "Context Configured" turns green.