Skip to main content

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 Streams vs Data Sources

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

  1. In SMITH, open the Strategy Toolbar (gear icon).
  2. Select Manage Data Sources.
  3. 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

TypeWhat It DeliversExample
Candle seriesStandard OHLCV candle data at a regular interval5-minute BTCUSD candles from TradingView
Event seriesCustom event payloads from a webhookA 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.

note

Event delivery is controlled by your strategy's stream subscriptions, not by metadata fields.