PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
Loading...
Searching...
No Matches
pineforge::hpo::TrialExecutor Class Referencefinal

Deterministic one-shot adapter from serialized parameters to a detached report. More...

#include <pineforge/hpo/trial_executor.hpp>

Public Member Functions

 TrialExecutor (std::shared_ptr< const StrategyPlugin > plugin, DatasetView view, BacktestConfiguration configuration={})
 Binds a validated plugin, immutable dataset view, and execution configuration.
 
 TrialExecutor (std::shared_ptr< const StrategyPlugin > plugin, std::shared_ptr< const Dataset > dataset, BacktestConfiguration configuration={})
 Binds the whole dataset as a view, preserving existing callers' pointer and length.
 
TrialExecutionResult execute (const ParameterValues &inputs, const ParameterValues &strategy_overrides={}) const
 Runs one fresh strategy instance with overrides applied before ordinary inputs.
 
TrialExecutionResult execute_prefix (const ParameterValues &inputs, const ParameterValues &strategy_overrides, std::size_t bar_count) const
 Runs the exact full-backtest engine path on an immutable bar prefix.
 
const BacktestConfiguration & configuration () const noexcept
 Returns the immutable per-execution configuration.
 
const Dataset & dataset () const noexcept
 Returns the shared immutable owner; its size may exceed the execution view.
 
const DatasetView & view () const noexcept
 Returns the immutable execution range.
 
const StrategyPlugin & plugin () const noexcept
 Returns the loaded strategy plugin.
 

Detailed Description

Deterministic one-shot adapter from serialized parameters to a detached report.

execute() is const and may be called concurrently: every call creates a fresh strategy handle while all calls share only the immutable plugin function table and DatasetView. Report-owned resources are released before the strategy handle on every path.

Definition at line 231 of file trial_executor.hpp.

Constructor & Destructor Documentation

◆ TrialExecutor() [1/2]

pineforge::hpo::TrialExecutor::TrialExecutor ( std::shared_ptr< const StrategyPlugin >  plugin,
DatasetView  view,
BacktestConfiguration  configuration = {} 
)

Binds a validated plugin, immutable dataset view, and execution configuration.

Exceptions
std::invalid_argumentfor a null plugin, an ABI-incompatible view size, non-positive magnifier samples, or an unknown magnifier distribution.

◆ TrialExecutor() [2/2]

pineforge::hpo::TrialExecutor::TrialExecutor ( std::shared_ptr< const StrategyPlugin >  plugin,
std::shared_ptr< const Dataset >  dataset,
BacktestConfiguration  configuration = {} 
)

Binds the whole dataset as a view, preserving existing callers' pointer and length.

Exceptions
std::invalid_argumentfor null dependencies or invalid execution settings.

Member Function Documentation

◆ configuration()

const BacktestConfiguration & pineforge::hpo::TrialExecutor::configuration ( ) const
inlinenoexcept

Returns the immutable per-execution configuration.

Definition at line 261 of file trial_executor.hpp.

◆ dataset()

const Dataset & pineforge::hpo::TrialExecutor::dataset ( ) const
inlinenoexcept

Returns the shared immutable owner; its size may exceed the execution view.

Definition at line 263 of file trial_executor.hpp.

References pineforge::hpo::DatasetView::owner.

◆ execute()

TrialExecutionResult pineforge::hpo::TrialExecutor::execute ( const ParameterValues &  inputs,
const ParameterValues &  strategy_overrides = {} 
) const

Runs one fresh strategy instance with overrides applied before ordinary inputs.

Strategy-reported errors are returned as TrialExecutionStatus::kEngineError. Adapter and plugin contract violations may throw.

◆ execute_prefix()

TrialExecutionResult pineforge::hpo::TrialExecutor::execute_prefix ( const ParameterValues &  inputs,
const ParameterValues &  strategy_overrides,
std::size_t  bar_count 
) const

Runs the exact full-backtest engine path on an immutable bar prefix.

The prefix must contain between one and view().size() bars. An empty view cannot run.

◆ plugin()

const StrategyPlugin & pineforge::hpo::TrialExecutor::plugin ( ) const
inlinenoexcept

Returns the loaded strategy plugin.

Definition at line 267 of file trial_executor.hpp.

◆ view()

const DatasetView & pineforge::hpo::TrialExecutor::view ( ) const
inlinenoexcept

Returns the immutable execution range.

Definition at line 265 of file trial_executor.hpp.


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