PineForge v0.13.1-379-g9b50973
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), including the range-end close of a position still open after the final bar (pf_trade_t::open_at_end).
 
pf_trade_ttrades
 Heap array of closed trades; script-driven exits first, then the range-end rows (open_at_end=1).
 
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.
 
pf_metrics_t metrics
 
pf_equity_point_tequity_curve
 
int64_t equity_curve_len
 
uint64_t * broker_state_hash
 
int64_t broker_state_hash_len
 

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, equity_curve, broker_state_hash) 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 365 of file pineforge.h.

Field Documentation

◆ total_trades

int pf_report_t::total_trades

Closed-trade count (== trades_len), including the range-end close of a position still open after the final bar (pf_trade_t::open_at_end).

Definition at line 367 of file pineforge.h.

Referenced by main(), and run_mode().

◆ trades

pf_trade_t* pf_report_t::trades

Heap array of closed trades; script-driven exits first, then the range-end rows (open_at_end=1).

Definition at line 370 of file pineforge.h.

Referenced by main().

◆ trades_len

int pf_report_t::trades_len

Length of trades.

Definition at line 372 of file pineforge.h.

◆ net_profit

double pf_report_t::net_profit

Sum of all closed-trade PnL.

Definition at line 373 of file pineforge.h.

◆ input_bars_processed

int64_t pf_report_t::input_bars_processed

Source-feed bars consumed.

Definition at line 376 of file pineforge.h.

◆ script_bars_processed

int64_t pf_report_t::script_bars_processed

Script-timeframe bars evaluated.

Definition at line 377 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 380 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 381 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 382 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 385 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 386 of file pineforge.h.

◆ input_tf_seconds

int pf_report_t::input_tf_seconds

Detected/configured input timeframe (seconds).

Definition at line 389 of file pineforge.h.

◆ script_tf_seconds

int pf_report_t::script_tf_seconds

Script timeframe (seconds).

Definition at line 390 of file pineforge.h.

◆ script_tf_ratio

int pf_report_t::script_tf_ratio

script_tf_seconds / input_tf_seconds.

Definition at line 391 of file pineforge.h.

◆ needs_aggregation

int pf_report_t::needs_aggregation

1 if input → script TF aggregation was performed.

Definition at line 392 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 393 of file pineforge.h.

◆ security_diag

pf_security_diag_t* pf_report_t::security_diag

One entry per request.security site.

Definition at line 396 of file pineforge.h.

◆ security_diag_len

int pf_report_t::security_diag_len

Length of security_diag.

Definition at line 397 of file pineforge.h.

◆ trace

pf_trace_entry_t* pf_report_t::trace

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

Definition at line 400 of file pineforge.h.

◆ trace_len

int pf_report_t::trace_len

Length of trace.

Definition at line 401 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 402 of file pineforge.h.

◆ trace_names_len

int pf_report_t::trace_names_len

Length of trace_names.

Definition at line 403 of file pineforge.h.

◆ metrics

pf_metrics_t pf_report_t::metrics

Definition at line 409 of file pineforge.h.

◆ equity_curve

pf_equity_point_t* pf_report_t::equity_curve

Definition at line 417 of file pineforge.h.

◆ equity_curve_len

int64_t pf_report_t::equity_curve_len

Definition at line 418 of file pineforge.h.

◆ broker_state_hash

uint64_t* pf_report_t::broker_state_hash

Definition at line 426 of file pineforge.h.

◆ broker_state_hash_len

int64_t pf_report_t::broker_state_hash_len

Definition at line 427 of file pineforge.h.


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