|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
#include <trade_ledger.hpp>
Data Structures | |
| struct | CacheStats |
| class | const_iterator |
Public Types | |
| enum class | CacheBypassReason : std::uint32_t { none , allocation_failed } |
| using | size_type = std::size_t |
| using | value_type = Trade |
| using | Visitor = std::function<bool(size_type, const Trade&)> |
| using | iterator = const_iterator |
Public Member Functions | |
| TradeLedger () | |
| TradeLedger (size_type cache_rows) | |
| TradeLedger (CacheCapacity capacity) | |
| ~TradeLedger () | |
| TradeLedger (const TradeLedger &) | |
| TradeLedger & | operator= (const TradeLedger &) |
| TradeLedger (TradeLedger &&) | |
| TradeLedger & | operator= (TradeLedger &&) |
| void | set_scratch_directory (const std::string &) |
| const std::string & | scratch_directory () const |
| void | set_cache_rows (size_type rows) |
| void | set_cache_capacity (CacheCapacity capacity) |
| size_type | cache_rows () const |
| size_type | cache_resident_bytes () const |
| bool | cache_allocation_failed () const noexcept |
| CacheStats | read_cache_stats () const noexcept |
| size_type | cache_size () const |
| void | clear () |
| void | reserve (size_type) |
| size_type | size () const |
| size_type | base () const |
| size_type | resident_size () const |
| size_type | resident_base () const |
| bool | empty () const |
| Trade | read (size_type global) const |
| Trade | operator[] (size_type global) const |
| Trade | at (size_type global) const |
| Trade | back () const |
| Trade | numeric_at (size_type global) const |
| std::string | entry_id_at (size_type global) const |
| double | pnl_at (size_type global) const |
| double | pnl_pct_at (size_type global) const |
| double | commission_at (size_type global) const |
| std::int32_t | entry_bar_index_at (size_type global) const |
| std::int32_t | exit_bar_index_at (size_type global) const |
| std::uint64_t | entry_incarnation_at (size_type global) const |
| double | entry_price_at (size_type global) const |
| double | exit_price_at (size_type global) const |
| std::int64_t | entry_time_at (size_type global) const |
| std::int64_t | exit_time_at (size_type global) const |
| double | qty_at (size_type global) const |
| double | max_runup_at (size_type global) const |
| double | max_drawdown_at (size_type global) const |
| bool | is_long_at (size_type global) const |
| std::string | entry_comment_at (size_type global) const |
| std::string | exit_comment_at (size_type global) const |
| std::string | exit_id_at (size_type global) const |
| bool | entry_id_equals (size_type global, std::string_view rhs) const |
| bool | exit_id_equals (size_type global, std::string_view rhs) const |
| bool | entry_comment_equals (size_type global, std::string_view rhs) const |
| bool | exit_comment_equals (size_type global, std::string_view rhs) const |
| void | replace (size_type global, const Trade &) |
| void | modify (size_type global, const std::function< void(Trade &)> &) |
| void | push_back (const Trade &trade) |
| Append at the logical global end (3.4:613-616). | |
| void | push_back (Trade &&trade) |
| void | resize (size_type global_end) |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | visit (size_type first, size_type end, const Visitor &) const |
| bool | previous (size_type &cursor, Trade &value) const |
| const Trade & | materialize (size_type global) const |
| void | seal (size_type global_end) |
| bool | entry_id_matches (int index, std::string_view rhs) const |
| bool | exit_id_matches (int index, std::string_view rhs) const |
| bool | entry_comment_matches (int index, std::string_view rhs) const |
| bool | exit_comment_matches (int index, std::string_view rhs) const |
Static Public Member Functions | |
| static constexpr size_type | cache_capacity_bytes (size_type rows) noexcept |
| static size_type | cache_rows_for_capacity (CacheCapacity capacity) noexcept |
| static size_type | resident_cache_bytes (size_type rows) |
Static Public Attributes | |
| static constexpr size_type | kRecordBytes = 168 |
| static constexpr size_type | kResidentRows = 64 |
| static constexpr size_type | kCacheStringBytes = 128 |
| static constexpr size_type | kLedgerEntryBytes |
| static constexpr size_type | kCachePageSlots = 256 |
| static constexpr size_type | kDefaultCacheRows = 65536 |
| static constexpr size_type | kMaxCacheRows = 1048576 |
| static constexpr size_type | kSinkCacheRows = kDefaultCacheRows |
Definition at line 34 of file trade_ledger.hpp.
| using pineforge::engine_script_run_v19::TradeLedger::size_type = std::size_t |
Definition at line 36 of file trade_ledger.hpp.
Definition at line 37 of file trade_ledger.hpp.
| using pineforge::engine_script_run_v19::TradeLedger::Visitor = std::function<bool(size_type, const Trade&)> |
Definition at line 66 of file trade_ledger.hpp.
Definition at line 90 of file trade_ledger.hpp.
|
strong |
| Enumerator | |
|---|---|
| none | |
| allocation_failed | |
Definition at line 133 of file trade_ledger.hpp.
| pineforge::engine_script_run_v19::TradeLedger::TradeLedger | ( | ) |
Referenced by operator=(), operator=(), TradeLedger(), and TradeLedger().
|
explicit |
References cache_rows().
|
explicit |
| pineforge::engine_script_run_v19::TradeLedger::~TradeLedger | ( | ) |
| pineforge::engine_script_run_v19::TradeLedger::TradeLedger | ( | const TradeLedger & | ) |
References TradeLedger().
| pineforge::engine_script_run_v19::TradeLedger::TradeLedger | ( | TradeLedger && | ) |
References TradeLedger().
|
inlinestaticconstexprnoexcept |
Definition at line 56 of file trade_ledger.hpp.
References kCachePageSlots, and kLedgerEntryBytes.
|
staticnoexcept |
| TradeLedger & pineforge::engine_script_run_v19::TradeLedger::operator= | ( | const TradeLedger & | ) |
References TradeLedger().
| TradeLedger & pineforge::engine_script_run_v19::TradeLedger::operator= | ( | TradeLedger && | ) |
References TradeLedger().
| void pineforge::engine_script_run_v19::TradeLedger::set_scratch_directory | ( | const std::string & | ) |
| const std::string & pineforge::engine_script_run_v19::TradeLedger::scratch_directory | ( | ) | const |
| void pineforge::engine_script_run_v19::TradeLedger::set_cache_rows | ( | size_type | rows | ) |
| void pineforge::engine_script_run_v19::TradeLedger::set_cache_capacity | ( | CacheCapacity | capacity | ) |
| size_type pineforge::engine_script_run_v19::TradeLedger::cache_rows | ( | ) | const |
Referenced by TradeLedger().
|
static |
| size_type pineforge::engine_script_run_v19::TradeLedger::cache_resident_bytes | ( | ) | const |
|
noexcept |
|
noexcept |
References read_cache_stats().
Referenced by read_cache_stats().
| size_type pineforge::engine_script_run_v19::TradeLedger::cache_size | ( | ) | const |
References cache_size().
Referenced by cache_size().
| void pineforge::engine_script_run_v19::TradeLedger::clear | ( | ) |
| void pineforge::engine_script_run_v19::TradeLedger::reserve | ( | size_type | ) |
| size_type pineforge::engine_script_run_v19::TradeLedger::size | ( | ) | const |
References size().
Referenced by pineforge::same_bar_exit_group_possible(), and size().
| size_type pineforge::engine_script_run_v19::TradeLedger::base | ( | ) | const |
| size_type pineforge::engine_script_run_v19::TradeLedger::resident_size | ( | ) | const |
References resident_size().
Referenced by resident_size().
| size_type pineforge::engine_script_run_v19::TradeLedger::resident_base | ( | ) | const |
References resident_base().
Referenced by resident_base().
| bool pineforge::engine_script_run_v19::TradeLedger::empty | ( | ) | const |
| Trade pineforge::engine_script_run_v19::TradeLedger::back | ( | ) | const |
References numeric_at().
Referenced by numeric_at(), and pineforge::same_bar_exit_group_possible().
| std::string pineforge::engine_script_run_v19::TradeLedger::entry_id_at | ( | size_type | global | ) | const |
References entry_id_at().
Referenced by entry_id_at(), and pineforge::same_bar_exit_group_possible().
| double pineforge::engine_script_run_v19::TradeLedger::pnl_at | ( | size_type | global | ) | const |
| double pineforge::engine_script_run_v19::TradeLedger::pnl_pct_at | ( | size_type | global | ) | const |
References pnl_pct_at().
Referenced by pnl_pct_at().
| double pineforge::engine_script_run_v19::TradeLedger::commission_at | ( | size_type | global | ) | const |
References commission_at().
Referenced by commission_at().
| std::int32_t pineforge::engine_script_run_v19::TradeLedger::entry_bar_index_at | ( | size_type | global | ) | const |
References entry_bar_index_at().
Referenced by entry_bar_index_at().
| std::int32_t pineforge::engine_script_run_v19::TradeLedger::exit_bar_index_at | ( | size_type | global | ) | const |
References exit_bar_index_at().
Referenced by exit_bar_index_at().
| std::uint64_t pineforge::engine_script_run_v19::TradeLedger::entry_incarnation_at | ( | size_type | global | ) | const |
References entry_incarnation_at().
Referenced by entry_incarnation_at().
| double pineforge::engine_script_run_v19::TradeLedger::entry_price_at | ( | size_type | global | ) | const |
References entry_price_at().
Referenced by entry_price_at().
| double pineforge::engine_script_run_v19::TradeLedger::exit_price_at | ( | size_type | global | ) | const |
References exit_price_at().
Referenced by exit_price_at().
| std::int64_t pineforge::engine_script_run_v19::TradeLedger::entry_time_at | ( | size_type | global | ) | const |
References entry_time_at().
Referenced by entry_time_at().
| std::int64_t pineforge::engine_script_run_v19::TradeLedger::exit_time_at | ( | size_type | global | ) | const |
References exit_time_at().
Referenced by exit_time_at().
| double pineforge::engine_script_run_v19::TradeLedger::qty_at | ( | size_type | global | ) | const |
| double pineforge::engine_script_run_v19::TradeLedger::max_runup_at | ( | size_type | global | ) | const |
References max_runup_at().
Referenced by max_runup_at().
| double pineforge::engine_script_run_v19::TradeLedger::max_drawdown_at | ( | size_type | global | ) | const |
References max_drawdown_at().
Referenced by max_drawdown_at().
| bool pineforge::engine_script_run_v19::TradeLedger::is_long_at | ( | size_type | global | ) | const |
References is_long_at().
Referenced by is_long_at().
| std::string pineforge::engine_script_run_v19::TradeLedger::entry_comment_at | ( | size_type | global | ) | const |
References entry_comment_at().
Referenced by entry_comment_at().
| std::string pineforge::engine_script_run_v19::TradeLedger::exit_comment_at | ( | size_type | global | ) | const |
References exit_comment_at().
Referenced by exit_comment_at().
| std::string pineforge::engine_script_run_v19::TradeLedger::exit_id_at | ( | size_type | global | ) | const |
References exit_id_at().
Referenced by exit_id_at().
| bool pineforge::engine_script_run_v19::TradeLedger::entry_id_equals | ( | size_type | global, |
| std::string_view | rhs ) const |
References entry_id_equals().
Referenced by entry_id_equals().
| bool pineforge::engine_script_run_v19::TradeLedger::exit_id_equals | ( | size_type | global, |
| std::string_view | rhs ) const |
References exit_id_equals().
Referenced by exit_id_equals().
| bool pineforge::engine_script_run_v19::TradeLedger::entry_comment_equals | ( | size_type | global, |
| std::string_view | rhs ) const |
References entry_comment_equals().
Referenced by entry_comment_equals().
| bool pineforge::engine_script_run_v19::TradeLedger::exit_comment_equals | ( | size_type | global, |
| std::string_view | rhs ) const |
References exit_comment_equals().
Referenced by exit_comment_equals().
| void pineforge::engine_script_run_v19::TradeLedger::push_back | ( | const Trade & | trade | ) |
Append at the logical global end (3.4:613-616).
References push_back().
Referenced by push_back(), and push_back().
| void pineforge::engine_script_run_v19::TradeLedger::push_back | ( | Trade && | trade | ) |
References push_back().
| void pineforge::engine_script_run_v19::TradeLedger::resize | ( | size_type | global_end | ) |
| const_iterator pineforge::engine_script_run_v19::TradeLedger::begin | ( | ) | const |
| const_iterator pineforge::engine_script_run_v19::TradeLedger::end | ( | ) | const |
| bool pineforge::engine_script_run_v19::TradeLedger::previous | ( | size_type & | cursor, |
| Trade & | value ) const |
References previous().
Referenced by previous().
References materialize().
Referenced by materialize().
| void pineforge::engine_script_run_v19::TradeLedger::seal | ( | size_type | global_end | ) |
| bool pineforge::engine_script_run_v19::TradeLedger::entry_id_matches | ( | int | index, |
| std::string_view | rhs ) const |
References entry_id_matches().
Referenced by entry_id_matches().
| bool pineforge::engine_script_run_v19::TradeLedger::exit_id_matches | ( | int | index, |
| std::string_view | rhs ) const |
References exit_id_matches().
Referenced by exit_id_matches().
| bool pineforge::engine_script_run_v19::TradeLedger::entry_comment_matches | ( | int | index, |
| std::string_view | rhs ) const |
References entry_comment_matches().
Referenced by entry_comment_matches().
| bool pineforge::engine_script_run_v19::TradeLedger::exit_comment_matches | ( | int | index, |
| std::string_view | rhs ) const |
References exit_comment_matches().
Referenced by exit_comment_matches().
|
staticconstexpr |
Definition at line 41 of file trade_ledger.hpp.
|
staticconstexpr |
Definition at line 42 of file trade_ledger.hpp.
|
staticconstexpr |
Definition at line 50 of file trade_ledger.hpp.
|
staticconstexpr |
Definition at line 51 of file trade_ledger.hpp.
Referenced by cache_capacity_bytes().
|
staticconstexpr |
Definition at line 53 of file trade_ledger.hpp.
Referenced by cache_capacity_bytes().
|
staticconstexpr |
Definition at line 54 of file trade_ledger.hpp.
|
staticconstexpr |
Definition at line 55 of file trade_ledger.hpp.
|
staticconstexpr |
Definition at line 65 of file trade_ledger.hpp.