|
PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI 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. | |
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.
| 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.
| uint32_t pf_native_risk_state_v1::version |
PF_NATIVE_API_VERSION.
Definition at line 966 of file native_c_api.h.
| 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.
| uint32_t pf_native_risk_state_v1::has_reason |
0/1: reason is meaningful.
Definition at line 968 of file native_c_api.h.
| 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.
| 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.
| 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.
| uint32_t pf_native_risk_state_v1::reserved0 |
Definition at line 972 of file native_c_api.h.
| 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.
| 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.
| double pf_native_risk_state_v1::peak_equity |
Running peak of the marked equity.
Definition at line 975 of file native_c_api.h.
| 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.