|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
Data Structures | |
| class | MetricsBindingHashV1 |
| struct | MetricsPlainHostV1 |
| Specialize for the EXACT host passed to PINEFORGE_EXPORT_NATIVE_STRATEGY. More... | |
| class | Module |
| The one class the macro instantiates: the host plus the module boundary. More... | |
Functions | |
| template<typename Host> | |
| bool | metrics_plain_declaration_v1 (MetricsPlainDeclarationV1 &out) noexcept |
| template<typename Host> | |
| std::int32_t | metrics_only_capability_v1 () noexcept |
| std::uint64_t | next_metrics_attempt_v1 () noexcept |
| BacktestEngine * | as_engine (pf_strategy_t strategy) |
| template<typename Host> | |
| Module< Host > * | as_module (pf_strategy_t strategy) |
| template<typename Host> | |
| void | note_error (pf_strategy_t strategy, const char *text, const RunFailureValue &value) |
| RunFailureValue | unclassified_failure () noexcept |
| The code of an exception no coded site raised: engine_unclassified_error. | |
| template<typename Host> | |
| void | note_error (pf_strategy_t strategy, const char *text) |
| The text alone, as before run-failure codes: engine_unclassified_error. | |
| template<typename Host, typename Fn> | |
| void | guarded (pf_strategy_t strategy, Fn &&fn) |
Runs fn and converts any escaping exception into presentation text and its code. | |
| Bar | copy_bar (const pf_bar_t &in) |
| bool | magnifier_unsupported (int bar_magnifier, int magnifier_samples, pf_magnifier_distribution_t distribution) |
A native host owns its own intrabar path through NativeRunSpec::intrabar, so the C magnifier arguments have no meaning here. | |
| void | publish_report (BacktestEngine *engine, pf_report_t *out) |
| Fills a local report first: the caller's struct is written only once the engine has produced a complete, owned value. | |
| template<typename Host> | |
| pf_strategy_t | create () |
| void | destroy (pf_strategy_t strategy) |
| template<typename Host> | |
| void | set_input (pf_strategy_t strategy, const char *key, const char *value) |
| template<typename Host> | |
| void | set_override (pf_strategy_t strategy, const char *key, const char *value) |
| template<typename Host> | |
| void | set_magnifier_volume_weighted (pf_strategy_t strategy, int on) |
| template<typename Host> | |
| void | run_batch (pf_strategy_t strategy, pf_bar_t *bars, int count, const char *input_tf, const char *script_tf, bool with_timeframes, pf_report_t *out) |
| template<typename Host> | |
| void | run_backtest (pf_strategy_t strategy, pf_bar_t *bars, int count, pf_report_t *out) |
| template<typename Host> | |
| void | run_backtest_full (pf_strategy_t strategy, pf_bar_t *bars, int count, const char *input_tf, const char *script_tf, int bar_magnifier, int magnifier_samples, pf_magnifier_distribution_t magnifier_distribution, pf_report_t *out) |
| void | report_free (pf_report_t *report) |
|
noexcept |
Definition at line 79 of file native_module.hpp.
References pineforge::native_module::MetricsPlainHostV1< Host >::declaration().
Referenced by metrics_only_capability_v1(), and pineforge::native_module::Module< Host >::prepare_metrics_only_v1().
|
noexcept |
Definition at line 98 of file native_module.hpp.
References metrics_plain_declaration_v1(), pineforge::metrics::NotImplemented, and pineforge::metrics::Ok.
|
inlinenoexcept |
Definition at line 108 of file native_module.hpp.
Referenced by pineforge::native_module::Module< Host >::prepare_metrics_only_v1().
|
inline |
Definition at line 331 of file native_module.hpp.
References pineforge::strategy.
Referenced by as_module(), destroy(), run_batch(), set_input(), set_magnifier_volume_weighted(), and set_override().
| Module< Host > * pineforge::native_module::as_module | ( | pf_strategy_t | strategy | ) |
Definition at line 336 of file native_module.hpp.
References as_engine(), and pineforge::strategy.
Referenced by note_error(), and run_batch().
| void pineforge::native_module::note_error | ( | pf_strategy_t | strategy, |
| const char * | text, | ||
| const RunFailureValue & | value ) |
Definition at line 341 of file native_module.hpp.
References as_module(), and pineforge::strategy.
Referenced by guarded(), note_error(), run_backtest_full(), and run_batch().
|
inlinenoexcept |
The code of an exception no coded site raised: engine_unclassified_error.
Definition at line 346 of file native_module.hpp.
References pineforge::engine_unclassified_error.
Referenced by guarded(), note_error(), and run_batch().
| void pineforge::native_module::note_error | ( | pf_strategy_t | strategy, |
| const char * | text ) |
The text alone, as before run-failure codes: engine_unclassified_error.
Definition at line 352 of file native_module.hpp.
References note_error(), pineforge::strategy, and unclassified_failure().
| void pineforge::native_module::guarded | ( | pf_strategy_t | strategy, |
| Fn && | fn ) |
Runs fn and converts any escaping exception into presentation text and its code.
C callers have no exception channel, so nothing may propagate past here.
Definition at line 360 of file native_module.hpp.
References pineforge::classify_run_failure(), note_error(), pineforge::strategy, and unclassified_failure().
Referenced by set_input(), set_magnifier_volume_weighted(), and set_override().
Definition at line 372 of file native_module.hpp.
References pf_bar_t::close, pineforge::Bar::close, pf_bar_t::high, pineforge::Bar::high, pf_bar_t::low, pineforge::Bar::low, pf_bar_t::open, pineforge::Bar::open, pf_bar_t::timestamp, pineforge::Bar::timestamp, pf_bar_t::volume, and pineforge::Bar::volume.
|
inline |
A native host owns its own intrabar path through NativeRunSpec::intrabar, so the C magnifier arguments have no meaning here.
Only the defaults are accepted; anything else is refused before the run starts.
Definition at line 386 of file native_module.hpp.
References PF_MAGNIFIER_ENDPOINTS.
Referenced by run_backtest_full().
|
inline |
Fills a local report first: the caller's struct is written only once the engine has produced a complete, owned value.
Definition at line 394 of file native_module.hpp.
References pineforge::engine_script_run_v19::BacktestEngine::fill_report().
Referenced by run_batch().
| pf_strategy_t pineforge::native_module::create | ( | ) |
Definition at line 407 of file native_module.hpp.
References pf_abi_version().
|
inline |
Definition at line 420 of file native_module.hpp.
References as_engine(), and pineforge::strategy.
| void pineforge::native_module::set_input | ( | pf_strategy_t | strategy, |
| const char * | key, | ||
| const char * | value ) |
Definition at line 425 of file native_module.hpp.
References as_engine(), guarded(), pineforge::engine_script_run_v19::BacktestEngine::set_input(), and pineforge::strategy.
| void pineforge::native_module::set_override | ( | pf_strategy_t | strategy, |
| const char * | key, | ||
| const char * | value ) |
Definition at line 432 of file native_module.hpp.
References as_engine(), guarded(), pineforge::engine_script_run_v19::BacktestEngine::set_input(), and pineforge::strategy.
| void pineforge::native_module::set_magnifier_volume_weighted | ( | pf_strategy_t | strategy, |
| int | on ) |
Definition at line 443 of file native_module.hpp.
References as_engine(), guarded(), pineforge::engine_script_run_v19::BacktestEngine::set_magnifier_volume_weighted(), and pineforge::strategy.
| void pineforge::native_module::run_batch | ( | pf_strategy_t | strategy, |
| pf_bar_t * | bars, | ||
| int | count, | ||
| const char * | input_tf, | ||
| const char * | script_tf, | ||
| bool | with_timeframes, | ||
| pf_report_t * | out ) |
Definition at line 450 of file native_module.hpp.
References as_engine(), as_module(), pineforge::classify_run_failure(), note_error(), publish_report(), pineforge::strategy, and unclassified_failure().
Referenced by run_backtest(), and run_backtest_full().
| void pineforge::native_module::run_backtest | ( | pf_strategy_t | strategy, |
| pf_bar_t * | bars, | ||
| int | count, | ||
| pf_report_t * | out ) |
Definition at line 483 of file native_module.hpp.
References run_batch(), and pineforge::strategy.
| void pineforge::native_module::run_backtest_full | ( | pf_strategy_t | strategy, |
| pf_bar_t * | bars, | ||
| int | count, | ||
| const char * | input_tf, | ||
| const char * | script_tf, | ||
| int | bar_magnifier, | ||
| int | magnifier_samples, | ||
| pf_magnifier_distribution_t | magnifier_distribution, | ||
| pf_report_t * | out ) |
Definition at line 488 of file native_module.hpp.
References magnifier_unsupported(), pineforge::make_run_failure(), note_error(), run_batch(), pineforge::run_options_rejected, and pineforge::strategy.
|
inline |
Definition at line 508 of file native_module.hpp.