EngineMarket Data

Bars and intervals

Separate observation timestamps, data intervals, and strategy invocation cadence.

A bar commonly includes date, open, high, low, close, volume, and instrument. The fields available to a strategy depend on the input path. Validate the fields your calculation uses rather than assuming every observation is a complete exchange candle.

Distinguish three clocks

ConceptMeaning
Observation timestampThe market time represented by the supplied observation
Data intervalThe requested or produced aggregation interval
Strategy cadenceHow often the runtime allows strategy processing

These are not interchangeable. A one-minute interval does not establish that the script runs exactly once per completed minute in every runtime.

In the historical loop, eligible observations can fulfill pending orders before the strategy-cadence check. An observation skipped for SJS processing can still affect execution. See execution and fills.

Define how updates become samples

The SJS crossover example accepts one close for each strictly increasing timestamp. It therefore keeps the first valid observation for a timestamp and ignores later updates under that same timestamp.

That is a deliberate sampling rule, not a completed-candle detector. If your strategy requires completed candles, use a verified completion contract from the producer or implement and test a suitable transition rule. Do not infer completion from the field name close alone.

Validate only what you actually use

A close-based calculation needs a valid date and numeric close. A range calculation also needs valid high and low values. A volume-based calculation needs usable volume and an understanding of its producer's units.

A missing value is different from zero. Avoid a truthiness check that rejects a numeric zero or silently replaces missing data with zero. Do not coerce a numeric-looking string unless that conversion is an explicit part of your input contract.

Revisit parameters when changing interval

Three accepted one-minute observations and three accepted fifteen-minute observations cover different horizons. Review lookback size, gap thresholds, time-based exits, and signal freshness together.

Interval spellings and aggregation behavior belong to the specific data adapter. The Lab's interval selector does not establish a universal interval contract for every direct historical API call.

Continue with historical data to verify what a selected window actually contains.

On this page