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
- Click the Gear icon at the bottom center to open the Strategy Toolbar.
- 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:
| Field | Purpose | Example |
|---|---|---|
| Symbol | The instrument your strategy listens to. | EURUSD |
| Candle Length | How often your strategy receives New Candle events. | 1m, 5m, 1h |
| Direction | Bullish (Buy) or Bearish (Sell). Controls the side of trades created by "Execute Trade" actions. | Bullish |
| SL/TP Pips | Default 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
- Define them in the Context panel by giving each variable a name and an initial value (number, string, or boolean).
- Update them in Actions — for example, an action on a transition can set
tradeCounttotradeCount + 1or store the current close price intoentryPrice. - Read them in Conditions — for example, a condition can check whether
tradeCount < 3or whetherclose > 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
| Variable | Initial Value | Purpose |
|---|---|---|
bullishCount | 0 | Number of consecutive bullish candles observed |
- Action on
Watching → Watchingtransition: if the candle is bullish, setbullishCount = bullishCount + 1; otherwise reset to0. - Condition on
Watching → Readytransition: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.