PineForge v0.1.2-7-ga095e36
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
Per-strategy configuration

Override input. More...

Functions

void strategy_set_input (pf_strategy_t s, const char *key, const char *value)
 Override a Pine input.
 
void strategy_set_override (pf_strategy_t s, const char *key, const char *value)
 Override a strategy(...) declaration parameter.
 
void strategy_set_magnifier_volume_weighted (pf_strategy_t s, int on)
 Toggle volume-weighted bar-magnifier sampling.
 
void strategy_set_trace_enabled (pf_strategy_t s, int on)
 Toggle per-bar trace recording.
 
void strategy_set_trade_start_time (pf_strategy_t s, int64_t timestamp_ms)
 Set the earliest Unix-ms timestamp at which strategy order commands may fire.
 

Detailed Description

Override input.

*() values, strategy(...) params, and runtime knobs.

Function Documentation

◆ strategy_set_input()

void strategy_set_input ( pf_strategy_t s,
const char * key,
const char * value )

Override a Pine input.

*() value before the next run.

Parameters
sStrategy handle.
keyThe input's title (or fallback identifier).
valueSerialized value — numbers as decimal strings, booleans as "true" / "false".

Calls after run_backtest are accepted but only take effect on subsequent runs.

References PF_API.

◆ strategy_set_override()

void strategy_set_override ( pf_strategy_t s,
const char * key,
const char * value )

Override a strategy(...) declaration parameter.

Recognised key values: initial_capital, commission_value, default_qty_value, pyramiding, slippage, process_orders_on_close, close_entries_rule, default_qty_type, commission_type.

References PF_API.

◆ strategy_set_magnifier_volume_weighted()

void strategy_set_magnifier_volume_weighted ( pf_strategy_t s,
int on )

Toggle volume-weighted bar-magnifier sampling.

Has no effect unless the bar magnifier is enabled in run_backtest_full.

References PF_API.

◆ strategy_set_trace_enabled()

void strategy_set_trace_enabled ( pf_strategy_t s,
int on )

Toggle per-bar trace recording.

Default off (zero-cost when off).

Enables capture for // @pf-trace name=expr pragmas already compiled into the strategy .so. Trace records appear in pf_report_t::trace.

References PF_API.

◆ strategy_set_trade_start_time()

void strategy_set_trade_start_time ( pf_strategy_t s,
int64_t timestamp_ms )

Set the earliest Unix-ms timestamp at which strategy order commands may fire.

Earlier bars still execute user code and warm TA/series state, but strategy.entry/order/exit/close commands are ignored.

References PF_API.