|
PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
|
#include <engine.hpp>
Data Structures | |
| struct | AbortFlag |
| struct | AbortRequested |
| struct | BarTime |
| struct | ExecutionConsumerSlot |
| struct | NativeConsumerBindTag |
| struct | NativeSecurityFeed |
| struct | SecurityEvalState |
Public Member Functions | |
| virtual | ~BacktestEngine () |
| int | execution_contract () const |
| bool | native_bound () const |
| virtual void | on_bar (const Bar &bar)=0 |
| void | run (const Bar *bars, int n) |
| void | run (const Bar *input_bars, int n_input, const std::string &input_tf, const std::string &script_tf, bool bar_magnifier=false, int magnifier_samples=4, MagnifierDistribution magnifier_dist=MagnifierDistribution::ENDPOINTS) |
| virtual bool | set_aux_security_feed (const Bar *bars, int n, const std::string &input_tf) |
| bool | set_native_security_feed (const std::string &timeframe, const Bar *bars, int n) |
| bool | native_security_feed_enabled () const |
| int64_t | native_security_substitutions () const |
| int64_t | native_security_misses () const |
| bool | chart_day_partition_installed () const |
| bool | stream_begin (const Bar *warmup_bars, int n_warmup, const std::string &input_tf, const std::string &script_tf="") |
| bool | stream_push_bar (const Bar &bar) |
| bool | stream_push_tick (const TradeTick &tick) |
| bool | stream_push_ticks (const TradeTick *ticks, int n) |
| bool | stream_advance_time (int64_t timestamp_ms) |
| bool | stream_end (bool finalize_partial_input_bar=false) |
| bool | stream_is_realtime () const |
| int | stream_order_actions_len () const |
| const StreamOrderAction & | stream_order_action_at (int i) const |
| void | stream_order_actions_clear () |
| uint64_t | stream_state_hash () const |
| bool | set_account_currency_fx_series (const int64_t *timestamps_ms, const double *rates, int n) |
| void | run (const Bar *input_bars, int n_input, const std::string &input_tf, const std::string &script_tf, const std::unordered_map< std::string, std::string > &inputs, const SymInfo &syminfo, const void *overrides=nullptr, bool bar_magnifier=false, int magnifier_samples=4, MagnifierDistribution magnifier_dist=MagnifierDistribution::ENDPOINTS) |
| int | trade_count () const |
| const Trade & | get_trade (int i) const |
| std::size_t | closed_trade_count () const noexcept |
| const Trade & | closed_trade (std::size_t i) const |
| int | report_trade_count () const |
| const Trade & | get_report_trade (int i) const |
| int | closed_trade_close_cause (int i) const |
| double | max_contracts_held_all () const |
| double | max_contracts_held_long () const |
| double | max_contracts_held_short () const |
| int | eventrades () const |
| void | fill_report (ReportC *out) const |
| const std::string & | last_error () const |
| void | set_input (const std::string &key, const std::string &value) |
| void | clear_inputs () |
| void | set_trade_start_time (int64_t timestamp_ms) |
| void | set_chart_timezone (const std::string &tz) |
| const std::string & | chart_timezone () const |
| void | set_syminfo_timezone (const std::string &tz) |
| void | set_syminfo_session (const std::string &s) |
| void | set_syminfo_type (const std::string &t) |
| bool | session_template_knows_early_close () const |
| Whether TradingView's session template for this symbol carries the exchange's early closes and holidays, so a D/W/M request.security bucket completes on a shortened session's actual last chart bar (TimeframeAggregator::set_early_close_completes): exchange-listed kinds (stock, futures, index, fund, dr, ...) yes – NYSE:F's 12:45 ET half-day bar and CME's 11:45 CT early-close bar are pinned; the OTC quote streams – forex, cfd, crypto – no: their period ends at the nominal close and a session ending early completes lazily on the next period's first bar (OANDA:XAUUSD 15m, lab tv oanda pin, ledger log-20260905t034240z-30be11fe). | |
| bool | set_syminfo_string (const std::string &key, const std::string &value) |
| void | set_syminfo_mintick (double m) |
| void | set_syminfo_pointvalue (double pv) |
| virtual void | set_syminfo_metadata (const std::string &key, double value) |
| const std::string & | main_period () const |
| virtual bool | set_realtime_tail (bool on, int horizon_bars) |
| virtual bool | set_probe_suppress_tail_logic (bool on) |
| void | set_path_order (int mode) |
| uint64_t | broker_state_hash () const |
| double | position_avg_price () const |
| int64_t | position_cycle_seq () const |
| double | trail_best_price () const |
| virtual double | live_position_size () const |
| virtual int | observe_last_bar_dual_entry_path_v1 () const |
| virtual int | observe_pending_count_v1 () const |
| virtual int | observe_pending_copy_v1 (int index, pf_pending_order_v1_t *out) const |
| virtual int | observe_probe_fill_qty (int index, double fill_price, double *qty, int *close_only, int *partition) const |
| virtual int | observe_pending_level_resolved (int index) const |
| virtual int | observe_pending_effective_levels (int index, double *stop, double *limit, double *trail_activation) const |
| virtual double | observe_trail_best_price_v1 () const |
| double | live_current_equity () const |
| int64_t | script_bars_processed () const |
| void | set_broker_state_hash_recording (bool on) |
| void | set_magnifier_volume_weighted (bool on) |
| void | set_trace_enabled (bool on) |
| bool | trace_enabled () const |
| int | last_run_status () const |
| void | request_abort () |
| void | trace (const std::string &name, double value) |
| void | trace (const std::string &name, bool value) |
| void | trace (const std::string &name, int value) |
Static Public Member Functions | |
| static void | free_report (ReportC *report) |
Protected Types | |
| enum class | StreamPhase { IDLE , REALTIME , ENDED } |
| enum class | StreamInputMode { UNSET , TICKS , BARS } |
| enum class | PositionReductionCause { SCRIPT_ORDER , BRACKET_EXIT , MARGIN_CALL } |
Static Protected Attributes | |
| static constexpr double | kLevelGridBandPoints = 0.01 |
Definition at line 353 of file engine.hpp.
|
strongprotected |
| Enumerator | |
|---|---|
| IDLE | |
| REALTIME | |
| ENDED | |
Definition at line 1626 of file engine.hpp.
|
strongprotected |
| Enumerator | |
|---|---|
| UNSET | |
| TICKS | |
| BARS | |
Definition at line 1647 of file engine.hpp.
|
strongprotected |
| Enumerator | |
|---|---|
| SCRIPT_ORDER | |
| BRACKET_EXIT | |
| MARGIN_CALL | |
Definition at line 2093 of file engine.hpp.
|
explicitprotected |
|
virtual |
|
protected |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
Definition at line 505 of file engine.hpp.
References pineforge::na< double >(), and syminfo_metadata_.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
References pineforge::price.
|
inlineprotected |
Definition at line 913 of file engine.hpp.
References pineforge::price, and syminfo_mintick_.
Referenced by bar_fill_price().
|
inlineprotected |
Definition at line 970 of file engine.hpp.
References round_to_mintick().
|
inlineprotected |
Definition at line 1009 of file engine.hpp.
References pineforge::price, and syminfo_mintick_.
Referenced by broker_tick_bar().
|
inlineprotected |
Definition at line 1051 of file engine.hpp.
References syminfo_mintick_.
Referenced by level_on_price_grid().
|
inlineprotected |
Definition at line 1061 of file engine.hpp.
References kLevelGridBandPoints, and price_grid_decimals().
|
inlineprotected |
Definition at line 1080 of file engine.hpp.
References pineforge::Bar::close, pineforge::Bar::high, pineforge::Bar::low, pineforge::Bar::open, and tick_grid_price().
|
inlineprotected |
Definition at line 1103 of file engine.hpp.
References active_account_currency_fx(), pineforge::CASH_PER_CONTRACT, pineforge::CASH_PER_ORDER, commission_type_, commission_value_, pineforge::PERCENT, and syminfo_.
Referenced by open_entry_commission(), and snapshot_entry_commission().
|
inlineprotected |
Definition at line 1121 of file engine.hpp.
References calc_commission(), pineforge::PyramidEntry::entry_commission_account, pineforge::PyramidEntry::price, and pineforge::PyramidEntry::qty.
Referenced by allocated_entry_commission().
|
inlineprotected |
Definition at line 1127 of file engine.hpp.
References open_entry_commission(), and pineforge::PyramidEntry::qty.
|
inlineprotected |
Definition at line 1133 of file engine.hpp.
References calc_commission(), pineforge::PyramidEntry::entry_commission_account, pineforge::PyramidEntry::price, and pineforge::PyramidEntry::qty.
|
inlineprotected |
Definition at line 1163 of file engine.hpp.
References qty_step_.
|
inlineprotected |
Definition at line 1188 of file engine.hpp.
References qty_step_.
Referenced by apply_percent_exit_qty_step().
|
inlineprotected |
Definition at line 1203 of file engine.hpp.
References apply_exit_qty_step(), and qty_step_.
|
inlineprotected |
Definition at line 1382 of file engine.hpp.
References net_profit_sum_.
|
inlineprotected |
Definition at line 1383 of file engine.hpp.
References gross_profit_sum_.
|
inlineprotected |
Definition at line 1384 of file engine.hpp.
References gross_loss_sum_.
|
inlineprotected |
Definition at line 1385 of file engine.hpp.
References initial_capital_, and net_profit_sum_.
Referenced by live_current_equity().
|
inlineprotected |
Definition at line 1387 of file engine.hpp.
References initial_capital_, and max_runup_.
|
inlineprotected |
Definition at line 1390 of file engine.hpp.
References gross_profit_sum_, and initial_capital_.
|
inlineprotected |
Definition at line 1393 of file engine.hpp.
References gross_loss_sum_, and initial_capital_.
|
inlineprotected |
Definition at line 1396 of file engine.hpp.
References net_profit_sum_, and trades_.
|
inlineprotected |
Definition at line 1400 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1407 of file engine.hpp.
References gross_profit_sum_, and win_trades_count_.
|
inlineprotected |
Definition at line 1410 of file engine.hpp.
References gross_loss_sum_, and loss_trades_count_.
|
inlineprotected |
Definition at line 1413 of file engine.hpp.
References trades_, and win_trades_count_.
|
inlineprotected |
Definition at line 1422 of file engine.hpp.
References loss_trades_count_, and trades_.
|
inlineprotected |
Definition at line 1431 of file engine.hpp.
References pineforge::FLAT, position_entry_price_, position_qty_, position_side_, and syminfo_.
|
inlineprotected |
Definition at line 1439 of file engine.hpp.
References active_account_currency_fx(), pineforge::FLAT, pineforge::LONG, position_entry_price_, position_qty_, position_side_, and syminfo_.
Referenced by record_equity_point(), and update_equity_extremes().
|
inlineprotected |
Definition at line 1450 of file engine.hpp.
References win_trades_count_.
|
inlineprotected |
Definition at line 1451 of file engine.hpp.
References loss_trades_count_.
|
inlineprotected |
Definition at line 1479 of file engine.hpp.
References bar_time_memo_, bar_time_memo_ts_, current_bar_, pineforge::engine_script_run_v18::BacktestEngine::BarTime::dayofmonth, pineforge::engine_script_run_v18::BacktestEngine::BarTime::dayofweek, pineforge::engine_script_run_v18::BacktestEngine::BarTime::hour, pineforge::engine_script_run_v18::BacktestEngine::BarTime::minute, pineforge::engine_script_run_v18::BacktestEngine::BarTime::month, pineforge::engine_script_run_v18::BacktestEngine::BarTime::second, pineforge::engine_script_run_v18::BacktestEngine::BarTime::weekofyear, and pineforge::engine_script_run_v18::BacktestEngine::BarTime::year.
Referenced by _bar_dayofmonth(), _bar_dayofweek(), _bar_hour(), _bar_minute(), _bar_month(), _bar_second(), _bar_weekofyear(), and _bar_year().
|
inlineprotected |
Definition at line 1510 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::hour.
|
inlineprotected |
Definition at line 1511 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::minute.
|
inlineprotected |
Definition at line 1512 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::second.
|
inlineprotected |
Definition at line 1513 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::dayofmonth.
|
inlineprotected |
Definition at line 1514 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::dayofweek.
|
inlineprotected |
Definition at line 1515 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::month.
|
inlineprotected |
Definition at line 1516 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::year.
|
inlineprotected |
Definition at line 1517 of file engine.hpp.
References _decompose_bar_time(), and pineforge::engine_script_run_v18::BacktestEngine::BarTime::weekofyear.
|
protected |
|
inlineprotected |
Definition at line 1758 of file engine.hpp.
References abort_requested_.
|
protected |
|
protected |
|
protected |
References pineforge::bar_index.
|
protected |
|
inlineprotectedvirtual |
Definition at line 1811 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1813 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1814 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1815 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1823 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1824 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1825 of file engine.hpp.
|
inlineprotectedvirtual |
Definition at line 1830 of file engine.hpp.
|
inlineprotected |
Definition at line 1840 of file engine.hpp.
References max_drawdown_, max_equity_, max_runup_, and min_equity_.
Referenced by update_equity_extremes().
|
inlineprotected |
Definition at line 1853 of file engine.hpp.
References current_bar_, pineforge::FLAT, fold_equity_extreme(), initial_capital_, pineforge::LONG, max_contracts_held_all_, max_contracts_held_long_, max_contracts_held_short_, net_profit_sum_, open_profit(), position_qty_, position_side_, and pineforge::SHORT.
|
inlineprotected |
Definition at line 1871 of file engine.hpp.
References bars_in_market_, current_bar_, pf_equity_point_t::equity, equity_curve_, first_bar_open_, pineforge::FLAT, initial_capital_, net_profit_sum_, pf_equity_point_t::open_profit, open_profit(), position_side_, and pf_equity_point_t::time_ms.
|
inlineprotected |
Definition at line 1882 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1887 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1891 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1895 of file engine.hpp.
References pineforge::na< int >(), and trades_.
|
inlineprotected |
Definition at line 1899 of file engine.hpp.
References pineforge::na< int >(), and trades_.
|
inlineprotected |
Definition at line 1903 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1907 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1911 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1915 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1919 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1923 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1927 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1931 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1935 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1939 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1943 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1951 of file engine.hpp.
|
inlineprotected |
Definition at line 1957 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1961 of file engine.hpp.
|
inlineprotected |
Definition at line 1969 of file engine.hpp.
References trades_.
|
inlineprotected |
Definition at line 1973 of file engine.hpp.
References pineforge::FLAT, pineforge::LONG, position_side_, and pyramid_entries_.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
Definition at line 1993 of file engine.hpp.
References pineforge::FLAT, position_side_, and pyramid_entries_.
|
inlineprotected |
Definition at line 1998 of file engine.hpp.
References initial_capital_, and max_drawdown_.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by calc_commission(), and open_profit().
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
Referenced by aux_security_feed_enabled().
|
protectedvirtual |
|
inlineprotected |
Definition at line 2173 of file engine.hpp.
References source_aux_security_feed_enabled().
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by clear_inputs(), set_broker_state_hash_recording(), set_chart_timezone(), set_input(), set_magnifier_volume_weighted(), set_path_order(), set_syminfo_mintick(), set_syminfo_pointvalue(), set_syminfo_session(), set_syminfo_string(), set_syminfo_timezone(), set_syminfo_type(), set_trace_enabled(), and set_trade_start_time().
| int pineforge::engine_script_run_v18::BacktestEngine::execution_contract | ( | ) | const |
| bool pineforge::engine_script_run_v18::BacktestEngine::native_bound | ( | ) | const |
|
pure virtual |
Implemented in pineforge::engine_script_run_v18::NativeStrategyHost.
| void pineforge::engine_script_run_v18::BacktestEngine::run | ( | const Bar * | bars, |
| int | n ) |
| void pineforge::engine_script_run_v18::BacktestEngine::run | ( | const Bar * | input_bars, |
| int | n_input, | ||
| const std::string & | input_tf, | ||
| const std::string & | script_tf, | ||
| bool | bar_magnifier = false, | ||
| int | magnifier_samples = 4, | ||
| MagnifierDistribution | magnifier_dist = MagnifierDistribution::ENDPOINTS ) |
References pineforge::ENDPOINTS.
|
virtual |
| bool pineforge::engine_script_run_v18::BacktestEngine::set_native_security_feed | ( | const std::string & | timeframe, |
| const Bar * | bars, | ||
| int | n ) |
|
inline |
Definition at line 2277 of file engine.hpp.
References native_security_feeds_.
|
inline |
Definition at line 2282 of file engine.hpp.
References diag_native_security_substitutions_.
|
inline |
Definition at line 2285 of file engine.hpp.
References diag_native_security_misses_.
|
inline |
Definition at line 2290 of file engine.hpp.
References chart_day_partition_.
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_begin | ( | const Bar * | warmup_bars, |
| int | n_warmup, | ||
| const std::string & | input_tf, | ||
| const std::string & | script_tf = "" ) |
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_push_bar | ( | const Bar & | bar | ) |
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_push_tick | ( | const TradeTick & | tick | ) |
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_push_ticks | ( | const TradeTick * | ticks, |
| int | n ) |
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_advance_time | ( | int64_t | timestamp_ms | ) |
| bool pineforge::engine_script_run_v18::BacktestEngine::stream_end | ( | bool | finalize_partial_input_bar = false | ) |
|
inline |
Definition at line 2311 of file engine.hpp.
References REALTIME, and stream_phase_.
|
inline |
Definition at line 2312 of file engine.hpp.
References stream_order_actions_.
|
inline |
Definition at line 2313 of file engine.hpp.
References stream_order_actions_.
|
inline |
Definition at line 2316 of file engine.hpp.
References stream_order_actions_.
| uint64_t pineforge::engine_script_run_v18::BacktestEngine::stream_state_hash | ( | ) | const |
| bool pineforge::engine_script_run_v18::BacktestEngine::set_account_currency_fx_series | ( | const int64_t * | timestamps_ms, |
| const double * | rates, | ||
| int | n ) |
| void pineforge::engine_script_run_v18::BacktestEngine::run | ( | const Bar * | input_bars, |
| int | n_input, | ||
| const std::string & | input_tf, | ||
| const std::string & | script_tf, | ||
| const std::unordered_map< std::string, std::string > & | inputs, | ||
| const SymInfo & | syminfo, | ||
| const void * | overrides = nullptr, | ||
| bool | bar_magnifier = false, | ||
| int | magnifier_samples = 4, | ||
| MagnifierDistribution | magnifier_dist = MagnifierDistribution::ENDPOINTS ) |
References pineforge::ENDPOINTS.
|
inline |
Definition at line 2343 of file engine.hpp.
References trades_.
|
inline |
Definition at line 2344 of file engine.hpp.
References trades_.
|
inlinenoexcept |
Definition at line 2352 of file engine.hpp.
References trades_.
|
inline |
Definition at line 2353 of file engine.hpp.
References trades_.
|
inline |
Definition at line 2360 of file engine.hpp.
References range_end_trades_, and trades_.
|
inline |
Definition at line 2363 of file engine.hpp.
References range_end_trades_, and trades_.
| int pineforge::engine_script_run_v18::BacktestEngine::closed_trade_close_cause | ( | int | i | ) | const |
|
inline |
Definition at line 2381 of file engine.hpp.
References max_contracts_held_all_.
|
inline |
Definition at line 2382 of file engine.hpp.
References max_contracts_held_long_.
|
inline |
Definition at line 2383 of file engine.hpp.
References max_contracts_held_short_.
|
inline |
Definition at line 2386 of file engine.hpp.
References eventrades_count_.
| void pineforge::engine_script_run_v18::BacktestEngine::fill_report | ( | ReportC * | out | ) | const |
Referenced by pineforge::native_module::publish_report().
|
static |
|
inline |
Definition at line 2395 of file engine.hpp.
References last_error_.
|
inline |
Definition at line 2400 of file engine.hpp.
References guard_native_mutation(), and inputs_.
Referenced by pineforge::native_module::set_input(), and pineforge::native_module::set_override().
|
inline |
Definition at line 2404 of file engine.hpp.
References guard_native_mutation(), and inputs_.
|
inline |
Definition at line 2408 of file engine.hpp.
References guard_native_mutation(), and trade_start_time_.
|
inline |
Definition at line 2440 of file engine.hpp.
References chart_timezone_, and guard_native_mutation().
|
inline |
Definition at line 2444 of file engine.hpp.
References chart_timezone_.
|
inline |
Definition at line 2455 of file engine.hpp.
References guard_native_mutation(), and syminfo_.
|
inline |
Definition at line 2459 of file engine.hpp.
References guard_native_mutation(), and syminfo_.
|
inline |
Definition at line 2469 of file engine.hpp.
References guard_native_mutation(), and syminfo_.
| bool pineforge::engine_script_run_v18::BacktestEngine::session_template_knows_early_close | ( | ) | const |
Whether TradingView's session template for this symbol carries the exchange's early closes and holidays, so a D/W/M request.security bucket completes on a shortened session's actual last chart bar (TimeframeAggregator::set_early_close_completes): exchange-listed kinds (stock, futures, index, fund, dr, ...) yes – NYSE:F's 12:45 ET half-day bar and CME's 11:45 CT early-close bar are pinned; the OTC quote streams – forex, cfd, crypto – no: their period ends at the nominal close and a session ending early completes lazily on the next period's first bar (OANDA:XAUUSD 15m, lab tv oanda pin, ledger log-20260905t034240z-30be11fe).
syminfo.type comes from the harness (strategy_set_syminfo_type <- PINEFORGE_VERIFY_SYMTYPE); the constructor default "crypto" keeps an untyped run on the lazy rule.
|
inline |
Definition at line 2490 of file engine.hpp.
References guard_native_mutation(), and syminfo_.
|
inline |
Definition at line 2510 of file engine.hpp.
References guard_native_mutation(), syminfo_, and syminfo_mintick_.
|
inline |
Definition at line 2514 of file engine.hpp.
References guard_native_mutation(), and syminfo_.
|
virtual |
|
inline |
Definition at line 2523 of file engine.hpp.
References script_tf_.
|
virtual |
|
virtual |
|
inline |
Definition at line 2559 of file engine.hpp.
References guard_native_mutation(), and path_order_mode_.
| uint64_t pineforge::engine_script_run_v18::BacktestEngine::broker_state_hash | ( | ) | const |
|
inline |
Definition at line 2705 of file engine.hpp.
References position_entry_price_.
|
inline |
Definition at line 2706 of file engine.hpp.
References position_cycle_seq_.
|
inline |
Definition at line 2707 of file engine.hpp.
References trail_best_price_.
|
inlinevirtual |
Definition at line 2718 of file engine.hpp.
References pineforge::LONG, position_qty_, position_side_, and pineforge::SHORT.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
inline |
Definition at line 2733 of file engine.hpp.
References current_equity().
|
inline |
Definition at line 2738 of file engine.hpp.
References diag_script_bars_processed_.
|
inline |
Definition at line 2781 of file engine.hpp.
References broker_state_hash_recording_, and guard_native_mutation().
|
inline |
Definition at line 2788 of file engine.hpp.
References guard_native_mutation(), and magnifier_volume_weighted_.
Referenced by pineforge::native_module::set_magnifier_volume_weighted().
|
inline |
Definition at line 2798 of file engine.hpp.
References guard_native_mutation(), and trace_enabled_.
|
inline |
Definition at line 2802 of file engine.hpp.
References trace_enabled_.
|
inline |
Definition at line 2805 of file engine.hpp.
References last_run_status_.
|
inline |
Definition at line 2811 of file engine.hpp.
References abort_requested_.
| void pineforge::engine_script_run_v18::BacktestEngine::trace | ( | const std::string & | name, |
| double | value ) |
|
inline |
|
inline |
|
protected |
Definition at line 389 of file engine.hpp.
Referenced by live_position_size(), open_profit(), open_trade_direction(), open_trades_capital_held(), position_entry_name(), record_equity_point(), and update_equity_extremes().
|
protected |
Definition at line 390 of file engine.hpp.
Referenced by open_profit(), open_trades_capital_held(), and position_avg_price().
|
protected |
Definition at line 394 of file engine.hpp.
|
protected |
Definition at line 395 of file engine.hpp.
|
protected |
Definition at line 406 of file engine.hpp.
Referenced by live_position_size(), open_profit(), open_trades_capital_held(), and update_equity_extremes().
|
protected |
Definition at line 407 of file engine.hpp.
|
protected |
Definition at line 408 of file engine.hpp.
|
protected |
Definition at line 412 of file engine.hpp.
Referenced by position_cycle_seq().
|
protected |
Definition at line 413 of file engine.hpp.
|
protected |
Definition at line 414 of file engine.hpp.
Referenced by open_trade_direction(), and position_entry_name().
|
protected |
Definition at line 417 of file engine.hpp.
Referenced by current_equity(), grossloss_percent(), grossprofit_percent(), max_drawdown_percent(), max_runup_percent(), record_equity_point(), and update_equity_extremes().
|
protected |
Definition at line 420 of file engine.hpp.
Referenced by calc_commission().
|
protected |
Definition at line 421 of file engine.hpp.
Referenced by calc_commission().
|
protected |
Definition at line 422 of file engine.hpp.
|
protected |
Definition at line 423 of file engine.hpp.
Referenced by price_grid_decimals(), round_to_mintick(), set_syminfo_mintick(), and tick_grid_price().
|
protected |
Definition at line 429 of file engine.hpp.
Referenced by apply_exit_qty_step(), apply_percent_exit_qty_step(), and apply_qty_step().
|
protected |
Definition at line 441 of file engine.hpp.
|
protected |
Definition at line 442 of file engine.hpp.
|
protected |
Definition at line 443 of file engine.hpp.
|
protected |
Definition at line 449 of file engine.hpp.
|
protected |
Definition at line 450 of file engine.hpp.
|
protected |
Definition at line 451 of file engine.hpp.
|
protected |
Definition at line 453 of file engine.hpp.
Referenced by set_trade_start_time().
|
protected |
Definition at line 457 of file engine.hpp.
Referenced by calc_commission(), closed_trade_max_drawdown_percent(), closed_trade_max_runup_percent(), open_profit(), open_trades_capital_held(), set_syminfo_mintick(), set_syminfo_pointvalue(), set_syminfo_session(), set_syminfo_string(), set_syminfo_timezone(), and set_syminfo_type().
|
protected |
Definition at line 458 of file engine.hpp.
|
protected |
Definition at line 459 of file engine.hpp.
|
protected |
Definition at line 468 of file engine.hpp.
Referenced by set_path_order().
|
protected |
Definition at line 472 of file engine.hpp.
|
protected |
Definition at line 477 of file engine.hpp.
Referenced by chart_timezone(), and set_chart_timezone().
|
protected |
Definition at line 478 of file engine.hpp.
Referenced by clear_inputs(), and set_input().
|
protected |
Definition at line 485 of file engine.hpp.
Referenced by get_syminfo_metadata().
|
protected |
Definition at line 511 of file engine.hpp.
Referenced by _decompose_bar_time(), record_equity_point(), and update_equity_extremes().
|
protected |
Definition at line 512 of file engine.hpp.
|
protected |
Definition at line 520 of file engine.hpp.
|
protected |
Definition at line 521 of file engine.hpp.
|
protected |
Definition at line 532 of file engine.hpp.
|
protected |
Definition at line 536 of file engine.hpp.
Referenced by avg_losing_trade_percent(), avg_trade(), avg_trade_percent(), avg_winning_trade_percent(), closed_trade(), closed_trade_commission(), closed_trade_count(), closed_trade_direction(), closed_trade_entry_bar_index(), closed_trade_entry_comment(), closed_trade_entry_id(), closed_trade_entry_incarnation(), closed_trade_entry_price(), closed_trade_entry_time(), closed_trade_exit_bar_index(), closed_trade_exit_comment(), closed_trade_exit_id(), closed_trade_exit_price(), closed_trade_exit_time(), closed_trade_max_drawdown(), closed_trade_max_drawdown_percent(), closed_trade_max_runup(), closed_trade_max_runup_percent(), closed_trade_profit(), closed_trade_profit_percent(), closed_trade_size(), get_report_trade(), get_trade(), report_trade_count(), and trade_count().
|
protected |
Definition at line 542 of file engine.hpp.
Referenced by get_report_trade(), and report_trade_count().
|
protected |
Definition at line 621 of file engine.hpp.
Referenced by trail_best_price().
|
protected |
Definition at line 625 of file engine.hpp.
|
protected |
Definition at line 630 of file engine.hpp.
Referenced by avg_trade(), current_equity(), net_profit(), record_equity_point(), and update_equity_extremes().
|
protected |
Definition at line 635 of file engine.hpp.
|
protected |
Definition at line 639 of file engine.hpp.
|
protected |
Definition at line 640 of file engine.hpp.
Referenced by avg_winning_trade(), gross_profit(), and grossprofit_percent().
|
protected |
Definition at line 641 of file engine.hpp.
Referenced by avg_losing_trade(), gross_loss(), and grossloss_percent().
|
protected |
Definition at line 642 of file engine.hpp.
Referenced by avg_winning_trade(), avg_winning_trade_percent(), and count_wintrades().
|
protected |
Definition at line 643 of file engine.hpp.
Referenced by avg_losing_trade(), avg_losing_trade_percent(), and count_losstrades().
|
protected |
Definition at line 646 of file engine.hpp.
Referenced by fold_equity_extreme().
|
protected |
Definition at line 647 of file engine.hpp.
Referenced by fold_equity_extreme(), and max_drawdown_percent().
|
protected |
Definition at line 648 of file engine.hpp.
Referenced by fold_equity_extreme(), and max_runup_percent().
|
protected |
Definition at line 649 of file engine.hpp.
Referenced by fold_equity_extreme().
|
protected |
Definition at line 652 of file engine.hpp.
Referenced by record_equity_point().
|
protected |
Definition at line 653 of file engine.hpp.
Referenced by record_equity_point().
|
protected |
Definition at line 654 of file engine.hpp.
Referenced by record_equity_point().
|
protected |
Definition at line 660 of file engine.hpp.
Referenced by set_broker_state_hash_recording().
|
protected |
Definition at line 661 of file engine.hpp.
|
protected |
Definition at line 664 of file engine.hpp.
Referenced by max_contracts_held_all(), and update_equity_extremes().
|
protected |
Definition at line 665 of file engine.hpp.
Referenced by max_contracts_held_long(), and update_equity_extremes().
|
protected |
Definition at line 666 of file engine.hpp.
Referenced by max_contracts_held_short(), and update_equity_extremes().
|
protected |
Definition at line 669 of file engine.hpp.
Referenced by eventrades().
|
protected |
Definition at line 701 of file engine.hpp.
|
protected |
Definition at line 706 of file engine.hpp.
|
protected |
Definition at line 707 of file engine.hpp.
|
staticconstexprprotected |
Definition at line 1050 of file engine.hpp.
Referenced by level_on_price_grid().
|
mutableprotected |
Definition at line 1476 of file engine.hpp.
Referenced by _decompose_bar_time().
|
mutableprotected |
Definition at line 1477 of file engine.hpp.
Referenced by _decompose_bar_time().
|
protected |
Definition at line 1520 of file engine.hpp.
|
protected |
Definition at line 1521 of file engine.hpp.
|
protected |
Definition at line 1525 of file engine.hpp.
|
protected |
Definition at line 1526 of file engine.hpp.
|
protected |
Definition at line 1530 of file engine.hpp.
Referenced by set_magnifier_volume_weighted().
|
protected |
Definition at line 1584 of file engine.hpp.
|
protected |
Definition at line 1591 of file engine.hpp.
|
protected |
Definition at line 1594 of file engine.hpp.
|
protected |
Definition at line 1595 of file engine.hpp.
|
protected |
Definition at line 1596 of file engine.hpp.
|
protected |
Definition at line 1613 of file engine.hpp.
|
protected |
Definition at line 1614 of file engine.hpp.
Referenced by main_period().
|
protected |
Definition at line 1618 of file engine.hpp.
|
protected |
Definition at line 1619 of file engine.hpp.
|
protected |
Definition at line 1620 of file engine.hpp.
|
protected |
Definition at line 1627 of file engine.hpp.
Referenced by stream_is_realtime().
|
protected |
Definition at line 1628 of file engine.hpp.
|
protected |
Definition at line 1633 of file engine.hpp.
|
protected |
Definition at line 1634 of file engine.hpp.
|
protected |
Definition at line 1635 of file engine.hpp.
|
protected |
Definition at line 1636 of file engine.hpp.
|
protected |
Definition at line 1637 of file engine.hpp.
|
protected |
Definition at line 1638 of file engine.hpp.
|
protected |
Definition at line 1639 of file engine.hpp.
|
protected |
Definition at line 1640 of file engine.hpp.
|
protected |
Definition at line 1641 of file engine.hpp.
|
protected |
Definition at line 1642 of file engine.hpp.
|
protected |
Definition at line 1643 of file engine.hpp.
|
protected |
Definition at line 1644 of file engine.hpp.
|
protected |
Definition at line 1645 of file engine.hpp.
|
protected |
Definition at line 1646 of file engine.hpp.
|
protected |
Definition at line 1648 of file engine.hpp.
|
protected |
Definition at line 1649 of file engine.hpp.
|
protected |
Definition at line 1650 of file engine.hpp.
|
protected |
Definition at line 1651 of file engine.hpp.
Referenced by stream_order_action_at(), stream_order_actions_clear(), and stream_order_actions_len().
|
protected |
Definition at line 1683 of file engine.hpp.
|
protected |
Definition at line 1686 of file engine.hpp.
|
protected |
Definition at line 1699 of file engine.hpp.
Referenced by native_security_feed_enabled().
|
protected |
Definition at line 1700 of file engine.hpp.
Referenced by native_security_substitutions().
|
protected |
Definition at line 1701 of file engine.hpp.
Referenced by native_security_misses().
|
protected |
Definition at line 1709 of file engine.hpp.
Referenced by chart_day_partition_installed().
|
protected |
Definition at line 1722 of file engine.hpp.
Referenced by set_trace_enabled(), and trace_enabled().
|
protected |
Definition at line 1726 of file engine.hpp.
Referenced by last_run_status().
|
protected |
Definition at line 1756 of file engine.hpp.
Referenced by check_abort(), and request_abort().
|
protected |
Definition at line 1762 of file engine.hpp.
|
protected |
Definition at line 1763 of file engine.hpp.
|
protected |
Definition at line 1764 of file engine.hpp.
|
protected |
Definition at line 1768 of file engine.hpp.
|
protected |
Definition at line 1769 of file engine.hpp.
Referenced by script_bars_processed().
|
protected |
Definition at line 1770 of file engine.hpp.
|
protected |
Definition at line 1771 of file engine.hpp.
|
protected |
Definition at line 1772 of file engine.hpp.
|
protected |
Definition at line 1773 of file engine.hpp.
|
protected |
Definition at line 1779 of file engine.hpp.
Referenced by last_error().
|
protected |
Definition at line 2236 of file engine.hpp.