v6.4.0 — request.security()
request.security() — Multi-Symbol and Multi-Timeframe Support
This release adds full request.security() support, enabling multi-symbol and multi-timeframe analysis in PyneCore scripts. Each security context runs as a separate OS process with its own Series history, providing true parallel execution on multi-core systems.
New Features
request.security()
- Higher-timeframe (HTF) data access with
lookahead_offsemantics (confirmed previous period) - Multi-symbol support — access data from any symbol with available OHLCV data
- Multiple security calls per script, each running in its own process
- Conditional and nested security calls supported
barmerge.gaps_off(forward-fill) andbarmerge.gaps_on(na between periods)ignore_invalid_symbolparameter — returnsnafor missing symbols instead of raising an errorcurrencyparameter — automatic currency conversion usingCurrencyRateProvider--securityCLI flag forpyne runto provide OHLCV data for each security context- Same-symbol, same-timeframe optimization — no separate process spawned, values read directly from chart
- Lazy process startup — security processes spawn on first signal, not at script initialization
- Configurable security context limit (default 64)
request.security_lower_tf()
- Lower-timeframe (LTF) data access returning
array<type>(list of intrabar values per chart bar) - Accumulation buffer with flush-on-signal protocol
request.currency_rate()
- TOML metadata scan for automatic FX pair detection
- Lazy OHLCV loading with binary search for nearest-prior timestamp
- Chart OHLCV as rate source when chart is a currency pair
- Inverse pair fallback (
1.0 / close)
Architecture
- AST Transformer (
SecurityTransformer): rewritesrequest.security()calls into signal/write/read/wait protocol functions - Shared Memory IPC (
security_shm.py): SyncBlock + ResultBlock with version-tracking readers for near-zero-overhead inter-process communication - Process Loop (
security_process.py): independent OHLCV loading, bar-by-bar synchronization with advance/done events - Protocol (
security.py): HTF period confirmation via Resampler, session gap handling
Documentation
docs/lib/request-security.md— usage guide with examplesdocs/lib/request-data.md— overview of all request.* functionsdocs/advanced/request-security-internals.md— technical implementation detailsdocs/overview/compatibility.md— TradingView compatibility matrix- Updated
docs/cli/run.mdwith--securityflag documentation - Updated
docs/programmatic/script-runner.mdwith security data API
Tests
- 13 AST transformation tests
- 20 shared memory and runtime protocol tests
- 10 currency rate tests
- 3 end-to-end integration tests (advance/decline ratio, same context, ignore invalid symbol)
Known Limitations
lookahead_onis deliberately not supported — it leaks future data into backtesting decisions- Standalone mode (
python script.py data.csv) does not support--securityyet