EngineMarket Data
Market Data
Understand how instruments, observations, session rules, and strategy frames connect.
Market data supplies the observations your strategy uses to make decisions. To explain a result, identify the instrument, the observation time, the data source, and the rules that determined when your strategy ran.
Start with the current SJS bar. Then distinguish it from cached history, a separate historical query, and output produced by an algorithm.
From data to a decision
The data surfaces
| Surface | What it represents | What to verify |
|---|---|---|
bar | The observation passed to the current strategy invocation | Required fields, timestamp, and sampling policy |
context.marketData | The concrete session's cached market-data view | Instrument keys, coverage, and ordering |
context.historicalData(...) | A request handled by the session's data adapter | Bounds, interval support, returned coverage, and future rows |
| Algorithm or Pine output | Derived values from its producer | Readiness, timestamp convention, and availability in execution order |
The session's cache is not a universal multi-instrument feed or a guarantee that all requested history is present. The data adapter and session type determine its contents.
Read in order
- Getting started: observe frames without requesting trades.
- Instruments: select the exact instrument or contract.
- Bars and intervals: define timestamps and sampling.
- Historical data: inspect coverage and repeatable inputs.
- Live data: handle incoming updates.
- Sessions and timezones: understand processing boundaries.
- Warmup and readiness: establish usable evidence.
- Missing and stale data: distinguish gaps from repeated observations.
- Debugging: trace the first unexpected stage.