3#include <pineforge/pineforge.h>
92 std::optional<double>
metric(std::string_view path)
const noexcept;
126 std::shared_ptr<const Dataset>
dataset,
144 std::shared_ptr<const StrategyPlugin> plugin_;
145 std::shared_ptr<const Dataset> dataset_;
Immutable in-memory OHLCV input shared by independent trial executions.
RAII wrapper around one compiled PineForge strategy plugin.
Deterministic one-shot adapter from serialized parameters to a detached report.
const StrategyPlugin & plugin() const noexcept
Returns the loaded strategy plugin.
const BacktestConfiguration & configuration() const noexcept
Returns the immutable per-execution configuration.
TrialExecutionResult execute(const ParameterValues &inputs, const ParameterValues &strategy_overrides={}) const
Runs one fresh strategy instance with overrides applied before ordinary inputs.
const Dataset & dataset() const noexcept
Returns the shared immutable dataset.
TrialExecutor(std::shared_ptr< const StrategyPlugin > plugin, std::shared_ptr< const Dataset > dataset, BacktestConfiguration configuration={})
Binds a validated plugin, immutable dataset, and execution configuration.
std::map< std::string, std::string > ParameterValues
Serialized Pine input or runtime-override values keyed by strategy parameter name.
TrialExecutionStatus
Terminal status of one native strategy execution.
@ kSucceeded
Backtest completed and a detached snapshot is available.
@ kEngineError
Strategy reported an error; no comparable snapshot is available.
Immutable engine settings applied to every execution owned by a TrialExecutor.
std::string chart_timezone
Optional chart timezone applied through the strategy plugin.
bool bar_magnifier
Enables PineForge bar-magnifier sampling.
std::string script_timeframe
Pine strategy execution timeframe; may differ from the input timeframe.
pf_magnifier_distribution_t magnifier_distribution
Distribution used to place magnifier samples.
std::string input_timeframe
Timeframe represented by the input Dataset bars.
bool capture_equity_curve
Whether ReportSnapshot owns a copy of the report equity curve.
int magnifier_samples
Positive number of magnifier samples per sub-bar.
Owning report snapshot detached from strategy and C-ABI report lifetimes.
bool needs_aggregation
Whether the engine aggregated input bars for script execution.
std::int64_t security_complete_total
Number of complete secondary-feed observations.
std::int64_t security_partial_total
Number of partial secondary-feed observations.
std::int64_t security_feeds_total
Number of requested secondary security feeds.
double net_profit
Report-level net profit in account currency.
std::int32_t input_tf_seconds
Input timeframe duration in seconds.
std::int64_t script_bars_processed
Number of script-timeframe bars processed by the strategy.
std::int32_t script_tf_seconds
Script timeframe duration in seconds.
bool bar_magnifier_enabled
Whether bar magnification was active.
std::int32_t total_trades
Number of completed trades.
pf_metrics_t metrics
Complete detached PineForge metrics structure.
std::int64_t input_bars_processed
Number of input-timeframe bars processed by the engine.
std::vector< pf_equity_point_t > equity_curve
Optional owned copy controlled by BacktestConfiguration::capture_equity_curve.
std::int64_t magnifier_sample_ticks_total
Total synthetic magnifier ticks sampled.
std::int64_t magnifier_sub_bars_total
Total magnifier sub-bars processed.
std::int32_t script_tf_ratio
Integer aggregation ratio reported by the engine.
std::optional< double > metric(std::string_view path) const noexcept
Resolves a canonical objective path without allocating a string map.
Result envelope returned by TrialExecutor::execute().
bool succeeded() const noexcept
Returns whether status is TrialExecutionStatus::kSucceeded.
std::string error
Strategy error text when status is TrialExecutionStatus::kEngineError.
ReportSnapshot report
Detached report populated when execution succeeds.
TrialExecutionStatus status
Machine-readable terminal status.