Architecture Overview
The current script, data, backtest, and multi-symbol execution model.
Advanced
Architecture Overview
The current system has four main layers.
1. Script Authoring
Users write scripts in the editor with the current syntax:
script({...})input.*(...)ta.*(...)plot(...)strategy.*(...)symbols([...])andsymbol.*[...]for basket strategies
The sample set is the best source of truth for the supported shapes.
2. Script Execution
Scripts run bar by bar.
- indicator scripts compute and plot values
- strategy scripts compute values and place orders
- order state is tracked by stable ids
- series access uses
.get(offset)
3. Market Data
Market data is loaded per symbol and resolution.
- chart data feeds the TradingView surface
- backtests query the same bar history
- multi-symbol runs preload a fixed basket universe
4. Result Rendering
Backtests produce trade and timeline data for the UI.
- aggregate results stay compatible with single-symbol consumers
- multi-symbol results add portfolio attribution and symbol-level drilldown
- the chart remains the drilldown view for selected symbols and trades
Runtime Boundaries
- single-symbol backtests use the standard engine path
- basket strategies use the multi-symbol execution path
- legacy
$...syntax is only for compatibility with older scripts
Practical Reading Order For New Work
- read the introduction
- copy a sample script
- replace one signal
- validate the result
- only then expand into multi-symbol or advanced risk logic