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

Owning value row for one open physical lot, copied at query time by native_open_lots(mark) — the lot-by-lot view of the same book physical_position() aggregates. More...

#include <native_host.hpp>

Data Fields

std::size_t ordinal = 0
 
std::uint64_t entry_incarnation = 0
 
std::int64_t cycle = 0
 
native_order::Side side = native_order::Side::Long
 
std::string entry_label
 
std::string entry_comment
 
std::int64_t entry_time_ms = 0
 
int entry_bar_index = -1
 
double entry_price = 0.0
 
double signed_units = 0.0
 
double entry_commission = 0.0
 
double mark = std::numeric_limits<double>::quiet_NaN()
 
double unrealized_pnl = std::numeric_limits<double>::quiet_NaN()
 
double favorable_excursion = 0.0
 
double adverse_excursion = 0.0
 

Detailed Description

Owning value row for one open physical lot, copied at query time by native_open_lots(mark) — the lot-by-lot view of the same book physical_position() aggregates.

Every field is what the book already holds; nothing is computed that the kernel does not already keep.

Identity: ordinal is the lot's position in the book (oldest first), entry_incarnation the request record whose fill opened it (never reused; 0 only for a legacy synthetic lot) and cycle the position cycle the lot belongs to (the value BindOpening / BindOpenings name).

Booking: entry_label / entry_comment are the opening request's own, entry_time_ms / entry_bar_index its fill point, entry_price the booked price, signed_units the lot's remaining units (> 0 long, < 0 short) and entry_commission the entry fee still on the lot in account currency — a partial realization takes its share with it.

Marked: unrealized_pnl is the lot's own term of native_marked_equity(mark) — the move from entry_price to mark, in account currency, less entry_commission — so the marked equity is the realized balance plus the sum of these rows. favorable_excursion / adverse_excursion are the largest moves for and against the lot the kernel has sampled along the delivered path, in account currency, with mark itself folded in; both are gross of fees and never negative. A host that owns lot excursions (owns_lot_excursions) keeps its own sampler, so for that run the kernel's two fields fold mark alone. A NaN mark keeps every booking fact, leaves unrealized_pnl NaN and folds nothing into the excursions.

Definition at line 328 of file native_host.hpp.

Field Documentation

◆ ordinal

std::size_t pineforge::engine_script_run_v18::NativeOpenLot::ordinal = 0

Definition at line 329 of file native_host.hpp.

◆ entry_incarnation

std::uint64_t pineforge::engine_script_run_v18::NativeOpenLot::entry_incarnation = 0

Definition at line 330 of file native_host.hpp.

◆ cycle

std::int64_t pineforge::engine_script_run_v18::NativeOpenLot::cycle = 0

Definition at line 331 of file native_host.hpp.

◆ side

native_order::Side pineforge::engine_script_run_v18::NativeOpenLot::side = native_order::Side::Long

Definition at line 332 of file native_host.hpp.

◆ entry_label

std::string pineforge::engine_script_run_v18::NativeOpenLot::entry_label

Definition at line 333 of file native_host.hpp.

◆ entry_comment

std::string pineforge::engine_script_run_v18::NativeOpenLot::entry_comment

Definition at line 334 of file native_host.hpp.

◆ entry_time_ms

std::int64_t pineforge::engine_script_run_v18::NativeOpenLot::entry_time_ms = 0

Definition at line 335 of file native_host.hpp.

◆ entry_bar_index

int pineforge::engine_script_run_v18::NativeOpenLot::entry_bar_index = -1

Definition at line 336 of file native_host.hpp.

◆ entry_price

double pineforge::engine_script_run_v18::NativeOpenLot::entry_price = 0.0

Definition at line 337 of file native_host.hpp.

◆ signed_units

double pineforge::engine_script_run_v18::NativeOpenLot::signed_units = 0.0

Definition at line 338 of file native_host.hpp.

◆ entry_commission

double pineforge::engine_script_run_v18::NativeOpenLot::entry_commission = 0.0

Definition at line 339 of file native_host.hpp.

◆ mark

double pineforge::engine_script_run_v18::NativeOpenLot::mark = std::numeric_limits<double>::quiet_NaN()

Definition at line 340 of file native_host.hpp.

◆ unrealized_pnl

double pineforge::engine_script_run_v18::NativeOpenLot::unrealized_pnl = std::numeric_limits<double>::quiet_NaN()

Definition at line 341 of file native_host.hpp.

◆ favorable_excursion

double pineforge::engine_script_run_v18::NativeOpenLot::favorable_excursion = 0.0

Definition at line 342 of file native_host.hpp.

◆ adverse_excursion

double pineforge::engine_script_run_v18::NativeOpenLot::adverse_excursion = 0.0

Definition at line 343 of file native_host.hpp.


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