PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::native_order::native_order_v6 Namespace Reference

Data Structures

struct  Absolute
 Where a request's trigger level comes from. More...
 
struct  AcceptedEvent
 One request was accepted: the definition, and the timeline ordinal it was accepted at. More...
 
struct  ActivatedEvent
 
struct  ActivateStop
 
struct  ActivateStopLimit
 
struct  ActivateTrail
 
struct  ActivationGrid
 What the consumer hands to prepare_trigger under an opted-in price grid (NativeRunSpec::price_grid == QuantizeFillsAndTriggers), the way acceptance receives CommandContext::price_tick: the tick ladder and the rounding the matcher tested the activation on. More...
 
struct  AllowanceAllScope
 
struct  AllowanceDeferred
 
struct  AllowanceUnits
 
struct  AllowanceUnset
 
struct  ArmContext
 What the consumer hands to prepare_owner_applied for an anchored leg's materialization, the way acceptance receives CommandContext::price_tick. More...
 
struct  ArmedEvent
 An anchored leg was materialized, exactly once: fill + offset, then the rounding, then resolve_anchored_level, then the representability check, and the resulting level written into the leg's trigger with its anchor becoming Absolute. More...
 
struct  ArmedTransaction
 
struct  BeginTrailTracking
 
struct  BindCohort
 Bind to a host-built roster (cohort_open / cohort_add / cohort_remove), read at the match rather than frozen at submit. More...
 
struct  BindOpening
 Bind to ONE already-live opening, by its handle and the positive cycle it is live in. More...
 
struct  BindOpenings
 Bind to a fixed cohort of already-live openings. More...
 
struct  BookClose
 The authority an armed leg acquires under NativeArmScope::Book: the whole position its owner's fill left, on this cycle and side, bound at the fill's cursor. More...
 
struct  BookTransaction
 
struct  CancelledEvent
 
struct  CancelResult
 
struct  CashValue
 Native sizing bases (L3). More...
 
struct  CloseBoundEvent
 
struct  CohortClose
 
struct  CohortHandle
 A host-maintained, run-scoped roster identity. More...
 
struct  CohortReceipt
 
struct  CohortRoster
 
struct  CommandContext
 What acceptance needs from the run to judge a command: the point's ordinal and coordinate, the price tick the tick spellings resolve against, the quantity grid, and the live book. More...
 
struct  CommandInstalled
 
struct  CommittedExecutionFacts
 
struct  DeferredGroupAdjustmentEvent
 
struct  EligibilityFacts
 
struct  EnrollmentFromApplied
 
struct  EnrollmentFromCommand
 
struct  EquityFraction
 A fraction in (0, 1] of MARKED equity at the sizing point. More...
 
struct  EvaluationContext
 
struct  EventId
 
struct  EventRange
 
struct  ExecutionAppliedEvent
 One committed execution: the definition, the cursor, the resolved price and units, the scope it acted on, the committed closed-row range, the cycle on either side, and the ticket it booked under. More...
 
struct  ExecutionProposal
 
struct  ExecutionTerms
 
struct  ExplicitUnits
 A reduction of exactly these units, finite and positive. More...
 
struct  FromOwnerFill
 Defer a level to the owner's fill: at the arm the level becomes fill + offset, with offset signed (adverse is negative) and spelled in price ticks when ticks is set, then rounded by rounding. More...
 
struct  HostSized
 An opening or a closing whose quantity the HOST resolves, in NativeStrategyHost::resolve_execution_terms. More...
 
struct  ImmediateRemaining
 Take whatever the point allows, with no per-point cap. More...
 
struct  Independent
 No owner: the request stands on its own book authority. More...
 
class  InlineCommandEvents
 Almost every prepared command yields one history event. More...
 
struct  Installed
 
struct  InvalidHandleEvent
 
struct  Limit
 fill_through makes the limit a touch trigger (market-if-touched): the level still gates when the request becomes executable, but its fill is not bounded by the level, so slippage may carry it past the level. More...
 
struct  LimitReady
 
struct  LiveRequest
 
struct  MarginCallEvent
 A kernel-issued liquidation that actually filled. More...
 
struct  Market
 Match at the next eligible matching point, with no level to reach. More...
 
struct  MarketReady
 
struct  MatchCursor
 
struct  MatchRejectedEvent
 A candidate the run refused, with its MatchRejectReason and the cursor it was refused at. More...
 
struct  Member
 
struct  NativeRiskEvent
 One generic risk limit breaching (L9). More...
 
struct  NoChange
 
struct  NoEffectEvent
 A reduction or a flatten that had nothing to close: terminal, with no execution identity, no fill, no fee and no physical action. More...
 
struct  NoGroup
 
struct  NoTarget
 A dynamic cohort has no currently live member. More...
 
struct  NotWorkingEvent
 
struct  ObserveTrailExtremum
 
struct  OpeningClose
 
struct  OpeningObservation
 
struct  OpeningsClose
 Immutable fixed cohort. More...
 
struct  OwnerOpenedUnits
 A reduction of exactly what the owner's fill opened, bound at the arm and reported by a QuantityBoundEvent. More...
 
struct  PendingDeferred
 
struct  PendingNone
 
struct  PointBudget
 Cap what this request may execute at ONE matching point at units. More...
 
struct  PositionFlat
 
struct  PositionNonflat
 
struct  PreparationError
 A working-request preparation that could not produce a representable instruction — a nonrepresentable quantity, most often. More...
 
class  PreparedCancel
 
class  PreparedExecution
 
class  PreparedMutation
 
class  PreparedReplace
 
class  PreparedSubmit
 
struct  QuantityBoundEvent
 A Reduce{OwnerOpenedUnits} was bound, at its owner's fill, to what that fill opened. More...
 
struct  Reduce
 A closing-only intent. More...
 
struct  RejectedEvent
 
struct  RemainingDeferred
 
struct  RemainingFlattenAll
 
struct  RemainingProjectionDeferred
 
struct  RemainingProjectionFlattenAll
 
struct  RemainingProjectionNoTarget
 
struct  RemainingProjectionUnbound
 
struct  RemainingProjectionUnits
 
struct  RemainingUnbound
 
struct  RemainingUnits
 A resolved remaining quantity, in units. More...
 
struct  ReplacedEvent
 
struct  ReplaceOptions
 Replacement behaviour that is not expressible in the successor request. More...
 
struct  ReplaceRejectedEvent
 
struct  ReplaceResult
 
struct  Request
 Aggregate field order keeps market construction: Request{Transact{1.0}, "buy", "comment"} Request{Flatten{}, "flat", ""} Request{Reduce{ExplicitUnits{3}}, "close", ""} New fields default to Market / ImmediateRemaining / Independent / NoGroup. More...
 
struct  RequestDefinition
 The immutable accepted form of one request: its handle, the request value as accepted, its birth (acceptance ordinal and decision floor), its origin (RequestOrigin::Host, or the kernel's own for a liquidation or a risk flatten) and its authority. More...
 
struct  ReservationReducedEvent
 
struct  ReverseTo
 Exact target exposure for an explicit reversal request. More...
 
struct  ScopeFraction
 A fraction in (0, 1] of the bound scope, resolved at the matching candidate. More...
 
struct  SelectedExposure
 Native authorization receipt, converted to a call-local financial SelectedOpeningSet only at the consumer's settlement boundary. More...
 
struct  Sized
 A kernel-sized opening. More...
 
struct  Stop
 A stop trigger: the modeled path has to reach price from the adverse side. More...
 
struct  StopActive
 
struct  StopIdle
 
struct  StopLimit
 A stop that, once reached, becomes a limit at limit. More...
 
struct  StopLimitLive
 
struct  StopLimitPending
 
struct  SubmitResult
 What submit answers. More...
 
struct  TargetObservation
 
struct  TermsResolvedEvent
 
struct  TermsResolvedInput
 
struct  Trail
 offset is a price distance: the stop rides offset behind the running best. More...
 
struct  TrailActive
 
struct  TrailTicks
 Trail offset spelled in price ticks instead of a price distance. More...
 
struct  TrailTrack
 
struct  TrailWaitArm
 
struct  UnboundBookClose
 
struct  Wait
 The authority an unarmed WaitForApplied child holds: accepted and live, but never a matching candidate until its owner's fill arms it — under either visibility. More...
 
struct  WaitForApplied
 The one owner relation that arms (the ArmedEvent). More...
 
class  WorkingRequestCore
 

Typedefs

using Flatten = execution::Flatten
 
using Transact = order_action::Transact
 A signed book transaction: finite nonzero units on the side their sign names.
 
using SizeBasis = std::variant<CashValue, EquityFraction>
 The two bases a Sized intent may name.
 
using ReductionSize = std::variant<ExplicitUnits, OwnerOpenedUnits, ScopeFraction>
 How much a Reduce takes: literal units, the owner's own opening, or a fraction of the bound scope.
 
using OrderIntent = std::variant<Flatten, Reduce, Transact, ReverseTo, HostSized, Sized>
 What a request does.
 
using Trigger = std::variant<Market, Limit, Stop, StopLimit, Trail>
 
using TriggerAnchor = std::variant<Absolute, FromOwnerFill>
 
using Capacity = std::variant<ImmediateRemaining, PointBudget>
 
using Owner = std::variant<Independent, WaitForApplied, BindOpening, BindOpenings, BindCohort>
 
using Group = std::variant<NoGroup, Member>
 
using Remaining
 
using RemainingProjection
 
using Enrollment = std::variant<EnrollmentFromCommand, EnrollmentFromApplied>
 
using Authority
 
using ExecutionScope = std::variant<execution::Book, execution::OpeningExposure, SelectedExposure>
 What one execution acted on: the whole book, one opening's exposure, or a bound selection.
 
using TriggerState
 
using Allowance
 
using PendingAdjustments = std::variant<PendingNone, PendingDeferred>
 
using PositionIdentity = std::variant<PositionFlat, PositionNonflat>
 
using DefinitionRef = std::shared_ptr<const RequestDefinition>
 
using ExecutionPlan
 The settlement shape one execution takes.
 
using CommandEvent
 Every alternative of one request's history, as one value.
 
using AnchoredLevelResolver
 The one policy point of an anchored materialization.
 
using TriggerTransition
 
using InstallResult = std::variant<Installed, InstallError>
 
template<class T>
using Preparation = std::variant<T, NoChange, PreparationError>
 
template<class R>
using InstalledCommand = std::variant<CommandInstalled<R>, InstallError>
 

Enumerations

enum class  HostSizedKind : std::uint8_t {
  Open = 0 ,
  Close = 1
}
 
enum class  Side : std::uint8_t {
  Long = 0 ,
  Short = 1
}
 
enum class  ExecutionGridPolicy : std::uint8_t {
  SnapToGrid = 0 ,
  ExplicitUnits = 1
}
 Resolved host sizing normally remains subject to the run's quantity grid. More...
 
enum class  SizeTime : std::uint8_t {
  AtMatch = 0 ,
  AtAcceptance = 1
}
 AtMatch resolves the basis at the matching candidate; AtAcceptance freezes the resolved units when the request is accepted. More...
 
enum class  SizePrice : std::uint8_t {
  Resolved = 0 ,
  Signal = 1 ,
  SignalOnTick = 2
}
 WHICH price the basis is converted at. More...
 
enum class  ScopeClaim : std::uint8_t {
  Gross = 0 ,
  NetOfSiblings = 1
}
 Gross claims the whole bound scope; NetOfSiblings first subtracts the units already claimed by the live sibling reduces bound to that same scope. More...
 
enum class  ScopeBasis : std::uint8_t {
  AtMatch = 0 ,
  AtAcceptance = 1
}
 Which measurement of the bound scope the fraction is taken of. More...
 
enum class  NativeAnchorRounding : std::uint8_t {
  Raw = 0 ,
  HalfUp = 1 ,
  Directional = 2
}
 How a materialized anchored level is snapped onto the run's price tick ladder (NativeRunSpec::price_tick). More...
 
enum class  NativeArmVisibility : std::uint8_t {
  Working = 0 ,
  PendingUntilArmed = 1
}
 Whether an owner-related request that arms is a working order before its arm. More...
 
enum class  NativeArmFirstMatch : std::uint8_t {
  AtArmPrint = 0 ,
  AfterArmPrint = 1
}
 When an armed request may first match. More...
 
enum class  NativeArmScope : std::uint8_t {
  OwnerLot = 0 ,
  Book = 1
}
 What an armed CLOSING request (Reduce, Flatten, a HostSized close) closes. More...
 
enum class  GroupEffect : std::uint8_t {
  Cancel = 0 ,
  Reduce = 1
}
 
enum class  RequestOrigin : std::uint8_t {
  Host = 0 ,
  KernelLiquidation = 1 ,
  KernelRisk = 2
}
 Who authored a request. More...
 
enum class  RequestRejectReason : std::uint8_t {
  InvalidQuantity = 0 ,
  OffGrid = 1 ,
  InvalidTrigger = 2 ,
  InvalidCapacity = 3 ,
  InvalidOwner = 4 ,
  InvalidQuantityBasis = 5 ,
  InvalidGroup = 6 ,
  PlacementAdmission = 7
}
 Why an acceptance was refused, on a Rejected SubmitResult. More...
 
enum class  SubmitStatus {
  Accepted ,
  Rejected
}
 
enum class  ReplaceStatus {
  Replaced ,
  ReplaceRejected ,
  NotWorking ,
  InvalidHandle
}
 
enum class  CancelStatus {
  Cancelled ,
  NotWorking ,
  InvalidHandle
}
 
enum class  MatchRejectReason : std::uint8_t {
  NonpositivePrice = 0 ,
  OpeningDirection = 1 ,
  MaxAbsUnits = 2 ,
  MaxOpenLots = 3 ,
  InitialMargin = 4 ,
  TermsUnresolved = 5 ,
  InvalidTerms = 6 ,
  NoOppositeExposure = 7 ,
  HostPrecommit = 8 ,
  RiskLimit = 9
}
 Why a CANDIDATE was refused — a decision taken at a matching point, with the request still live unless the reason is terminal. More...
 
enum class  NativeCandidatePriceKind : std::uint8_t {
  PointPrice = 0 ,
  TriggerLevel = 1 ,
  CurrentQuote = 2
}
 Which price a candidate is being offered at: the point's own price, or the request's trigger level (a crossing that books the level itself). More...
 
enum class  OpeningShape : std::uint8_t {
  Transact = 0 ,
  ReverseTo = 1 ,
  CloseOpposite = 2
}
 
enum class  CancelReason : std::uint8_t {
  User = 0 ,
  Group = 1 ,
  OwnerGone = 2 ,
  UnsupportedRelation = 3 ,
  Superseded = 4
}
 Why a request left the book. More...
 
enum class  AppliedTerminalReason : std::uint8_t {
  WorkingUnitsSatisfied = 0 ,
  Flattened = 1 ,
  TargetExhausted = 2
}
 
enum class  ActivationKind : std::uint8_t {
  Stop = 0 ,
  StopLimit = 1 ,
  TrailArm = 2 ,
  TrailTrigger = 3
}
 
enum class  CoreFailure : std::uint8_t {
  Invariant = 0 ,
  InvalidCause = 1 ,
  NonrepresentableQuantity = 2 ,
  MissingObservation = 3 ,
  StaleHandle = 4 ,
  UnsupportedTransition = 5 ,
  ConflictingReceipt = 6 ,
  UnrepresentableReservation = 7 ,
  InvalidScope = 8 ,
  InvalidProposal = 9 ,
  ObservationMismatch = 10
}
 
enum class  DriverEligibilityClass : std::uint8_t {
  ObservedPrint = 0 ,
  CarriedOpen = 1 ,
  TickAfterCalculation = 2 ,
  ConfirmedOpen = 3 ,
  ConfirmedExcursion = 4 ,
  ConfirmedAfterCalculationClose = 5 ,
  CurrentExecution = 6
}
 
enum class  CommandSurface : std::uint8_t {
  General = 0 ,
  MarketOnly = 1
}
 
enum class  RiskLimitKind : std::uint8_t {
  MaxDrawdown = 0 ,
  MaxIntradayLoss = 1 ,
  MaxConsecutiveLossDays = 2 ,
  MaxFillsPerDay = 3
}
 Which generic risk limit of NativeRunSpec::risk a NativeRiskEvent reports. More...
 
enum class  InstallError : std::uint8_t {
  StalePreparation = 0 ,
  WrongCoreOrRun = 1 ,
  AlreadyConsumed = 2
}
 
enum class  NoChangeReason : std::uint8_t {
  NoTransition = 0 ,
  StillWaiting = 1 ,
  NotEligible = 2 ,
  NotWorking = 3 ,
  AlreadyApplied = 4
}
 
enum class  CohortReceiptOperation : std::uint8_t {
  Add = 0 ,
  Remove = 1
}
 
enum class  CohortReceiptStatus : std::uint8_t {
  Applied = 0 ,
  InvalidHandle = 1 ,
  UnknownOrigin = 2 ,
  TerminalOrigin = 3
}
 

Functions

bool operator== (CohortHandle left, CohortHandle right) noexcept
 
bool operator!= (CohortHandle left, CohortHandle right) noexcept
 
bool operator< (CohortHandle left, CohortHandle right) noexcept
 
OrderIntent intent_from_physical (const execution::Action &action)
 
Request market_request (execution::Action action, std::string label={}, std::string comment={})
 
bool has_market_defaults (const Request &request) noexcept
 
bool operator== (const EventId &a, const EventId &b)
 
bool operator!= (const EventId &a, const EventId &b)
 
bool operator== (const MatchCursor &a, const MatchCursor &b) noexcept
 
bool operator!= (const MatchCursor &a, const MatchCursor &b) noexcept
 
std::uint8_t display_waypoint (const MatchCursor &cursor) noexcept
 
bool point_eligible (const LiveRequest &live, uint64_t point_ordinal, int64_t effective_time_ms) noexcept
 Whether a request may be considered at this driver point: the point's ordinal must be strictly past the birth acceptance ordinal AND its effective time at or past the birth's decision-time lower bound.
 
bool quantity_on_grid (double q, double step) noexcept
 v2 exact binary64 grid: r=abs(q)/s, n=round(r) half away from zero, g=n*s.
 
ExecutionPlan to_execution_plan (const execution::Action &action)
 

Typedef Documentation

◆ Flatten

◆ Transact

A signed book transaction: finite nonzero units on the side their sign names.

It opens, and it closes against a live opposite book on the way, so a transaction larger than an opposite position still opens the remainder. An opening denial rejects the ENTIRE transaction, including that remainder.

Definition at line 41 of file native_order.hpp.

◆ SizeBasis

The two bases a Sized intent may name.

Extended only by appending, so an existing aggregate initializer keeps its meaning.

Definition at line 102 of file native_order.hpp.

◆ ReductionSize

How much a Reduce takes: literal units, the owner's own opening, or a fraction of the bound scope.

Definition at line 215 of file native_order.hpp.

◆ OrderIntent

What a request does.

Six alternatives: Flatten (quantity-free whole-book close), Reduce (closing only), Transact (a signed book transaction), ReverseTo (an exact signed target exposure), HostSized (the host resolves the quantity) and Sized (the kernel resolves it from a cash or equity basis). The variant's size is pinned by the frozen C++ ABI fixtures, so appending an alternative is an epoch decision.

Definition at line 229 of file native_order.hpp.

◆ Trigger

◆ TriggerAnchor

◆ Capacity

◆ Owner

◆ Group

Definition at line 422 of file native_order.hpp.

◆ Remaining

◆ RemainingProjection

◆ Enrollment

◆ Authority

◆ ExecutionScope

What one execution acted on: the whole book, one opening's exposure, or a bound selection.

Reported on ExecutionAppliedEvent::scope. The financial execution::CloseScope remains the original two-alternative type; this is the native view, and a selected close's committed row range identifies the actual contributors.

Definition at line 583 of file native_order.hpp.

◆ TriggerState

◆ Allowance

◆ PendingAdjustments

◆ PositionIdentity

◆ DefinitionRef

Definition at line 669 of file native_order.hpp.

◆ ExecutionPlan

Initial value:

The settlement shape one execution takes.

Derived by the kernel from the intent and the answered terms; a host never constructs it.

Definition at line 820 of file native_order.hpp.

◆ CommandEvent

Initial value:
std::variant<AcceptedEvent,
One request was accepted: the definition, and the timeline ordinal it was accepted at.
An anchored leg was materialized, exactly once: fill + offset, then the rounding, then resolve_anchor...
One committed execution: the definition, the cursor, the resolved price and units,...
A kernel-issued liquidation that actually filled.
A candidate the run refused, with its MatchRejectReason and the cursor it was refused at.
A reduction or a flatten that had nothing to close: terminal, with no execution identity,...
A Reduce{OwnerOpenedUnits} was bound, at its owner's fill, to what that fill opened.

Every alternative of one request's history, as one value.

native_events() returns them as the NativeEventKind::Command rows, and strategy_native_events_v1 flattens the same set into one tagged POD. The variant's size is pinned by the frozen C++ ABI fixtures.

Definition at line 1169 of file native_order.hpp.

◆ AnchoredLevelResolver

Initial value:
std::function<std::optional<double>(
const LiveRequest& leg, const ExecutionAppliedEvent& owner_fill, Side leg_side,
double offset, double kernel_level)>

The one policy point of an anchored materialization.

The core knows it only as a callable over its own values: the leg's live row, the owner's fill, the leg's side, the resolved offset (price units) and the kernel level after the anchor rounding. It is consulted exactly once per materialization, before the ArmedEvent is built, so the ArmedEvent and every later reader see the installed level. A returned value is the level to install (the kernel's representability check still applies and a failure is the existing PreparationError path); nullopt keeps the kernel level. An empty callable is exactly the pre-hook behaviour.

Definition at line 1341 of file native_order.hpp.

◆ TriggerTransition

◆ InstallResult

◆ Preparation

Definition at line 1456 of file native_order.hpp.

◆ InstalledCommand

Definition at line 1465 of file native_order.hpp.

Enumeration Type Documentation

◆ HostSizedKind

Enumerator
Open 
Close 

Definition at line 64 of file native_order.hpp.

◆ Side

enum class pineforge::native_order::native_order_v6::Side : std::uint8_t
strong
Enumerator
Long 
Short 

Definition at line 65 of file native_order.hpp.

◆ ExecutionGridPolicy

Resolved host sizing normally remains subject to the run's quantity grid.

A host may instead authenticate literal units for a pure reduction; the consumer still proves that the positive quantity is representable within the selected exposure before it can reach settlement.

Enumerator
SnapToGrid 
ExplicitUnits 

Definition at line 82 of file native_order.hpp.

◆ SizeTime

enum class pineforge::native_order::native_order_v6::SizeTime : std::uint8_t
strong

AtMatch resolves the basis at the matching candidate; AtAcceptance freezes the resolved units when the request is accepted.

Enumerator
AtMatch 
AtAcceptance 

Definition at line 106 of file native_order.hpp.

◆ SizePrice

enum class pineforge::native_order::native_order_v6::SizePrice : std::uint8_t
strong

WHICH price the basis is converted at.

This is the generic "size against the expected fill price" rule; it names no source language.

Resolved (today's behaviour) uses the price the kernel would otherwise settle at: the candidate's default resolved price for AtMatch, the raw acceptance-point price for AtAcceptance.

Signal is the decision-point price at placement – the current bar's close, or the last print, at submit – carried to the expected market fill: it is adjusted by the run's slippage for the request's own side (price +/- slippage_ticks * price_tick) and then rounded onto the run's price grid when NativeRunSpec::price_grid is on (HalfUp is the nearest tick; NativePriceGrid::None leaves it unrounded). It is frozen when the request is accepted, so it composes with SizeTime::AtAcceptance and, with SizeTime::AtMatch, the basis still converts at that frozen signal price at every later candidate. A Signal request accepted outside a decision point has no price to freeze and stays unresolvable.

SignalOnTick is the same decision-point rule measured on the INSTRUMENT's own tick ladder (NativeRunSpec::price_tick) instead of the run's fill grid: the decision price is rounded onto the ladder (nearest tick, ties away from zero), carried to the expected fill by the side's tick slippage, and rounded onto the ladder again. Two rulings are folded into it, both generic:

  • price_tick is the instrument's own resolution and the run already declares it as the slippage multiplier, so a price the market PRINTS lives on that ladder whether or not the run also quantizes the prices it BOOKS. NativeRunSpec::price_grid governs fills; it does not govern what a signal was worth. A run that books unquantized fills can therefore still size against the printed price, which Signal cannot express.
  • the ladder is applied BEFORE the slippage, not only after. Slippage is a whole number of ticks, so it carries a ladder price to another ladder price: pre-rounding makes round(p) +/- n*tick exact and leaves the second rounding a pure binary64 re-normalization, where rounding only after composes two different quantizations of the same print.

Resolved and Signal are unchanged by this alternative, so every established Sized resolution keeps its value.

Enumerator
Resolved 
Signal 
SignalOnTick 

Definition at line 146 of file native_order.hpp.

◆ ScopeClaim

enum class pineforge::native_order::native_order_v6::ScopeClaim : std::uint8_t
strong

Gross claims the whole bound scope; NetOfSiblings first subtracts the units already claimed by the live sibling reduces bound to that same scope.

The keys are opaque request/owner handles, never source identifiers.

Enumerator
Gross 
NetOfSiblings 

Definition at line 195 of file native_order.hpp.

◆ ScopeBasis

enum class pineforge::native_order::native_order_v6::ScopeBasis : std::uint8_t
strong

Which measurement of the bound scope the fraction is taken of.

AtMatch (the default) reads the scope as it stands at the matching candidate. AtAcceptance freezes the scope SIZE when the request is accepted – the placement-time live basis – so two 50 % siblings on one 10-unit lot both claim 5 under Gross even after the first has already executed. NetOfSiblings then subtracts the live sibling claims from that frozen basis.

Enumerator
AtMatch 
AtAcceptance 

Definition at line 202 of file native_order.hpp.

◆ NativeAnchorRounding

How a materialized anchored level is snapped onto the run's price tick ladder (NativeRunSpec::price_tick).

Raw keeps fill + offset exactly, which is the established behaviour. HalfUp is the nearest tick with ties away from zero. Directional rounds toward the price region the resting leg needs, relative to the leg's trigger kind and side exactly as NativeGridRounding documents it: a buy limit down and a sell limit up, a stop the other way; a trail arm threshold is reached from the favourable side like a limit and rounds like one. Either rounding needs a positive price tick, checked at acceptance exactly like a tick-spelled offset. This is a generic instrument grid: a source language's own trigger projection is not spelled here (a host restates the level through its arm hook).

Enumerator
Raw 
HalfUp 
Directional 

Definition at line 284 of file native_order.hpp.

◆ NativeArmVisibility

Whether an owner-related request that arms is a working order before its arm.

Working (the default) is the established book: the request is listed by native_working_requests() from acceptance on. PendingUntilArmed keeps it out of that enumeration until its ArmedEvent; it is still a live request the whole time – accepted, addressable by handle (replace, cancel, trail_state), counted by cancel_all / cancel_where, and folded into the continuation identity – and it never matches before the arm under either value. Visibility governs enumeration, not addressing.

Enumerator
Working 
PendingUntilArmed 

Definition at line 341 of file native_order.hpp.

◆ NativeArmFirstMatch

When an armed request may first match.

The arm happens inside its owner's fill settlement, at the owner's fill print. AtArmPrint (the default) is the established book: the armed request is a candidate at that very cursor, so a level the fill print already satisfies matches at the print. AfterArmPrint gives the armed request the birth rule of a request submitted from the owner's fill callback: on the driver point that armed it, it sees only the path after the print – a level the print already satisfies does not match there, a later crossing on that point still does – and from the next driver point on it is an ordinary working request. It governs the level test of a priced trigger (limit, stop, stop-limit, trail arm); a market trigger has no level and is unaffected. Both are broker models: a contingent child that enters the book after its parent's trade cannot trade on that print, a simulated bracket commonly may.

Enumerator
AtArmPrint 
AfterArmPrint 

Definition at line 359 of file native_order.hpp.

◆ NativeArmScope

What an armed CLOSING request (Reduce, Flatten, a HostSized close) closes.

OwnerLot (the default) is the established relation: the lot its owner's fill opened, and nothing a later add brings. Book binds it, at the arm, to the whole position that fill left – the very book authority an Independent close submitted from the owner's fill callback acquires – so a protective leg placed with its entry covers later adds and settles through the book like any other close. A HostSized close may wait for its owner only under Book: the owner-lot relation sizes from the units the owner opened, whereas a book close is sized by the host at the match. A waiting transaction closes nothing, so it must keep OwnerLot.

Enumerator
OwnerLot 
Book 

Definition at line 374 of file native_order.hpp.

◆ GroupEffect

Enumerator
Cancel 
Reduce 

Definition at line 415 of file native_order.hpp.

◆ RequestOrigin

Who authored a request.

Host is every request a host submits, replaces or cancels, and it is the whole existing population: it folds nothing into the continuation digest, so no established hash moves. KernelLiquidation marks the margin model's own Reduce or Flatten; KernelRisk marks the Flatten a NativeRiskAction::FlattenAndBlock breach issues at its breach point (native_execution_consumer.cpp, pinned by tests/test_native_risk_limits.cpp).

Enumerator
Host 
KernelLiquidation 
KernelRisk 

Definition at line 650 of file native_order.hpp.

◆ RequestRejectReason

Why an acceptance was refused, on a Rejected SubmitResult.

These are decided at submit, before any request record exists: an invalid quantity or basis, an off-grid quantity, an owner the intent may not take, a trigger spelling the run cannot resolve, or a frozen quantity the run's own opening admission refuses (PlacementAdmission).

Enumerator
InvalidQuantity 
OffGrid 
InvalidTrigger 
InvalidCapacity 
InvalidOwner 
InvalidQuantityBasis 
InvalidGroup 
PlacementAdmission 

A Sized{SizeTime::AtAcceptance} whose acceptance-resolved quantity does not pass the run's opening admission (allowed directions, max_abs_units, max_open_lots, initial margin) at the sizing price.

Definition at line 732 of file native_order.hpp.

◆ SubmitStatus

Enumerator
Accepted 
Rejected 

Definition at line 746 of file native_order.hpp.

◆ ReplaceStatus

Enumerator
Replaced 
ReplaceRejected 
NotWorking 
InvalidHandle 

Definition at line 747 of file native_order.hpp.

◆ CancelStatus

Enumerator
Cancelled 
NotWorking 
InvalidHandle 

Definition at line 748 of file native_order.hpp.

◆ MatchRejectReason

Why a CANDIDATE was refused — a decision taken at a matching point, with the request still live unless the reason is terminal.

OpeningDirection, MaxAbsUnits, MaxOpenLots, InitialMargin and RiskLimit are the run's admission gates; TermsUnresolved is a host-sized or basis-sized quantity that could not be resolved; NoOppositeExposure and InvalidTerms are shapes the answered terms cannot take.

Enumerator
NonpositivePrice 
OpeningDirection 
MaxAbsUnits 
MaxOpenLots 
InitialMargin 
TermsUnresolved 
InvalidTerms 
NoOppositeExposure 
HostPrecommit 
RiskLimit 

An opening refused while the run spec's generic risk limits are blocking (L9).

Reduces never reach this gate.

Definition at line 780 of file native_order.hpp.

◆ NativeCandidatePriceKind

Which price a candidate is being offered at: the point's own price, or the request's trigger level (a crossing that books the level itself).

A host reads it off the terms facts, and the trail suites read it back off the applied event to tell a level fill from a path fill.

Enumerator
PointPrice 
TriggerLevel 
CurrentQuote 

Definition at line 799 of file native_order.hpp.

◆ OpeningShape

Enumerator
Transact 
ReverseTo 
CloseOpposite 

Definition at line 805 of file native_order.hpp.

◆ CancelReason

Why a request left the book.

Host is an explicit cancel; Group an OCA sibling's effect; OwnerGone a parent that was rejected, replaced or cancelled, which ends its waiting children; Superseded the kernel withdrawing its own liquidation before re-pricing it. Every reason is carried on a CancelledEvent.

Enumerator
User 
Group 
OwnerGone 
UnsupportedRelation 
Superseded 

A kernel-originated request the kernel itself withdrew: the liquidation level or its units moved, or the requirement is no longer breached.

Definition at line 841 of file native_order.hpp.

◆ AppliedTerminalReason

Enumerator
WorkingUnitsSatisfied 
Flattened 
TargetExhausted 

Definition at line 851 of file native_order.hpp.

◆ ActivationKind

Enumerator
Stop 
StopLimit 
TrailArm 
TrailTrigger 

Definition at line 857 of file native_order.hpp.

◆ CoreFailure

Enumerator
Invariant 
InvalidCause 
NonrepresentableQuantity 
MissingObservation 
StaleHandle 
UnsupportedTransition 
ConflictingReceipt 
UnrepresentableReservation 
InvalidScope 
InvalidProposal 
ObservationMismatch 

Definition at line 864 of file native_order.hpp.

◆ DriverEligibilityClass

Enumerator
ObservedPrint 
CarriedOpen 
TickAfterCalculation 
ConfirmedOpen 
ConfirmedExcursion 
ConfirmedAfterCalculationClose 
CurrentExecution 

Definition at line 878 of file native_order.hpp.

◆ CommandSurface

Enumerator
General 
MarketOnly 

Definition at line 888 of file native_order.hpp.

◆ RiskLimitKind

Which generic risk limit of NativeRunSpec::risk a NativeRiskEvent reports.

Enumerator
MaxDrawdown 
MaxIntradayLoss 
MaxConsecutiveLossDays 
MaxFillsPerDay 

Definition at line 1141 of file native_order.hpp.

◆ InstallError

Enumerator
StalePreparation 
WrongCoreOrRun 
AlreadyConsumed 

Definition at line 1426 of file native_order.hpp.

◆ NoChangeReason

Enumerator
NoTransition 
StillWaiting 
NotEligible 
NotWorking 
AlreadyApplied 

Definition at line 1434 of file native_order.hpp.

◆ CohortReceiptOperation

Enumerator
Add 
Remove 

Definition at line 1496 of file native_order.hpp.

◆ CohortReceiptStatus

Enumerator
Applied 
InvalidHandle 
UnknownOrigin 
TerminalOrigin 

Definition at line 1497 of file native_order.hpp.

Function Documentation

◆ operator==() [1/3]

bool pineforge::native_order::native_order_v6::operator== ( CohortHandle left,
CohortHandle right )
inlinenoexcept

Definition at line 48 of file native_order.hpp.

◆ operator!=() [1/3]

bool pineforge::native_order::native_order_v6::operator!= ( CohortHandle left,
CohortHandle right )
inlinenoexcept

Definition at line 51 of file native_order.hpp.

◆ operator<()

bool pineforge::native_order::native_order_v6::operator< ( CohortHandle left,
CohortHandle right )
inlinenoexcept

Definition at line 54 of file native_order.hpp.

◆ intent_from_physical()

OrderIntent pineforge::native_order::native_order_v6::intent_from_physical ( const execution::Action & action)
inline

Definition at line 443 of file native_order.hpp.

◆ market_request()

Request pineforge::native_order::native_order_v6::market_request ( execution::Action action,
std::string label = {},
std::string comment = {} )
inline

Definition at line 452 of file native_order.hpp.

◆ has_market_defaults()

bool pineforge::native_order::native_order_v6::has_market_defaults ( const Request & request)
inlinenoexcept

Definition at line 458 of file native_order.hpp.

◆ operator==() [2/3]

bool pineforge::native_order::native_order_v6::operator== ( const EventId & a,
const EventId & b )
inline

Definition at line 471 of file native_order.hpp.

◆ operator!=() [2/3]

bool pineforge::native_order::native_order_v6::operator!= ( const EventId & a,
const EventId & b )
inline

Definition at line 474 of file native_order.hpp.

◆ operator==() [3/3]

bool pineforge::native_order::native_order_v6::operator== ( const MatchCursor & a,
const MatchCursor & b )
inlinenoexcept

Definition at line 481 of file native_order.hpp.

◆ operator!=() [3/3]

bool pineforge::native_order::native_order_v6::operator!= ( const MatchCursor & a,
const MatchCursor & b )
inlinenoexcept

Definition at line 488 of file native_order.hpp.

◆ display_waypoint()

std::uint8_t pineforge::native_order::native_order_v6::display_waypoint ( const MatchCursor & cursor)
inlinenoexcept

Definition at line 490 of file native_order.hpp.

◆ point_eligible()

bool pineforge::native_order::native_order_v6::point_eligible ( const LiveRequest & live,
uint64_t point_ordinal,
int64_t effective_time_ms )
inlinenoexcept

Whether a request may be considered at this driver point: the point's ordinal must be strictly past the birth acceptance ordinal AND its effective time at or past the birth's decision-time lower bound.

This is the birth gate — it is why a request accepted on bar N cannot fill on that bar's already delivered opening — and a request born mid-path in on_native_applied is admitted at the current cursor instead, on the unconsumed suffix of that segment.

Definition at line 699 of file native_order.hpp.

◆ quantity_on_grid()

bool pineforge::native_order::native_order_v6::quantity_on_grid ( double q,
double step )
inlinenoexcept

v2 exact binary64 grid: r=abs(q)/s, n=round(r) half away from zero, g=n*s.

Intermediates finite, 1<=n<=2^53, abs(abs(q)-g) <= 4*ulp(max(abs(q),abs(g))) and < s/2. ulp is nextafter toward +inf. Does not rewrite q.

Definition at line 708 of file native_order.hpp.

◆ to_execution_plan()

ExecutionPlan pineforge::native_order::native_order_v6::to_execution_plan ( const execution::Action & action)
inline

Definition at line 823 of file native_order.hpp.