PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
execution_projection.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "execution.hpp"
4#include <cstddef>
5#include <cstdint>
6
7namespace pineforge::execution {
8inline namespace settlement_projection_v1 {
9
10// Non-applying physical+account quote of one Action+Fill against the live book.
11// Destroyed when the caller is done sizing. Not commit authority.
14
15 // Same physical aggregates SettlementInspection reports for this Action.
16 double closed_units = 0.0;
17 double opened_units = 0.0;
18 double resulting_abs_units = 0.0;
19 std::size_t resulting_lot_count = 0;
21 double current_ticket = 0.0;
22 bool would_open = false;
23 bool incoming_short = false;
24
25 // Account facts SettlementInspection lacks. Units are account currency.
26 // Copy net_profit_sum_, add each projected close-row pnl in roster order,
27 // then add initial_capital_. Do not sum rows first or regroup.
28 double realized_balance = 0.0;
29 // All paid costs on the projected resulting open book, including a
30 // prospective opening lot's allocated current-ticket share. 0 when empty.
32 // Start from realized_balance; add each resulting lot's marked pnl minus
33 // its paid remaining entry cost in roster order at fill.price. Do not
34 // subtract opening cost twice.
35 double marked_equity = 0.0;
36 // 0 if projected book empty. Else the live position_cycle_seq_ when
37 // survivors remain. If would_open from flat or after emptying the old
38 // side, the peeked next_position_cycle_seq_ (NOT consumed).
39 std::int64_t cycle_after = 0;
40 // Signed resulting units (short negative). 0 when empty.
41 double signed_units_after = 0.0;
42};
43
44} // inline namespace settlement_projection_v1
45} // namespace pineforge::execution