|
PineForge v0.12.2-8-g8df08f2
Deterministic PineScript v6 backtest runtime — C ABI reference
|
PineForge exposes three configuration surfaces:
input.*() in the source script.strategy(...) call.All three are set on the strategy handle, before calling run_backtest. Calls made after a run are queued for the next run.
| Pine type | Serialized form |
|---|---|
int | decimal string, e.g. "21" |
float | decimal string, e.g. "0.04" (use . always — no locale) |
bool | "true" / "false" |
string | the string itself (no quoting) |
source | one of "open", "high", "low", "close", "hl2", "hlc3", "ohlc4", "hlcc4" |
color | hex "#RRGGBB" or "#AARRGGBB" |
timeframe | TV-style — "1", "5", "60", "1D", "1W" |
The key is the input's title, exactly as it appears in the Pine title= argument. If no title was given, the runtime falls back to the variable identifier.
These mirror the parameters of Pine's strategy(...) declaration. Setting them via the C ABI overrides the script-defined defaults for this run.
Configured per-call on run_backtest_full:
Volume-weighted sampling is a separate sticky toggle:
See Bar magnifier for the sampling model.
Captures // @pf-trace name=expr pragma values per bar into pf_report_t::trace. Zero-cost when disabled. See Report schema § Trace records.
Earlier bars still execute user code and warm TA / series state. Only order commands are ignored. Use this to leave room for indicators to stabilize before trades start.
Configuration values stick to the handle, not the run. They apply to every run_backtest on that handle until overwritten or strategy_free is called.
One-shot backtests reset broker and report state before every run, while these configuration values persist on the handle. Fresh handles remain a clear default for parameter sweeps (see Lifecycle):