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

One complete setup value, staged/copied by NativeStrategyHost before it is applied at begin. More...

#include <native_run_spec.hpp>

Data Fields

native_order::RunIdentity identity
 
std::string input_tf
 
std::string script_tf
 
bool timeframe_undetected = false
 A public begin with fewer than two bars may not establish a timeframe.
 
NativeSlotLabelPolicy slot_label_policy = NativeSlotLabelPolicy::Canonical
 Strict native hosts retain the canonical slot-label rule.
 
NativeFeedTolerance legacy_tolerance = NativeFeedTolerance::None
 
NativePathOrder path_order = NativePathOrder::Auto
 
std::string ticker
 
std::string tickerid
 
std::string type
 
std::string currency
 
std::string basecurrency
 
std::string description
 
std::string volumetype
 
std::string timezone
 
std::string session
 
std::string chart_timezone
 
double initial_capital = 0.0
 
double point_value = 0.0
 
double account_fx = 0.0
 
double price_tick = 0.0
 
std::uint32_t slippage_ticks = 0
 
NativePriceGrid price_grid = NativePriceGrid::None
 Opt-in instrument grid.
 
NativeGridRounding grid_rounding = NativeGridRounding::HalfUp
 
NativeFeeKind fee_kind = NativeFeeKind::Percent
 
double fee_value = 0.0
 
std::optional< double > quantity_grid
 
NativeCloseExecution close_execution = NativeCloseExecution::NextEligiblePoint
 
NativeAbortReporting abort_reporting = NativeAbortReporting::Error
 
std::optional< double > max_abs_units
 
std::optional< std::uint64_t > max_open_lots
 
NativeOpenDirections allowed_open_directions = NativeOpenDirections::Both
 
std::optional< double > initial_margin_fraction
 
std::optional< NativeMarginModelmargin
 Opt-in generic margin model.
 
std::optional< NativeRiskLimitsrisk
 Opt-in generic account risk limits.
 
NativeReportPolicy report_policy = NativeReportPolicy::HostRecorded
 
bool report_open_position_at_end = false
 Report a position still open at run end as a mark-to-market closed row at the last close.
 
NativeCalculationTrigger calculation = NativeCalculationTrigger::BarClose
 Calculation timing.
 
std::uint32_t max_recalculations_per_point = 8
 
NativeOpenBarView open_bar_view = NativeOpenBarView::Complete
 
IntrabarPath intrabar {}
 
std::vector< NativeTimeframeSubscriptionsubscriptions
 Declared higher-timeframe series.
 
std::optional< NativeAuxiliaryFeedauxiliary_feed
 Opt-in auxiliary finer feed.
 

Detailed Description

One complete setup value, staged/copied by NativeStrategyHost before it is applied at begin.

This aggregate owns no host phase, consumed-run counter, parsed-calendar authority, physical account, or C transport presence mask. Empty required strings and zero capital/value/FX defaults make an incomplete value invalid; price_tick == 0 explicitly selects unquantized prices. No timezone/timeframe/instrument facts are inferred.

Definition at line 521 of file native_run_spec.hpp.

Field Documentation

◆ identity

native_order::RunIdentity pineforge::native_run_spec_v3::NativeRunSpec::identity

◆ input_tf

std::string pineforge::native_run_spec_v3::NativeRunSpec::input_tf

◆ script_tf

std::string pineforge::native_run_spec_v3::NativeRunSpec::script_tf

◆ timeframe_undetected

bool pineforge::native_run_spec_v3::NativeRunSpec::timeframe_undetected = false

A public begin with fewer than two bars may not establish a timeframe.

This preserves that explicit state without inventing a clock literal.

Definition at line 527 of file native_run_spec.hpp.

Referenced by pineforge::source::PineExecutionAdapter::project().

◆ slot_label_policy

NativeSlotLabelPolicy pineforge::native_run_spec_v3::NativeRunSpec::slot_label_policy = NativeSlotLabelPolicy::Canonical

Strict native hosts retain the canonical slot-label rule.

A provider feed may opt into raw, strictly-increasing caller labels. The declared type spellings below are the ones the native C++ ABI guard pins.

Definition at line 531 of file native_run_spec.hpp.

Referenced by pineforge::source::PineExecutionAdapter::project().

◆ legacy_tolerance

NativeFeedTolerance pineforge::native_run_spec_v3::NativeRunSpec::legacy_tolerance = NativeFeedTolerance::None

◆ path_order

NativePathOrder pineforge::native_run_spec_v3::NativeRunSpec::path_order = NativePathOrder::Auto

◆ ticker

std::string pineforge::native_run_spec_v3::NativeRunSpec::ticker

◆ tickerid

std::string pineforge::native_run_spec_v3::NativeRunSpec::tickerid

◆ type

std::string pineforge::native_run_spec_v3::NativeRunSpec::type

◆ currency

std::string pineforge::native_run_spec_v3::NativeRunSpec::currency

◆ basecurrency

std::string pineforge::native_run_spec_v3::NativeRunSpec::basecurrency

◆ description

std::string pineforge::native_run_spec_v3::NativeRunSpec::description

◆ volumetype

std::string pineforge::native_run_spec_v3::NativeRunSpec::volumetype

◆ timezone

std::string pineforge::native_run_spec_v3::NativeRunSpec::timezone

◆ session

std::string pineforge::native_run_spec_v3::NativeRunSpec::session

◆ chart_timezone

std::string pineforge::native_run_spec_v3::NativeRunSpec::chart_timezone

◆ initial_capital

double pineforge::native_run_spec_v3::NativeRunSpec::initial_capital = 0.0

◆ point_value

double pineforge::native_run_spec_v3::NativeRunSpec::point_value = 0.0

◆ account_fx

double pineforge::native_run_spec_v3::NativeRunSpec::account_fx = 0.0

◆ price_tick

double pineforge::native_run_spec_v3::NativeRunSpec::price_tick = 0.0

◆ slippage_ticks

std::uint32_t pineforge::native_run_spec_v3::NativeRunSpec::slippage_ticks = 0

◆ price_grid

NativePriceGrid pineforge::native_run_spec_v3::NativeRunSpec::price_grid = NativePriceGrid::None

Opt-in instrument grid.

None keeps unquantized prices; both quantizing modes require price_tick > 0 and round before slippage.

Definition at line 554 of file native_run_spec.hpp.

◆ grid_rounding

NativeGridRounding pineforge::native_run_spec_v3::NativeRunSpec::grid_rounding = NativeGridRounding::HalfUp

Definition at line 555 of file native_run_spec.hpp.

◆ fee_kind

NativeFeeKind pineforge::native_run_spec_v3::NativeRunSpec::fee_kind = NativeFeeKind::Percent

◆ fee_value

double pineforge::native_run_spec_v3::NativeRunSpec::fee_value = 0.0

◆ quantity_grid

std::optional<double> pineforge::native_run_spec_v3::NativeRunSpec::quantity_grid

◆ close_execution

NativeCloseExecution pineforge::native_run_spec_v3::NativeRunSpec::close_execution = NativeCloseExecution::NextEligiblePoint

◆ abort_reporting

NativeAbortReporting pineforge::native_run_spec_v3::NativeRunSpec::abort_reporting = NativeAbortReporting::Error

◆ max_abs_units

std::optional<double> pineforge::native_run_spec_v3::NativeRunSpec::max_abs_units

Definition at line 562 of file native_run_spec.hpp.

◆ max_open_lots

std::optional<std::uint64_t> pineforge::native_run_spec_v3::NativeRunSpec::max_open_lots

Definition at line 563 of file native_run_spec.hpp.

◆ allowed_open_directions

NativeOpenDirections pineforge::native_run_spec_v3::NativeRunSpec::allowed_open_directions = NativeOpenDirections::Both

◆ initial_margin_fraction

std::optional<double> pineforge::native_run_spec_v3::NativeRunSpec::initial_margin_fraction

Definition at line 565 of file native_run_spec.hpp.

◆ margin

std::optional<NativeMarginModel> pineforge::native_run_spec_v3::NativeRunSpec::margin

Opt-in generic margin model.

Mutually exclusive with initial_margin_fraction, which remains the one-scalar spelling. Folded into the continuation digest only when it is present, so a spec that declares none keeps its pre-margin-model identity byte for byte.

Definition at line 571 of file native_run_spec.hpp.

Referenced by pineforge::source::PineExecutionAdapter::project().

◆ risk

std::optional<NativeRiskLimits> pineforge::native_run_spec_v3::NativeRunSpec::risk

Opt-in generic account risk limits.

Absent is the whole default surface: nothing is measured, no risk event is appended, and the continuation digest is the pre-risk one. Folded into it only when the block is present, exactly as margin is.

Definition at line 576 of file native_run_spec.hpp.

◆ report_policy

NativeReportPolicy pineforge::native_run_spec_v3::NativeRunSpec::report_policy = NativeReportPolicy::HostRecorded

◆ report_open_position_at_end

bool pineforge::native_run_spec_v3::NativeRunSpec::report_open_position_at_end = false

Report a position still open at run end as a mark-to-market closed row at the last close.

KernelRecorded only, and reporting only: the live book, the realized sums and every hash are left exactly as the run left them. Inert under HostRecorded, whose host owns the whole report series.

Definition at line 582 of file native_run_spec.hpp.

◆ calculation

NativeCalculationTrigger pineforge::native_run_spec_v3::NativeRunSpec::calculation = NativeCalculationTrigger::BarClose

Calculation timing.

BarClose is the established cadence and the whole default surface; the other triggers only add calculations, never move or remove one. max_recalculations_per_point bounds the fill cascade at one matching point: further executions at that point are still applied and still delivered to on_native_applied, they just stop driving a new calculation. Zero is a legal bound and means "deliver, never recalculate". All three fold into the continuation hash only once the trigger or the open-bar view is non-default, so a spec that leaves the cadence alone keeps the continuation identity it had before these fields existed.

Definition at line 593 of file native_run_spec.hpp.

Referenced by pineforge::source::PineExecutionAdapter::project().

◆ max_recalculations_per_point

std::uint32_t pineforge::native_run_spec_v3::NativeRunSpec::max_recalculations_per_point = 8

◆ open_bar_view

NativeOpenBarView pineforge::native_run_spec_v3::NativeRunSpec::open_bar_view = NativeOpenBarView::Complete

Definition at line 595 of file native_run_spec.hpp.

◆ intrabar

IntrabarPath pineforge::native_run_spec_v3::NativeRunSpec::intrabar {}

◆ subscriptions

std::vector<NativeTimeframeSubscription> pineforge::native_run_spec_v3::NativeRunSpec::subscriptions

Declared higher-timeframe series.

Empty is the whole default surface: no evaluator is registered, no feed is prepared, and the run spec's continuation digest is the pre-subscription one.

Definition at line 600 of file native_run_spec.hpp.

◆ auxiliary_feed

std::optional<NativeAuxiliaryFeed> pineforge::native_run_spec_v3::NativeRunSpec::auxiliary_feed

Opt-in auxiliary finer feed.

Absent is the whole default surface: nothing is stored, nothing is routed, and the continuation digest is the pre-feed one. Folded into it only when the block is present, exactly as margin and risk are.

Definition at line 605 of file native_run_spec.hpp.

Referenced by main().


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