Data Streams
A strategy needs data to react to. In FORJ, data arrives through streams — feeds of market candles or custom events that you connect via data sources. To make a strategy respond to a stream, you subscribe it.
Subscribing to a Stream
- In SMITH, open the Strategy Toolbar (gear icon).
- Select Data Subscriptions.
- Browse available streams in your workspace and select the one(s) you want this strategy to listen to.
Once subscribed, incoming events from that stream are routed to your strategy and can trigger transitions.
Stream Types
| Type | What It Delivers | Example |
|---|---|---|
| Candle series | Standard OHLCV candle data at a regular interval | 5-minute BTCUSD candles from TradingView |
| Event series | Custom event payloads from a webhook | A custom signal from your own system |
Your transitions specify which event type they listen for — candle events or custom events — and FORJ matches them to the correct stream.
Multiple Streams
A single strategy can subscribe to multiple streams. This is useful when your logic depends on data from different instruments or timeframes. Each transition can target a specific stream, so you can build strategies that react to signals from multiple sources.
Managing Subscriptions
You can add or remove stream subscriptions at any time from the Data Subscriptions panel. Removing a subscription means the strategy will no longer receive events from that stream.
Event delivery is controlled by your strategy’s stream subscriptions (physicalStreamId), not by context fields like Symbol or Candle Length.
Context values are still important for strategy metadata and action outputs (for example, Execute Trade defaults to context symbol/direction/risk fields). Keep context values aligned with your subscribed stream(s) so labels and trade records remain clear.