|
PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
|
One live request, copied out by strategy_native_working_get_v1. More...
#include <native_c_api.h>
Data Fields | |
| uint32_t | struct_size |
| sizeof(pf_native_working_v1). | |
| uint32_t | version |
| PF_NATIVE_API_VERSION. | |
| uint64_t | incarnation |
| The request's handle. | |
| uint32_t | intent |
| pf_native_intent_t as accepted. | |
| uint32_t | trigger |
| pf_native_trigger_t as accepted. | |
| uint32_t | owner |
| pf_native_owner_t as accepted. | |
| uint32_t | capacity |
| pf_native_capacity_t as accepted. | |
| uint32_t | group_kind |
| pf_native_group_t as accepted. | |
| uint32_t | group_effect |
| pf_native_group_effect_t, 0 when no group. | |
| uint32_t | remaining_kind |
| pf_native_remaining_t. | |
| uint32_t | trigger_state |
| pf_native_trigger_state_t. | |
| uint32_t | origin |
| pf_native_origin_t. | |
| uint32_t | reserved0 |
| double | intent_value |
| The intent's own scalar, 0 when it has none. | |
| double | p1 |
| Trigger level 1 (limit / stop / trail offset). | |
| double | p2 |
Trigger level 2 (stop-limit limit / trail arm when trail_has_arm_price). | |
| double | capacity_units |
| Point budget, 0 for immediate capacity. | |
| double | remaining_units |
Valid when remaining_kind is UNITS. | |
| uint64_t | group_id |
| int64_t | group_cohort |
| uint64_t | acceptance_ordinal |
| Birth: the accepting event. | |
| int64_t | decision_time_lower_bound |
| Birth: earliest matchable time. | |
| const char * | label |
| Borrowed; see the struct note. | |
| const char * | comment |
| Borrowed; see the struct note. | |
| uint32_t | trail_has_arm_price |
TRAIL: 1 when p2 is the arm price, 0 when the trail carries none. | |
| uint32_t | reserved1 |
| Always 0. | |
| uint32_t | anchor |
| pf_native_anchor_t as the request stands. | |
| uint32_t | anchor_rounding |
| pf_native_anchor_rounding_t, FROM_OWNER_FILL only. | |
| double | anchor_offset |
| FROM_OWNER_FILL: the signed offset, price units. | |
| uint64_t | owner_handle |
| WAIT_FOR_APPLIED: the parent; BIND_OPENING: the opening; BIND_OPENINGS: the first of them as the kernel ordered the list; BIND_COHORT: the cohort; 0 for INDEPENDENT. | |
| int64_t | owner_cycle |
| BIND_OPENING / BIND_OPENINGS: the bound cycle. | |
| uint32_t | owner_n |
| How many owner handles the relation names. | |
| uint32_t | visibility |
| pf_native_arm_visibility_t, WAIT_FOR_APPLIED only. | |
| uint32_t | arm_first_match |
| pf_native_arm_first_match_t, WAIT_FOR_APPLIED only. | |
| uint32_t | arm_scope |
| pf_native_arm_scope_t, WAIT_FOR_APPLIED only. | |
One live request, copied out by strategy_native_working_get_v1.
label and comment borrow the snapshot taken by the most recent strategy_native_working_len_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.
This readout has THREE published layouts and the runtime fills any: the base layout the L13 lane first shipped (PF_NATIVE_WORKING_V1_BASE_SIZE), that plus trail_has_arm_price (PF_NATIVE_WORKING_V1_ARM_SIZE), and the current one, which appends the anchor and the owner relation. A caller compiled against an earlier layout keeps working unchanged: its row is written up to its own length and never past it. Any other struct_size is PF_NATIVE_E_STRUCT.
The relation tail is the request's own anchor and owner as the kernel holds them now: an anchored leg reads FROM_OWNER_FILL, its rounding and its offset (a tick-spelled one already resolved to price units at acceptance) until its owner fills, and ABSOLUTE with the installed level in p1 / p2 after; the owner relation names the owner handle, how many there are and the bound cycle, and a WAIT_FOR_APPLIED child's visibility, first-match rule and scope.
trail_has_arm_price is the request's own flag read back, so a TRAIL with no arm price and one armed at 0.0 are two different rows even though both read p2 = 0. An anchored trail (PF_NATIVE_ANCHOR_FROM_OWNER_FILL) reads back the spelling it was submitted with until its owner fills; the arm then installs the level, and from there it reads 1 with that level in p2. A tick-spelled offset needs no such flag: acceptance resolves it into p1 as a price distance.
Definition at line 1687 of file native_c_api.h.
| uint32_t pf_native_working_v1::struct_size |
sizeof(pf_native_working_v1).
Definition at line 1688 of file native_c_api.h.
| uint32_t pf_native_working_v1::version |
PF_NATIVE_API_VERSION.
Definition at line 1689 of file native_c_api.h.
| uint64_t pf_native_working_v1::incarnation |
The request's handle.
Definition at line 1690 of file native_c_api.h.
| uint32_t pf_native_working_v1::intent |
pf_native_intent_t as accepted.
Definition at line 1691 of file native_c_api.h.
| uint32_t pf_native_working_v1::trigger |
pf_native_trigger_t as accepted.
Definition at line 1692 of file native_c_api.h.
| uint32_t pf_native_working_v1::owner |
pf_native_owner_t as accepted.
Definition at line 1693 of file native_c_api.h.
| uint32_t pf_native_working_v1::capacity |
pf_native_capacity_t as accepted.
Definition at line 1694 of file native_c_api.h.
| uint32_t pf_native_working_v1::group_kind |
pf_native_group_t as accepted.
Definition at line 1695 of file native_c_api.h.
| uint32_t pf_native_working_v1::group_effect |
pf_native_group_effect_t, 0 when no group.
Definition at line 1696 of file native_c_api.h.
| uint32_t pf_native_working_v1::remaining_kind |
Definition at line 1697 of file native_c_api.h.
| uint32_t pf_native_working_v1::trigger_state |
Definition at line 1698 of file native_c_api.h.
| uint32_t pf_native_working_v1::origin |
Definition at line 1699 of file native_c_api.h.
| uint32_t pf_native_working_v1::reserved0 |
Definition at line 1700 of file native_c_api.h.
| double pf_native_working_v1::intent_value |
The intent's own scalar, 0 when it has none.
Definition at line 1701 of file native_c_api.h.
| double pf_native_working_v1::p1 |
Trigger level 1 (limit / stop / trail offset).
Definition at line 1702 of file native_c_api.h.
| double pf_native_working_v1::p2 |
Trigger level 2 (stop-limit limit / trail arm when trail_has_arm_price).
Definition at line 1703 of file native_c_api.h.
| double pf_native_working_v1::capacity_units |
Point budget, 0 for immediate capacity.
Definition at line 1705 of file native_c_api.h.
| double pf_native_working_v1::remaining_units |
Valid when remaining_kind is UNITS.
Definition at line 1706 of file native_c_api.h.
| uint64_t pf_native_working_v1::group_id |
Definition at line 1707 of file native_c_api.h.
| int64_t pf_native_working_v1::group_cohort |
Definition at line 1708 of file native_c_api.h.
| uint64_t pf_native_working_v1::acceptance_ordinal |
Birth: the accepting event.
Definition at line 1709 of file native_c_api.h.
| int64_t pf_native_working_v1::decision_time_lower_bound |
Birth: earliest matchable time.
Definition at line 1710 of file native_c_api.h.
| const char* pf_native_working_v1::label |
Borrowed; see the struct note.
Definition at line 1711 of file native_c_api.h.
| const char* pf_native_working_v1::comment |
Borrowed; see the struct note.
Definition at line 1712 of file native_c_api.h.
| uint32_t pf_native_working_v1::trail_has_arm_price |
TRAIL: 1 when p2 is the arm price, 0 when the trail carries none.
0 for every other trigger.
Definition at line 1717 of file native_c_api.h.
| uint32_t pf_native_working_v1::reserved1 |
Always 0.
Definition at line 1720 of file native_c_api.h.
| uint32_t pf_native_working_v1::anchor |
pf_native_anchor_t as the request stands.
Definition at line 1724 of file native_c_api.h.
| uint32_t pf_native_working_v1::anchor_rounding |
pf_native_anchor_rounding_t, FROM_OWNER_FILL only.
Definition at line 1725 of file native_c_api.h.
| double pf_native_working_v1::anchor_offset |
FROM_OWNER_FILL: the signed offset, price units.
Definition at line 1726 of file native_c_api.h.
| uint64_t pf_native_working_v1::owner_handle |
WAIT_FOR_APPLIED: the parent; BIND_OPENING: the opening; BIND_OPENINGS: the first of them as the kernel ordered the list; BIND_COHORT: the cohort; 0 for INDEPENDENT.
Definition at line 1727 of file native_c_api.h.
| int64_t pf_native_working_v1::owner_cycle |
BIND_OPENING / BIND_OPENINGS: the bound cycle.
Definition at line 1731 of file native_c_api.h.
| uint32_t pf_native_working_v1::owner_n |
How many owner handles the relation names.
Definition at line 1732 of file native_c_api.h.
| uint32_t pf_native_working_v1::visibility |
pf_native_arm_visibility_t, WAIT_FOR_APPLIED only.
Definition at line 1733 of file native_c_api.h.
| uint32_t pf_native_working_v1::arm_first_match |
pf_native_arm_first_match_t, WAIT_FOR_APPLIED only.
Definition at line 1734 of file native_c_api.h.
| uint32_t pf_native_working_v1::arm_scope |
pf_native_arm_scope_t, WAIT_FOR_APPLIED only.
Definition at line 1735 of file native_c_api.h.