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

The run's generic risk ledger — the C spelling of NativeRiskState (L9). More...

#include <native_c_api.h>

Data Fields

uint32_t struct_size
 sizeof(pf_native_risk_state_v1).
 
uint32_t version
 PF_NATIVE_API_VERSION.
 
uint32_t blocked
 0/1: openings are refused right now.
 
uint32_t has_reason
 0/1: reason is meaningful.
 
uint32_t reason
 pf_native_risk_limit_t that blocked.
 
uint32_t has_day
 0/1: the ledger has reached a day.
 
uint32_t consecutive_loss_days
 Days that closed with a realized loss.
 
uint32_t reserved0
 
int64_t day_ordinal
 The risk day, on the spec's day basis.
 
uint64_t fills_today
 Applied fills counted in that day.
 
double peak_equity
 Running peak of the marked equity.
 
double day_open_equity
 Equity the current day opened at.
 

Detailed Description

The run's generic risk ledger — the C spelling of NativeRiskState (L9).

Every field is its zero for a run that declares no risk block, exactly as the C++ value is. blocked is whether openings are refused right now and reason names the limit that did it (valid only when has_reason); day_ordinal is the risk day the ledger is on, on the spec's own day basis, and is meaningful only when has_day. Observation only: reading it moves nothing.

Definition at line 964 of file native_c_api.h.

Field Documentation

◆ struct_size

uint32_t pf_native_risk_state_v1::struct_size

sizeof(pf_native_risk_state_v1).

Definition at line 965 of file native_c_api.h.

◆ version

uint32_t pf_native_risk_state_v1::version

PF_NATIVE_API_VERSION.

Definition at line 966 of file native_c_api.h.

◆ blocked

uint32_t pf_native_risk_state_v1::blocked

0/1: openings are refused right now.

Definition at line 967 of file native_c_api.h.

◆ has_reason

uint32_t pf_native_risk_state_v1::has_reason

0/1: reason is meaningful.

Definition at line 968 of file native_c_api.h.

◆ reason

uint32_t pf_native_risk_state_v1::reason

pf_native_risk_limit_t that blocked.

Definition at line 969 of file native_c_api.h.

◆ has_day

uint32_t pf_native_risk_state_v1::has_day

0/1: the ledger has reached a day.

Definition at line 970 of file native_c_api.h.

◆ consecutive_loss_days

uint32_t pf_native_risk_state_v1::consecutive_loss_days

Days that closed with a realized loss.

Definition at line 971 of file native_c_api.h.

◆ reserved0

uint32_t pf_native_risk_state_v1::reserved0

Definition at line 972 of file native_c_api.h.

◆ day_ordinal

int64_t pf_native_risk_state_v1::day_ordinal

The risk day, on the spec's day basis.

Definition at line 973 of file native_c_api.h.

◆ fills_today

uint64_t pf_native_risk_state_v1::fills_today

Applied fills counted in that day.

Definition at line 974 of file native_c_api.h.

◆ peak_equity

double pf_native_risk_state_v1::peak_equity

Running peak of the marked equity.

Definition at line 975 of file native_c_api.h.

◆ day_open_equity

double pf_native_risk_state_v1::day_open_equity

Equity the current day opened at.

Definition at line 976 of file native_c_api.h.


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