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
7
namespace
pineforge::execution
{
8
inline
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.
12
struct
AccountEffectProjection
{
13
Status
status
=
Status::NoEffect
;
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;
20
double
resulting_abs_notional
= 0.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.
31
double
remaining_entry_cost
= 0.0;
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
execution.hpp
pineforge::execution::settlement_projection_v1
Definition
execution_projection.hpp:8
pineforge::execution
Definition
execution.hpp:12
pineforge::execution::Status
Status
Definition
execution.hpp:55
pineforge::execution::Status::NoEffect
@ NoEffect
Definition
execution.hpp:56
pineforge::execution::AccountEffectProjection
Definition
execution_projection.hpp:12
pineforge::execution::settlement_projection_v1::AccountEffectProjection::resulting_abs_notional
double resulting_abs_notional
Definition
execution_projection.hpp:20
pineforge::execution::settlement_projection_v1::AccountEffectProjection::status
Status status
Definition
execution_projection.hpp:13
pineforge::execution::settlement_projection_v1::AccountEffectProjection::resulting_lot_count
std::size_t resulting_lot_count
Definition
execution_projection.hpp:19
pineforge::execution::settlement_projection_v1::AccountEffectProjection::closed_units
double closed_units
Definition
execution_projection.hpp:16
pineforge::execution::settlement_projection_v1::AccountEffectProjection::remaining_entry_cost
double remaining_entry_cost
Definition
execution_projection.hpp:31
pineforge::execution::settlement_projection_v1::AccountEffectProjection::marked_equity
double marked_equity
Definition
execution_projection.hpp:35
pineforge::execution::settlement_projection_v1::AccountEffectProjection::opened_units
double opened_units
Definition
execution_projection.hpp:17
pineforge::execution::settlement_projection_v1::AccountEffectProjection::resulting_abs_units
double resulting_abs_units
Definition
execution_projection.hpp:18
pineforge::execution::settlement_projection_v1::AccountEffectProjection::current_ticket
double current_ticket
Definition
execution_projection.hpp:21
pineforge::execution::settlement_projection_v1::AccountEffectProjection::signed_units_after
double signed_units_after
Definition
execution_projection.hpp:41
pineforge::execution::settlement_projection_v1::AccountEffectProjection::realized_balance
double realized_balance
Definition
execution_projection.hpp:28
pineforge::execution::settlement_projection_v1::AccountEffectProjection::incoming_short
bool incoming_short
Definition
execution_projection.hpp:23
pineforge::execution::settlement_projection_v1::AccountEffectProjection::would_open
bool would_open
Definition
execution_projection.hpp:22
pineforge::execution::settlement_projection_v1::AccountEffectProjection::cycle_after
std::int64_t cycle_after
Definition
execution_projection.hpp:39
include
pineforge
execution_projection.hpp
PineForge v0.13.1-379-g9b50973 — Apache-2.0 —
github.com/pineforge-4pass/pineforge-engine