Candles / market data
TradeJS strategies normally operate on candles: open, high, low, close, volume, and timestamp for a symbol and interval.
The common workflow is:
- A connector loads or updates candle history.
- Indicators and market context are computed from historical candles.
- The runtime gives each strategy the current closed candle.
- The strategy returns
skip,entry, orexit.
Closed Candles Matter
Runtime signal scans are designed around closed candles. Acting on still-forming candles can create unstable or misleading decisions.
Context Data
Strategies can also use historical global-market, derivatives, spread, and on-chain context. Treat these as optional inputs and apply the same timestamp discipline as candles: a decision may use only information available at its decision time.
Data Quality
Backtest quality depends on:
- exchange/provider coverage
- gaps and duplicate candles
- timestamp alignment
- volume correctness
- spread and derivatives context availability
See Backtesting caveats.