PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pf_native_open_lot_v1 Struct Reference

One open physical lot, copied out by strategy_native_open_lot_get_v1 — the C spelling of NativeOpenLot (R5 gap lane N18): the book that strategy_native_position_v1 aggregates, lot by lot, marked at the price strategy_native_open_lot_count_v1 was given. More...

#include <native_c_api.h>

Data Fields

uint32_t struct_size
 sizeof(pf_native_open_lot_v1).
 
uint32_t version
 PF_NATIVE_API_VERSION.
 
uint64_t ordinal
 Position in the book, oldest first.
 
uint64_t entry_incarnation
 The request whose fill opened the lot; never reused; 0 only for a legacy synthetic lot.
 
int64_t cycle
 The position cycle the lot belongs to — the owner_cycle a BIND_OPENING(S) request names.
 
uint32_t side
 pf_native_side_t.
 
int32_t entry_bar_index
 Script-bar index of the opening fill.
 
int64_t entry_time_ms
 Effective time of the opening fill.
 
double entry_price
 Booked entry price.
 
double signed_units
 Remaining units: > 0 long, < 0 short.
 
double entry_commission
 Entry fee still on the lot, account currency; a partial realization takes its share with it.
 
double mark
 The price the three fields below were marked at.
 
double unrealized_pnl
 Fee-net move to mark, account currency; NaN for a NaN mark.
 
double favorable_excursion
 Largest move for the lot so far, account currency, >= 0.
 
double adverse_excursion
 Largest move against the lot so far, account currency, >= 0.
 
const char * entry_label
 Borrowed; see the struct note.
 
const char * entry_comment
 Borrowed; see the struct note.
 

Detailed Description

One open physical lot, copied out by strategy_native_open_lot_get_v1 — the C spelling of NativeOpenLot (R5 gap lane N18): the book that strategy_native_position_v1 aggregates, lot by lot, marked at the price strategy_native_open_lot_count_v1 was given.

Every field is what the kernel already holds for the lot; reading it moves nothing.

unrealized_pnl is the lot's own term of the marked equity: the move from entry_price to mark, in account currency, less entry_commission. The two excursions are the largest moves for and against the lot the kernel has sampled along the delivered path, in account currency, gross of fees, with mark folded in. A NaN mark keeps every booking fact, leaves unrealized_pnl NaN and folds nothing into the excursions.

entry_label and entry_comment borrow the snapshot taken by the most recent strategy_native_open_lot_count_v1 call on this handle. They stay valid until the next call to that function, or until the host is freed; copy them if the host keeps them longer.

Definition at line 807 of file native_c_api.h.

Field Documentation

◆ struct_size

uint32_t pf_native_open_lot_v1::struct_size

sizeof(pf_native_open_lot_v1).

Definition at line 808 of file native_c_api.h.

◆ version

uint32_t pf_native_open_lot_v1::version

PF_NATIVE_API_VERSION.

Definition at line 809 of file native_c_api.h.

◆ ordinal

uint64_t pf_native_open_lot_v1::ordinal

Position in the book, oldest first.

Definition at line 810 of file native_c_api.h.

◆ entry_incarnation

uint64_t pf_native_open_lot_v1::entry_incarnation

The request whose fill opened the lot; never reused; 0 only for a legacy synthetic lot.

Definition at line 811 of file native_c_api.h.

◆ cycle

int64_t pf_native_open_lot_v1::cycle

The position cycle the lot belongs to — the owner_cycle a BIND_OPENING(S) request names.

Definition at line 813 of file native_c_api.h.

◆ side

uint32_t pf_native_open_lot_v1::side

pf_native_side_t.

Definition at line 815 of file native_c_api.h.

◆ entry_bar_index

int32_t pf_native_open_lot_v1::entry_bar_index

Script-bar index of the opening fill.

Definition at line 816 of file native_c_api.h.

◆ entry_time_ms

int64_t pf_native_open_lot_v1::entry_time_ms

Effective time of the opening fill.

Definition at line 817 of file native_c_api.h.

◆ entry_price

double pf_native_open_lot_v1::entry_price

Booked entry price.

Definition at line 818 of file native_c_api.h.

◆ signed_units

double pf_native_open_lot_v1::signed_units

Remaining units: > 0 long, < 0 short.

Definition at line 819 of file native_c_api.h.

◆ entry_commission

double pf_native_open_lot_v1::entry_commission

Entry fee still on the lot, account currency; a partial realization takes its share with it.

Definition at line 820 of file native_c_api.h.

◆ mark

double pf_native_open_lot_v1::mark

The price the three fields below were marked at.

Definition at line 822 of file native_c_api.h.

◆ unrealized_pnl

double pf_native_open_lot_v1::unrealized_pnl

Fee-net move to mark, account currency; NaN for a NaN mark.

Definition at line 823 of file native_c_api.h.

◆ favorable_excursion

double pf_native_open_lot_v1::favorable_excursion

Largest move for the lot so far, account currency, >= 0.

Definition at line 824 of file native_c_api.h.

◆ adverse_excursion

double pf_native_open_lot_v1::adverse_excursion

Largest move against the lot so far, account currency, >= 0.

Definition at line 825 of file native_c_api.h.

◆ entry_label

const char* pf_native_open_lot_v1::entry_label

Borrowed; see the struct note.

Definition at line 826 of file native_c_api.h.

◆ entry_comment

const char* pf_native_open_lot_v1::entry_comment

Borrowed; see the struct note.

Definition at line 827 of file native_c_api.h.


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