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

The run's generic risk ledger (L9), as the kernel holds it. More...

#include <native_host.hpp>

Data Fields

bool blocked = false
 
std::optional< native_order::RiskLimitKindreason
 
bool has_day = false
 
std::int64_t day_ordinal = 0
 
std::uint64_t fills_today = 0
 
std::uint32_t consecutive_loss_days = 0
 
double peak_equity = 0.0
 
double day_open_equity = 0.0
 

Detailed Description

The run's generic risk ledger (L9), as the kernel holds it.

Every field is zero / absent for a run that declares no NativeRunSpec::risk.

blocked is whether openings are refused right now, and reason names the limit that did it — a drawdown or consecutive-loss-days block lasts to the end of the run, the two intraday blocks to the end of their own day. day_ordinal is the risk day the ledger is on (the spec's own day basis), fills_today the applied fills counted in it, consecutive_loss_days the streak of days that closed with a realized loss, peak_equity the running peak of the marked equity and day_open_equity the equity the current day opened at. has_day is false before the first evaluated point.

Definition at line 585 of file native_host.hpp.

Field Documentation

◆ blocked

bool pineforge::engine_script_run_v18::NativeRiskState::blocked = false

Definition at line 586 of file native_host.hpp.

◆ reason

std::optional<native_order::RiskLimitKind> pineforge::engine_script_run_v18::NativeRiskState::reason

Definition at line 587 of file native_host.hpp.

◆ has_day

bool pineforge::engine_script_run_v18::NativeRiskState::has_day = false

Definition at line 588 of file native_host.hpp.

◆ day_ordinal

std::int64_t pineforge::engine_script_run_v18::NativeRiskState::day_ordinal = 0

Definition at line 589 of file native_host.hpp.

◆ fills_today

std::uint64_t pineforge::engine_script_run_v18::NativeRiskState::fills_today = 0

Definition at line 590 of file native_host.hpp.

◆ consecutive_loss_days

std::uint32_t pineforge::engine_script_run_v18::NativeRiskState::consecutive_loss_days = 0

Definition at line 591 of file native_host.hpp.

◆ peak_equity

double pineforge::engine_script_run_v18::NativeRiskState::peak_equity = 0.0

Definition at line 592 of file native_host.hpp.

◆ day_open_equity

double pineforge::engine_script_run_v18::NativeRiskState::day_open_equity = 0.0

Definition at line 593 of file native_host.hpp.


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