PineForge v0.13.1-379-g9b50973
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
 The target handle is no longer a live request.
 
#define PF_NATIVE_E_INVALID_TARGET   -10
 The target handle was never issued by this run.
 
#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 and never mutate run state. 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 202 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 203 of file native_c_api.h.

◆ PF_NATIVE_E_STRUCT

#define PF_NATIVE_E_STRUCT   -2

struct_size / version mismatch.

Definition at line 204 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 205 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 206 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 207 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 209 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 210 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 211 of file native_c_api.h.

◆ PF_NATIVE_E_NOT_WORKING

#define PF_NATIVE_E_NOT_WORKING   -9

The target handle is no longer a live request.

Definition at line 212 of file native_c_api.h.

◆ PF_NATIVE_E_INVALID_TARGET

#define PF_NATIVE_E_INVALID_TARGET   -10

The target handle was never issued by this run.

Definition at line 213 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 214 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 215 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 223 of file native_c_api.h.