How quantpad/pine-runner works
This is a process-isolated Pine Script runner: a parent application sends a JSON scan or run request, and the child returns a sentinel-encoded JSON response. Runs configure and execute the Pine engine against supplied OHLCV data, then return normalized chart visuals and a bounded strategy-state snapshot. The graph follows the sampled entry point and orchestrator; unsampled normalization details are represented by their documented subsystem, without inferring additional internal calls.
Main entry points: run.ts Run Orchestrator · main.ts Child Entry Point · provider.ts Candle Provider · engine.ts Engine Adapter
Components 13
Process Boundary
- JSON Protocol
src/protocol.ts - Child Entry Point
src/main.ts - Special Number Codec
src/codec.ts - Runner Data Types
src/types.ts
Pine Execution
- Run Orchestrator
src/run.ts - Engine Adapter
src/engine.ts - PineTS Engine
- Runtime Compatibility
src/runtime-compat.ts
Market Data
- Candle Provider
src/provider.ts - OHLCV Resampling
src/resample.ts
Settings and Results
- Settings Resolver
src/settings.ts - Visual Normalizer
src/normalize.ts
Other components
- Parent Application
Connections 16
- Parent Application → JSON Protocol: sends requests
README.md - Parent Application → Child Entry Point: spawns child
README.md - Child Entry Point → JSON Protocol: handles request types
src/main.ts - Child Entry Point → Run Orchestrator: dispatches scan/run
src/main.ts - Child Entry Point → Special Number Codec: encodes response
src/main.ts - Child Entry Point → Parent Application: writes JSON response
README.md - Run Orchestrator → Engine Adapter: loads engine
src/run.ts - Engine Adapter → PineTS Engine: loads package
src/engine.ts - Run Orchestrator → Runtime Compatibility: patches runtime
src/run.ts - Run Orchestrator → Settings Resolver: resolves overrides
src/run.ts - Settings Resolver → Engine Adapter: creates indicator
src/settings.ts - Run Orchestrator → Candle Provider: creates data provider
src/run.ts - Candle Provider → Visual Normalizer: converts candles
src/provider.ts - Candle Provider → OHLCV Resampling: aggregates bars
src/provider.ts - Run Orchestrator → Visual Normalizer: normalizes plots
src/run.ts - Run Orchestrator → Parent Application: returns run result
README.md