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

The run-specification fields pf_native_run_spec_v1 predates. More...

#include <native_c_api.h>

Data Fields

uint32_t struct_size
 sizeof(pf_native_run_spec_ext_v1).
 
uint32_t version
 PF_NATIVE_API_VERSION.
 
uint32_t present_mask
 pf_native_spec_ext_mask_t bits.
 
uint32_t report_policy
 NativeReportPolicy.
 
uint32_t report_open_position_at_end
 0/1; KernelRecorded only.
 
uint32_t price_grid
 NativePriceGrid.
 
uint32_t grid_rounding
 NativeGridRounding.
 
uint32_t calculation
 NativeCalculationTrigger.
 
uint32_t max_recalculations_per_point
 Fill-cascade bound; 0 is legal.
 
uint32_t open_bar_view
 NativeOpenBarView.
 
uint32_t margin_sizing
 NativeLiquidationSizing.
 
uint32_t margin_check
 pf_native_liquidation_check_t.
 
uint32_t margin_has_maintenance_long
 
uint32_t margin_has_maintenance_short
 
uint32_t margin_has_min_units
 
double margin_initial_long
 0 = maintenance-only side: no kernel opening requirement, host owns admission; legal only with that side's maintenance set.
 
double margin_initial_short
 0 = maintenance-only; see above.
 
double margin_maintenance_long
 
double margin_maintenance_short
 
double margin_shortfall_multiple
 The C++ default is 1.0, not 0: a PRESENT block has every field read, so a zero-filled struct must still write it — including under a sizing policy that never scales.
 
double margin_min_units
 
const pf_native_subscription_v1subscriptions
 Borrowed for the call.
 
uint32_t subscriptions_n
 
uint32_t reserved0
 
uint32_t risk_has_max_drawdown
 0/1.
 
uint32_t risk_max_drawdown_percent
 0/1: the value is a percent of the running equity peak, out of 100.
 
double risk_max_drawdown
 Threshold; account currency unless percent.
 
uint32_t risk_has_max_intraday_loss
 0/1.
 
uint32_t risk_max_intraday_loss_percent
 0/1: percent of the day's opening equity.
 
double risk_max_intraday_loss
 Threshold; account currency unless percent.
 
uint32_t risk_has_max_consecutive_loss_days
 0/1.
 
uint32_t risk_max_consecutive_loss_days
 Days, when the flag is 1.
 
uint32_t risk_has_max_fills_per_day
 0/1.
 
uint32_t risk_max_fills_per_day
 Applied fills, when the flag is 1.
 
uint32_t risk_day_basis
 pf_native_risk_day_t.
 
uint32_t risk_action
 pf_native_risk_action_t.
 
uint32_t intrabar_kind
 pf_native_intrabar_kind_t.
 
int32_t intrabar_samples
 Samples per script bar; LOWER_TF and SYNTHESIZED.
 
uint32_t intrabar_distribution
 pf_magnifier_distribution_t.
 
uint32_t intrabar_volume_weighted
 0/1.
 
int32_t intrabar_volume_weighted_min_samples
 
int32_t intrabar_volume_weighted_max_samples
 
uint32_t intrabar_sample_eligibility
 pf_native_sample_eligibility_t, LOWER_TF only.
 
int32_t intrabar_n
 Length of intrabar_bars; LOWER_TF only.
 
const char * intrabar_tf
 The finer timeframe; LOWER_TF only, non-NULL.
 
const pf_bar_tintrabar_bars
 The finer feed; borrowed for the call, copied.
 
uint32_t slot_label_policy
 pf_native_slot_label_t.
 
uint32_t feed_tolerance
 pf_native_feed_tolerance_t bits.
 
uint32_t path_order
 pf_native_path_order_t.
 
uint32_t abort_reporting
 pf_native_abort_reporting_t.
 
uint32_t margin_equity_basis
 pf_native_margin_equity_basis_t.
 
uint32_t margin_level_base
 pf_native_margin_level_base_t.
 
const char * margin_liquidation_label
 Ticket of a kernel liquidation; NULL is "".
 
const char * margin_liquidation_comment
 Comment of the same; NULL is "".
 
const char * auxiliary_tf
 Non-NULL feed timeframe literal.
 
const pf_bar_tauxiliary_bars
 Strictly increasing bars; copied.
 
int32_t auxiliary_n
 Length of auxiliary_bars.
 
uint32_t reserved1
 Must be 0.
 
const uint32_t * subscription_sources
 Optional, borrowed for the call: subscriptions_n entries of pf_native_series_source_t, one per row of subscriptions.
 

Detailed Description

The run-specification fields pf_native_run_spec_v1 predates.

It is a companion to pf_native_run_spec_v1, not a second configure step: the kernel configures a host exactly once, so both halves are handed to strategy_configure_native_ext_v1 together and that call replaces strategy_configure_native_v1 for a host that needs these fields. present_mask selects the blocks that are meaningful; an absent block keeps the kernel's own default, so an all-zero mask configures exactly what strategy_configure_native_v1 would have.

Every field of NativeRunSpec that is not fixed by pf_native_run_spec_v1 now travels here. The one deliberate omission is identity, which the base spec owns.

This struct has FOUR published layouts and the runtime accepts any of them: the base layout the L13 lane first shipped (PF_NATIVE_RUN_SPEC_EXT_V1_BASE_SIZE); that layout plus L9's risk_* tail (PF_NATIVE_RUN_SPEC_EXT_V1_RISK_SIZE); that one plus N8's intrabar path, the four feed-shape and presentation policies, and the margin model's equity basis, level base and liquidation strings (PF_NATIVE_RUN_SPEC_EXT_V1_POLICY_SIZE); and the current one, which appends the auxiliary_* tail after them. A caller compiled against an earlier layout keeps working unchanged and simply cannot set the mask bits its struct has no fields for (PF_NATIVE_SPEC_EXT_RISK, PF_NATIVE_SPEC_EXT_INTRABAR, PF_NATIVE_SPEC_EXT_FEED_POLICY, PF_NATIVE_SPEC_EXT_AUXILIARY_FEED): doing so is PF_NATIVE_E_STRUCT. Any other struct_size is PF_NATIVE_E_STRUCT too. Every tail is append-only: nothing above them moved.

Definition at line 1118 of file native_c_api.h.

Field Documentation

◆ struct_size

uint32_t pf_native_run_spec_ext_v1::struct_size

sizeof(pf_native_run_spec_ext_v1).

Definition at line 1119 of file native_c_api.h.

Referenced by make_ext().

◆ version

uint32_t pf_native_run_spec_ext_v1::version

PF_NATIVE_API_VERSION.

Definition at line 1120 of file native_c_api.h.

Referenced by make_ext().

◆ present_mask

uint32_t pf_native_run_spec_ext_v1::present_mask

pf_native_spec_ext_mask_t bits.

Definition at line 1121 of file native_c_api.h.

Referenced by make_ext().

◆ report_policy

uint32_t pf_native_run_spec_ext_v1::report_policy

NativeReportPolicy.

Definition at line 1123 of file native_c_api.h.

◆ report_open_position_at_end

uint32_t pf_native_run_spec_ext_v1::report_open_position_at_end

0/1; KernelRecorded only.

Definition at line 1124 of file native_c_api.h.

◆ price_grid

uint32_t pf_native_run_spec_ext_v1::price_grid

NativePriceGrid.

Definition at line 1126 of file native_c_api.h.

Referenced by make_ext().

◆ grid_rounding

uint32_t pf_native_run_spec_ext_v1::grid_rounding

NativeGridRounding.

Definition at line 1127 of file native_c_api.h.

Referenced by make_ext().

◆ calculation

uint32_t pf_native_run_spec_ext_v1::calculation

NativeCalculationTrigger.

Definition at line 1129 of file native_c_api.h.

◆ max_recalculations_per_point

uint32_t pf_native_run_spec_ext_v1::max_recalculations_per_point

Fill-cascade bound; 0 is legal.

Definition at line 1130 of file native_c_api.h.

◆ open_bar_view

uint32_t pf_native_run_spec_ext_v1::open_bar_view

NativeOpenBarView.

Definition at line 1132 of file native_c_api.h.

◆ margin_sizing

uint32_t pf_native_run_spec_ext_v1::margin_sizing

NativeLiquidationSizing.

Definition at line 1134 of file native_c_api.h.

◆ margin_check

uint32_t pf_native_run_spec_ext_v1::margin_check

pf_native_liquidation_check_t.

Definition at line 1135 of file native_c_api.h.

◆ margin_has_maintenance_long

uint32_t pf_native_run_spec_ext_v1::margin_has_maintenance_long

Definition at line 1136 of file native_c_api.h.

◆ margin_has_maintenance_short

uint32_t pf_native_run_spec_ext_v1::margin_has_maintenance_short

Definition at line 1137 of file native_c_api.h.

◆ margin_has_min_units

uint32_t pf_native_run_spec_ext_v1::margin_has_min_units

Definition at line 1138 of file native_c_api.h.

◆ margin_initial_long

double pf_native_run_spec_ext_v1::margin_initial_long

0 = maintenance-only side: no kernel opening requirement, host owns admission; legal only with that side's maintenance set.

Definition at line 1139 of file native_c_api.h.

◆ margin_initial_short

double pf_native_run_spec_ext_v1::margin_initial_short

0 = maintenance-only; see above.

Definition at line 1143 of file native_c_api.h.

◆ margin_maintenance_long

double pf_native_run_spec_ext_v1::margin_maintenance_long

Definition at line 1144 of file native_c_api.h.

◆ margin_maintenance_short

double pf_native_run_spec_ext_v1::margin_maintenance_short

Definition at line 1145 of file native_c_api.h.

◆ margin_shortfall_multiple

double pf_native_run_spec_ext_v1::margin_shortfall_multiple

The C++ default is 1.0, not 0: a PRESENT block has every field read, so a zero-filled struct must still write it — including under a sizing policy that never scales.

Definition at line 1146 of file native_c_api.h.

◆ margin_min_units

double pf_native_run_spec_ext_v1::margin_min_units

Definition at line 1151 of file native_c_api.h.

◆ subscriptions

const pf_native_subscription_v1* pf_native_run_spec_ext_v1::subscriptions

Borrowed for the call.

Definition at line 1153 of file native_c_api.h.

◆ subscriptions_n

uint32_t pf_native_run_spec_ext_v1::subscriptions_n

Definition at line 1154 of file native_c_api.h.

◆ reserved0

uint32_t pf_native_run_spec_ext_v1::reserved0

Definition at line 1155 of file native_c_api.h.

◆ risk_has_max_drawdown

uint32_t pf_native_run_spec_ext_v1::risk_has_max_drawdown

0/1.

Definition at line 1162 of file native_c_api.h.

◆ risk_max_drawdown_percent

uint32_t pf_native_run_spec_ext_v1::risk_max_drawdown_percent

0/1: the value is a percent of the running equity peak, out of 100.

Definition at line 1163 of file native_c_api.h.

◆ risk_max_drawdown

double pf_native_run_spec_ext_v1::risk_max_drawdown

Threshold; account currency unless percent.

Definition at line 1165 of file native_c_api.h.

◆ risk_has_max_intraday_loss

uint32_t pf_native_run_spec_ext_v1::risk_has_max_intraday_loss

0/1.

Definition at line 1166 of file native_c_api.h.

◆ risk_max_intraday_loss_percent

uint32_t pf_native_run_spec_ext_v1::risk_max_intraday_loss_percent

0/1: percent of the day's opening equity.

Definition at line 1167 of file native_c_api.h.

◆ risk_max_intraday_loss

double pf_native_run_spec_ext_v1::risk_max_intraday_loss

Threshold; account currency unless percent.

Definition at line 1168 of file native_c_api.h.

◆ risk_has_max_consecutive_loss_days

uint32_t pf_native_run_spec_ext_v1::risk_has_max_consecutive_loss_days

0/1.

Definition at line 1169 of file native_c_api.h.

◆ risk_max_consecutive_loss_days

uint32_t pf_native_run_spec_ext_v1::risk_max_consecutive_loss_days

Days, when the flag is 1.

Definition at line 1170 of file native_c_api.h.

◆ risk_has_max_fills_per_day

uint32_t pf_native_run_spec_ext_v1::risk_has_max_fills_per_day

0/1.

Definition at line 1171 of file native_c_api.h.

◆ risk_max_fills_per_day

uint32_t pf_native_run_spec_ext_v1::risk_max_fills_per_day

Applied fills, when the flag is 1.

Definition at line 1172 of file native_c_api.h.

◆ risk_day_basis

uint32_t pf_native_run_spec_ext_v1::risk_day_basis

pf_native_risk_day_t.

Definition at line 1173 of file native_c_api.h.

◆ risk_action

uint32_t pf_native_run_spec_ext_v1::risk_action

pf_native_risk_action_t.

Definition at line 1174 of file native_c_api.h.

◆ intrabar_kind

uint32_t pf_native_run_spec_ext_v1::intrabar_kind

pf_native_intrabar_kind_t.

Definition at line 1182 of file native_c_api.h.

◆ intrabar_samples

int32_t pf_native_run_spec_ext_v1::intrabar_samples

Samples per script bar; LOWER_TF and SYNTHESIZED.

Definition at line 1183 of file native_c_api.h.

◆ intrabar_distribution

uint32_t pf_native_run_spec_ext_v1::intrabar_distribution

pf_magnifier_distribution_t.

Definition at line 1184 of file native_c_api.h.

◆ intrabar_volume_weighted

uint32_t pf_native_run_spec_ext_v1::intrabar_volume_weighted

0/1.

Definition at line 1185 of file native_c_api.h.

◆ intrabar_volume_weighted_min_samples

int32_t pf_native_run_spec_ext_v1::intrabar_volume_weighted_min_samples

Definition at line 1186 of file native_c_api.h.

◆ intrabar_volume_weighted_max_samples

int32_t pf_native_run_spec_ext_v1::intrabar_volume_weighted_max_samples

Definition at line 1187 of file native_c_api.h.

◆ intrabar_sample_eligibility

uint32_t pf_native_run_spec_ext_v1::intrabar_sample_eligibility

pf_native_sample_eligibility_t, LOWER_TF only.

Definition at line 1188 of file native_c_api.h.

◆ intrabar_n

int32_t pf_native_run_spec_ext_v1::intrabar_n

Length of intrabar_bars; LOWER_TF only.

Definition at line 1189 of file native_c_api.h.

◆ intrabar_tf

const char* pf_native_run_spec_ext_v1::intrabar_tf

The finer timeframe; LOWER_TF only, non-NULL.

Definition at line 1190 of file native_c_api.h.

◆ intrabar_bars

const pf_bar_t* pf_native_run_spec_ext_v1::intrabar_bars

The finer feed; borrowed for the call, copied.

Definition at line 1191 of file native_c_api.h.

◆ slot_label_policy

uint32_t pf_native_run_spec_ext_v1::slot_label_policy

pf_native_slot_label_t.

FEED_TOLERANT keeps the caller's own labels, and a PF_NATIVE_INTRABAR_LOWER_TF path then delivers no sub-bar: its bars are not keyed to canonical input slots.

Definition at line 1193 of file native_c_api.h.

◆ feed_tolerance

uint32_t pf_native_run_spec_ext_v1::feed_tolerance

pf_native_feed_tolerance_t bits.

Definition at line 1198 of file native_c_api.h.

◆ path_order

uint32_t pf_native_run_spec_ext_v1::path_order

pf_native_path_order_t.

Definition at line 1199 of file native_c_api.h.

◆ abort_reporting

uint32_t pf_native_run_spec_ext_v1::abort_reporting

pf_native_abort_reporting_t.

Definition at line 1200 of file native_c_api.h.

◆ margin_equity_basis

uint32_t pf_native_run_spec_ext_v1::margin_equity_basis

pf_native_margin_equity_basis_t.

Definition at line 1202 of file native_c_api.h.

◆ margin_level_base

uint32_t pf_native_run_spec_ext_v1::margin_level_base

pf_native_margin_level_base_t.

Definition at line 1203 of file native_c_api.h.

◆ margin_liquidation_label

const char* pf_native_run_spec_ext_v1::margin_liquidation_label

Ticket of a kernel liquidation; NULL is "".

Definition at line 1204 of file native_c_api.h.

◆ margin_liquidation_comment

const char* pf_native_run_spec_ext_v1::margin_liquidation_comment

Comment of the same; NULL is "".

Definition at line 1205 of file native_c_api.h.

◆ auxiliary_tf

const char* pf_native_run_spec_ext_v1::auxiliary_tf

Non-NULL feed timeframe literal.

Definition at line 1213 of file native_c_api.h.

◆ auxiliary_bars

const pf_bar_t* pf_native_run_spec_ext_v1::auxiliary_bars

Strictly increasing bars; copied.

May be NULL when auxiliary_n is 0.

Definition at line 1214 of file native_c_api.h.

◆ auxiliary_n

int32_t pf_native_run_spec_ext_v1::auxiliary_n

Length of auxiliary_bars.

Definition at line 1216 of file native_c_api.h.

◆ reserved1

uint32_t pf_native_run_spec_ext_v1::reserved1

Must be 0.

Definition at line 1217 of file native_c_api.h.

◆ subscription_sources

const uint32_t* pf_native_run_spec_ext_v1::subscription_sources

Optional, borrowed for the call: subscriptions_n entries of pf_native_series_source_t, one per row of subscriptions.

NULL means every series is built from the input. Meaningful only together with PF_NATIVE_SPEC_EXT_SUBSCRIPTIONS.

Definition at line 1222 of file native_c_api.h.


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