PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
Status codes

Every int-returning symbol here answers 0 or one of these. More...

Macros

#define PF_NATIVE_OK   0
 Success.
 
#define PF_NATIVE_E_HANDLE   -1
 NULL handle, or not a C-callback native host.
 
#define PF_NATIVE_E_STRUCT   -2
 struct_size / version mismatch.
 
#define PF_NATIVE_E_TAG   -3
 An enum field outside its enumeration.
 
#define PF_NATIVE_E_ARGUMENT   -4
 NULL output, negative count, out-of-range index.
 
#define PF_NATIVE_E_STATE   -5
 Illegal here: the command legality rule, or the kernel's own lifecycle, refused it.
 
#define PF_NATIVE_E_REJECTED   -6
 The kernel rejected the request (reason written out).
 
#define PF_NATIVE_E_UNSUPPORTED   -7
 A tag this API version cannot represent.
 
#define PF_NATIVE_E_EXCEPTION   -8
 A C++ exception was contained at the boundary.
 
#define PF_NATIVE_E_NOT_WORKING   -9
 A nonzero target incarnation is not live, whether it was retired or never issued.
 
#define PF_NATIVE_E_INVALID_TARGET   -10
 Malformed target: incarnation 0.
 
#define PF_NATIVE_E_RUN_FAILED   -11
 The run did not reach Completed; read the state.
 
#define PF_NATIVE_E_REFUSED   -12
 execute_current refused; see pf_native_refusal_e.
 
#define PF_NATIVE_ABSENT   1
 Non-negative outcome: the kernel HAS no answer here and the output was left at its documented empty.
 

Detailed Description

Every int-returning symbol here answers 0 or one of these.

Negative values are errors. A C-layer validation refusal does not mutate native run state; a kernel-origin refusal can latch Failed, as the configure-reuse and reentrant-append contracts below specify. Non-negative values are outcomes: 0 is success everywhere, and strategy_native_execute_current_v1 additionally answers the positive pf_native_execute_outcome_t codes.

Macro Definition Documentation

◆ PF_NATIVE_OK

#define PF_NATIVE_OK   0

Success.

Definition at line 306 of file native_c_api.h.

Referenced by grid_without_a_ladder_is_refused(), main(), on_bar(), on_bar(), run_mode(), and submit().

◆ PF_NATIVE_E_HANDLE

#define PF_NATIVE_E_HANDLE   -1

NULL handle, or not a C-callback native host.

Definition at line 307 of file native_c_api.h.

◆ PF_NATIVE_E_STRUCT

#define PF_NATIVE_E_STRUCT   -2

struct_size / version mismatch.

Definition at line 308 of file native_c_api.h.

◆ PF_NATIVE_E_TAG

#define PF_NATIVE_E_TAG   -3

An enum field outside its enumeration.

Definition at line 309 of file native_c_api.h.

◆ PF_NATIVE_E_ARGUMENT

#define PF_NATIVE_E_ARGUMENT   -4

NULL output, negative count, out-of-range index.

Definition at line 310 of file native_c_api.h.

◆ PF_NATIVE_E_STATE

#define PF_NATIVE_E_STATE   -5

Illegal here: the command legality rule, or the kernel's own lifecycle, refused it.

Definition at line 311 of file native_c_api.h.

◆ PF_NATIVE_E_REJECTED

#define PF_NATIVE_E_REJECTED   -6

The kernel rejected the request (reason written out).

Definition at line 313 of file native_c_api.h.

◆ PF_NATIVE_E_UNSUPPORTED

#define PF_NATIVE_E_UNSUPPORTED   -7

A tag this API version cannot represent.

Definition at line 314 of file native_c_api.h.

◆ PF_NATIVE_E_EXCEPTION

#define PF_NATIVE_E_EXCEPTION   -8

A C++ exception was contained at the boundary.

Definition at line 315 of file native_c_api.h.

◆ PF_NATIVE_E_NOT_WORKING

#define PF_NATIVE_E_NOT_WORKING   -9

A nonzero target incarnation is not live, whether it was retired or never issued.

Definition at line 316 of file native_c_api.h.

◆ PF_NATIVE_E_INVALID_TARGET

#define PF_NATIVE_E_INVALID_TARGET   -10

Malformed target: incarnation 0.

C commands pair an incarnation with this handle's current run identity, so they cannot pass a foreign run identity.

Definition at line 317 of file native_c_api.h.

◆ PF_NATIVE_E_RUN_FAILED

#define PF_NATIVE_E_RUN_FAILED   -11

The run did not reach Completed; read the state.

Definition at line 318 of file native_c_api.h.

◆ PF_NATIVE_E_REFUSED

#define PF_NATIVE_E_REFUSED   -12

execute_current refused; see pf_native_refusal_e.

Definition at line 319 of file native_c_api.h.

◆ PF_NATIVE_ABSENT

#define PF_NATIVE_ABSENT   1

Non-negative outcome: the kernel HAS no answer here and the output was left at its documented empty.

It is not an error — the C++ spelling of each accessor that returns it is a std::optional, whose empty is a legitimate answer (no path walk, an unarmed trail, a series that has not delivered, a run with no margin model). Only the accessors whose own documentation names it can return it; strategy_native_execute_current_v1 never does, its positive codes being pf_native_execute_outcome_t.

Definition at line 327 of file native_c_api.h.