PineForge v0.1.2-7-ga095e36
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pf_report_t Struct Reference

Backtest report filled by run_backtest / run_backtest_full. More...

#include <pineforge.h>

Data Fields

int total_trades
 Closed-trade count (== trades_len).
 
pf_trade_ttrades
 Heap array of closed trades.
 
int trades_len
 Length of trades.
 
double net_profit
 Sum of all closed-trade PnL.
 
int64_t input_bars_processed
 Source-feed bars consumed.
 
int64_t script_bars_processed
 Script-timeframe bars evaluated.
 
int64_t security_feeds_total
 Total higher-TF feed bars across all security sites.
 
int64_t security_complete_total
 Total complete-bar evals across all security sites.
 
int64_t security_partial_total
 Total partial-bar evals across all security sites.
 
int64_t magnifier_sub_bars_total
 Sub-bars synthesized by the magnifier.
 
int64_t magnifier_sample_ticks_total
 Sample ticks visited by the magnifier.
 
int input_tf_seconds
 Detected/configured input timeframe (seconds).
 
int script_tf_seconds
 Script timeframe (seconds).
 
int script_tf_ratio
 script_tf_seconds / input_tf_seconds.
 
int needs_aggregation
 1 if input → script TF aggregation was performed.
 
int bar_magnifier_enabled
 1 if magnifier was active for this run.
 
pf_security_diag_tsecurity_diag
 One entry per request.security site.
 
int security_diag_len
 Length of security_diag.
 
pf_trace_entry_ttrace
 Per-bar trace records (empty unless tracing enabled).
 
int trace_len
 Length of trace.
 
const char ** trace_names
 Names indexed by pf_trace_entry_t::name_id.
 
int trace_names_len
 Length of trace_names.
 

Detailed Description

Backtest report filled by run_backtest / run_backtest_full.

Layout-compatible with internal pineforge::ReportC.

Ownership and lifetime

The struct itself is caller-owned (typically stack). The embedded arrays (trades, security_diag, trace, trace_names) are heap-allocated by the runtime; the caller must invoke report_free exactly once on each filled report. trace_names string pointers remain owned by the strategy handle until strategy_free.

Definition at line 153 of file pineforge.h.

Field Documentation

◆ total_trades

int pf_report_t::total_trades

Closed-trade count (== trades_len).

Definition at line 155 of file pineforge.h.

◆ trades

pf_trade_t* pf_report_t::trades

Heap array of closed trades.

Definition at line 156 of file pineforge.h.

◆ trades_len

int pf_report_t::trades_len

Length of trades.

Definition at line 157 of file pineforge.h.

◆ net_profit

double pf_report_t::net_profit

Sum of all closed-trade PnL.

Definition at line 158 of file pineforge.h.

◆ input_bars_processed

int64_t pf_report_t::input_bars_processed

Source-feed bars consumed.

Definition at line 161 of file pineforge.h.

◆ script_bars_processed

int64_t pf_report_t::script_bars_processed

Script-timeframe bars evaluated.

Definition at line 162 of file pineforge.h.

◆ security_feeds_total

int64_t pf_report_t::security_feeds_total

Total higher-TF feed bars across all security sites.

Definition at line 165 of file pineforge.h.

◆ security_complete_total

int64_t pf_report_t::security_complete_total

Total complete-bar evals across all security sites.

Definition at line 166 of file pineforge.h.

◆ security_partial_total

int64_t pf_report_t::security_partial_total

Total partial-bar evals across all security sites.

Definition at line 167 of file pineforge.h.

◆ magnifier_sub_bars_total

int64_t pf_report_t::magnifier_sub_bars_total

Sub-bars synthesized by the magnifier.

Definition at line 170 of file pineforge.h.

◆ magnifier_sample_ticks_total

int64_t pf_report_t::magnifier_sample_ticks_total

Sample ticks visited by the magnifier.

Definition at line 171 of file pineforge.h.

◆ input_tf_seconds

int pf_report_t::input_tf_seconds

Detected/configured input timeframe (seconds).

Definition at line 174 of file pineforge.h.

◆ script_tf_seconds

int pf_report_t::script_tf_seconds

Script timeframe (seconds).

Definition at line 175 of file pineforge.h.

◆ script_tf_ratio

int pf_report_t::script_tf_ratio

script_tf_seconds / input_tf_seconds.

Definition at line 176 of file pineforge.h.

◆ needs_aggregation

int pf_report_t::needs_aggregation

1 if input → script TF aggregation was performed.

Definition at line 177 of file pineforge.h.

◆ bar_magnifier_enabled

int pf_report_t::bar_magnifier_enabled

1 if magnifier was active for this run.

Definition at line 178 of file pineforge.h.

◆ security_diag

pf_security_diag_t* pf_report_t::security_diag

One entry per request.security site.

Definition at line 181 of file pineforge.h.

◆ security_diag_len

int pf_report_t::security_diag_len

Length of security_diag.

Definition at line 182 of file pineforge.h.

◆ trace

pf_trace_entry_t* pf_report_t::trace

Per-bar trace records (empty unless tracing enabled).

Definition at line 185 of file pineforge.h.

◆ trace_len

int pf_report_t::trace_len

Length of trace.

Definition at line 186 of file pineforge.h.

◆ trace_names

const char** pf_report_t::trace_names

Names indexed by pf_trace_entry_t::name_id.

Definition at line 187 of file pineforge.h.

◆ trace_names_len

int pf_report_t::trace_names_len

Length of trace_names.

Definition at line 188 of file pineforge.h.


The documentation for this struct was generated from the following file: