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.
Data sources are the connections you set up to bring data into FORJ — webhook endpoints for TradingView, custom APIs, etc. Each source produces one or more data streams, which are the canonical feeds of candle or event data that strategies subscribe to. You create sources; FORJ creates streams from them. See Data Sources for setup instructions.
Subscribing to a Stream
- In SMITH, open the Strategy Toolbar (gear icon).
- Select Manage Data Sources.
- 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.
Cross-Stream Conditions
When subscribed to multiple streams, you can build conditions that compare indicator values across streams directly — for example, comparing a 5-minute EMA against a 1-hour EMA in the same condition. Each operand in a condition lets you select which stream's indicator snapshot to reference: the triggering stream or any specific subscribed stream.
This removes the need for context-variable workarounds in multi-timeframe or multi-instrument strategies. See Cross-Stream Conditions for details.
Stream Priority
When your strategy subscribes to multiple streams, you can set their processing priority by dragging streams into the desired order. Each stream shows a priority number (1, 2, 3...).
When multiple streams deliver events with the same timestamp, FORJ processes them in priority order — lower numbers first. This gives you control over which data your strategy sees first when events arrive simultaneously.
Each stream entry displays its metadata: display name, series kind (Candle Series or Event Series), and details like instrument, timeframe, and venue.
Managing Subscriptions
You can add or remove stream subscriptions at any time from the Manage Data Sources 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, not by metadata fields.