PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pf_native_event_v1 Struct 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 NativePriceProvenance.
 
uint8_t path_phase
 Cursor NativePathPhase.
 
uint8_t terminal
 APPLIED only.
 
uint8_t reserved0 [3]
 

Detailed Description

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.

  • ACCEPTED / ARMED / CLOSE_BOUND / QUANTITY_BOUND: incarnation.
  • REJECTED / REPLACE_REJECTED: reason is a RequestRejectReason.
  • REPLACED: incarnation is the predecessor, successor the new handle.
  • CANCELLED: reason is a CancelReason.
  • MATCH_REJECTED: reason is a MatchRejectReason, cursor fields set.
  • APPLIED: every price/unit/cycle field, terminal, cursor fields.
  • MARGIN_CALL: price = mark, closed_units = liquidated units, raw_price = the re-solved liquidation price.
  • ACTIVATED: reason is an ActivationKind, price the reached price.
  • DRIVER_POINT: cursor fields and raw_price.
  • ACCOUNT: price = marked equity, raw_price = realized balance, opened_units = signed position units.
  • RISK: 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 733 of file native_c_api.h.

Field Documentation

◆ struct_size

uint32_t pf_native_event_v1::struct_size

sizeof(pf_native_event_v1).

Definition at line 734 of file native_c_api.h.

◆ version

uint32_t pf_native_event_v1::version

PF_NATIVE_API_VERSION.

Definition at line 735 of file native_c_api.h.

◆ kind

uint32_t pf_native_event_v1::kind

pf_native_event_kind_t.

Definition at line 736 of file native_c_api.h.

◆ reason

uint32_t pf_native_event_v1::reason

Per-kind reason enumerator, 0 when none.

Definition at line 737 of file native_c_api.h.

◆ ordinal

uint64_t pf_native_event_v1::ordinal

Event ordinal; strictly increasing.

Definition at line 738 of file native_c_api.h.

◆ incarnation

uint64_t pf_native_event_v1::incarnation

Subject request, 0 when the kind has none.

Definition at line 739 of file native_c_api.h.

◆ successor

uint64_t pf_native_event_v1::successor

REPLACED: the new handle.

RISK: the cursor's matching-point ordinal. 0 otherwise.

Definition at line 740 of file native_c_api.h.

◆ raw_price

double pf_native_event_v1::raw_price

Definition at line 742 of file native_c_api.h.

◆ resolved_price

double pf_native_event_v1::resolved_price

Definition at line 743 of file native_c_api.h.

Referenced by run_mode().

◆ price

double pf_native_event_v1::price

Definition at line 744 of file native_c_api.h.

◆ closed_units

double pf_native_event_v1::closed_units

Definition at line 745 of file native_c_api.h.

◆ opened_units

double pf_native_event_v1::opened_units

Definition at line 746 of file native_c_api.h.

◆ cycle_before

int64_t pf_native_event_v1::cycle_before

Definition at line 747 of file native_c_api.h.

◆ cycle_after

int64_t pf_native_event_v1::cycle_after

Definition at line 748 of file native_c_api.h.

◆ effective_time_ms

int64_t pf_native_event_v1::effective_time_ms

Cursor effective time, 0 when the kind has no cursor.

Definition at line 749 of file native_c_api.h.

◆ interval_index

int32_t pf_native_event_v1::interval_index

Cursor interval index.

Definition at line 750 of file native_c_api.h.

◆ provenance

uint8_t pf_native_event_v1::provenance

Cursor NativePriceProvenance.

Definition at line 751 of file native_c_api.h.

◆ path_phase

uint8_t pf_native_event_v1::path_phase

Cursor NativePathPhase.

Definition at line 752 of file native_c_api.h.

◆ terminal

uint8_t pf_native_event_v1::terminal

APPLIED only.

Definition at line 753 of file native_c_api.h.

◆ reserved0

uint8_t pf_native_event_v1::reserved0[3]

Definition at line 754 of file native_c_api.h.


The documentation for this struct was generated from the following file: