|
PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
|
Data Structures | |
| class | Module |
| The one class the macro instantiates: the host plus the module boundary. More... | |
Functions | |
| 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) |
| template<typename Host, typename Fn> | |
| void | guarded (pf_strategy_t strategy, Fn &&fn) |
Runs fn and converts any escaping exception into presentation text. | |
| 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) |
|
inline |
Definition at line 102 of file native_module.hpp.
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 107 of file native_module.hpp.
References as_engine().
Referenced by note_error().
| void pineforge::native_module::note_error | ( | pf_strategy_t | strategy, |
| const char * | text ) |
Definition at line 112 of file native_module.hpp.
References as_module().
Referenced by guarded(), run_backtest_full(), and run_batch().
| void pineforge::native_module::guarded | ( | pf_strategy_t | strategy, |
| Fn && | fn ) |
Runs fn and converts any escaping exception into presentation text.
C callers have no exception channel, so nothing may propagate past here.
Definition at line 119 of file native_module.hpp.
References note_error().
Referenced by set_input(), set_magnifier_volume_weighted(), and set_override().
Definition at line 130 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.
Referenced by run_batch().
|
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 144 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 152 of file native_module.hpp.
References pineforge::engine_script_run_v18::BacktestEngine::fill_report().
Referenced by run_batch().
| pf_strategy_t pineforge::native_module::create | ( | ) |
Definition at line 165 of file native_module.hpp.
References pf_abi_version().
|
inline |
Definition at line 178 of file native_module.hpp.
References as_engine().
| void pineforge::native_module::set_input | ( | pf_strategy_t | strategy, |
| const char * | key, | ||
| const char * | value ) |
Definition at line 183 of file native_module.hpp.
References as_engine(), guarded(), and pineforge::engine_script_run_v18::BacktestEngine::set_input().
| void pineforge::native_module::set_override | ( | pf_strategy_t | strategy, |
| const char * | key, | ||
| const char * | value ) |
Definition at line 190 of file native_module.hpp.
References as_engine(), guarded(), and pineforge::engine_script_run_v18::BacktestEngine::set_input().
| void pineforge::native_module::set_magnifier_volume_weighted | ( | pf_strategy_t | strategy, |
| int | on ) |
Definition at line 201 of file native_module.hpp.
References as_engine(), guarded(), and pineforge::engine_script_run_v18::BacktestEngine::set_magnifier_volume_weighted().
| 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 208 of file native_module.hpp.
References as_engine(), copy_bar(), note_error(), and publish_report().
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 238 of file native_module.hpp.
References run_batch().
| 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 243 of file native_module.hpp.
References magnifier_unsupported(), note_error(), and run_batch().
|
inline |
Definition at line 258 of file native_module.hpp.