|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
One recorded event, read back by strategy_native_events_v1. More...
#include <native_c_api.h>
Data Fields | |
| uint32_t | struct_size |
| sizeof(pf_native_event_v1). | |
| uint32_t | version |
| PF_NATIVE_API_VERSION. | |
| uint32_t | kind |
| pf_native_event_kind_t. | |
| uint32_t | reason |
| Per-kind reason enumerator, 0 when none. | |
| uint64_t | ordinal |
| Event ordinal; strictly increasing. | |
| uint64_t | incarnation |
| Subject request, 0 when the kind has none. | |
| uint64_t | successor |
| REPLACED: the new handle. | |
| double | raw_price |
| double | resolved_price |
| double | price |
| double | closed_units |
| double | opened_units |
| int64_t | cycle_before |
| int64_t | cycle_after |
| int64_t | effective_time_ms |
| Cursor effective time, 0 when the kind has no cursor. | |
| int32_t | interval_index |
| Cursor interval index. | |
| uint8_t | provenance |
| Cursor pf_native_price_provenance_t. | |
| uint8_t | path_phase |
| Cursor pf_native_path_phase_t. | |
| uint8_t | terminal |
| APPLIED only. | |
| uint8_t | reserved0 [3] |
One recorded event, read back by strategy_native_events_v1.
kind tags the union: every field below is documented per kind and is zero where that kind has no such fact. reason is read by the kind's own enumeration, and is 0 for a kind that names none.
incarnation.reason is a pf_native_reject_reason_t.incarnation is the target, reason a pf_native_reject_reason_t.incarnation is the predecessor, successor the new handle.reason is a pf_native_cancel_reason_t.incarnation is the target.incarnation, cursor fields.reason is a pf_native_match_reject_t, cursor fields.terminal, cursor fields; when terminal is 1, reason is the pf_native_terminal_reason_t that finished the request.reason is the pf_native_side_t of the book the close bound to, cycle_after its cycle, cursor fields.incarnation is the recipient, reason its pf_native_group_effect_t, closed_units the deduction (applied, or deferred); 0 when it was absorbed – too small to move the recipient's remaining units, or its pending total, in binary64, which stay as they were (R5 lane K-ULP5).incarnation, opened_units = the source units.raw_price, resolved_price (= price), cursor fields.reason is the pf_native_side_t of the liquidated position, price = mark, closed_units = liquidated units, opened_units = the signed position after it, raw_price = the re-solved liquidation price. The call's equity, requirement and the position before it are strategy_native_margin_call_v1's.reason is a pf_native_activation_t, price the reached price.raw_price.price = marked equity, raw_price = realized balance, opened_units = signed position units.reason is a pf_native_risk_limit_t, price = the observed value that reached the limit, raw_price = the limit it was measured against (account currency for the two loss limits — a percent limit is already resolved against its basis equity — days or fills for the two counts), cycle_before = the risk day the breach happened on, on the spec's own day basis, successor = the cursor's matching-point ordinal, cursor fields set. The event names no request: it is an account fact, so incarnation stays 0. Definition at line 1633 of file native_c_api.h.
| uint32_t pf_native_event_v1::struct_size |
sizeof(pf_native_event_v1).
Definition at line 1634 of file native_c_api.h.
| uint32_t pf_native_event_v1::version |
PF_NATIVE_API_VERSION.
Definition at line 1635 of file native_c_api.h.
| uint32_t pf_native_event_v1::kind |
Definition at line 1636 of file native_c_api.h.
| uint32_t pf_native_event_v1::reason |
Per-kind reason enumerator, 0 when none.
Definition at line 1637 of file native_c_api.h.
| uint64_t pf_native_event_v1::ordinal |
Event ordinal; strictly increasing.
Definition at line 1638 of file native_c_api.h.
| uint64_t pf_native_event_v1::incarnation |
Subject request, 0 when the kind has none.
Definition at line 1639 of file native_c_api.h.
| uint64_t pf_native_event_v1::successor |
REPLACED: the new handle.
RISK: the cursor's matching-point ordinal. 0 otherwise.
Definition at line 1640 of file native_c_api.h.
| double pf_native_event_v1::raw_price |
Definition at line 1642 of file native_c_api.h.
| double pf_native_event_v1::resolved_price |
Definition at line 1643 of file native_c_api.h.
Referenced by run_mode().
| double pf_native_event_v1::price |
Definition at line 1644 of file native_c_api.h.
| double pf_native_event_v1::closed_units |
Definition at line 1645 of file native_c_api.h.
| double pf_native_event_v1::opened_units |
Definition at line 1646 of file native_c_api.h.
| int64_t pf_native_event_v1::cycle_before |
Definition at line 1647 of file native_c_api.h.
| int64_t pf_native_event_v1::cycle_after |
Definition at line 1648 of file native_c_api.h.
| int64_t pf_native_event_v1::effective_time_ms |
Cursor effective time, 0 when the kind has no cursor.
Definition at line 1649 of file native_c_api.h.
| int32_t pf_native_event_v1::interval_index |
Cursor interval index.
Definition at line 1650 of file native_c_api.h.
| uint8_t pf_native_event_v1::provenance |
Cursor pf_native_price_provenance_t.
Definition at line 1651 of file native_c_api.h.
| uint8_t pf_native_event_v1::path_phase |
Cursor pf_native_path_phase_t.
Definition at line 1652 of file native_c_api.h.
| uint8_t pf_native_event_v1::terminal |
APPLIED only.
Definition at line 1653 of file native_c_api.h.
| uint8_t pf_native_event_v1::reserved0[3] |
Definition at line 1654 of file native_c_api.h.