algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::JournalEntry Struct Reference

One journal line: an instruction and what was known about it when the line was written. More...

#include <algotradelib/src/runner/journal.hpp>

Collaboration diagram for algotradelib::runner::JournalEntry:

Public Attributes

std::string id_
 Links an answering line to its PENDING line.
JournalAction action_ {JournalAction::PLACE}
 Whether the instruction is a placement or a cancellation.
JournalOutcome outcome_ {JournalOutcome::PENDING}
 What the line says about the instruction.
std::chrono::system_clock::time_point recorded_at_ {}
 When the line was written (for PENDING, before the request went out).
InstrumentId instrument_
 The instrument (identity; the routing venue is venue_).
OrderSide side_ {OrderSide::BUY}
 The side.
OrderType type_ {OrderType::LIMIT}
 The order type; recovery matches on type, time in force and session together.
TimeInForce time_in_force_ {TimeInForce::DAY}
 The time in force.
OrderSession session_ {OrderSession::REGULAR}
 The session.
std::optional< Venue > venue_ {Venue::UNSPECIFIED}
 The venue the order actually goes to, as the binding resolves it.
Decimal64 quantity_
 The quantity, which recovery matches against.
std::optional< Decimal64 > price_
 The price, if the order has one.
std::optional< Decimal64 > trigger_price_
 The trigger price of a stop-limit order; empty otherwise (and on lines that predate it).
std::optional< Decimal64 > baseline_
 On a serialized runner's placement, the instrument's net holding the order was decided against; on a CONFIRMED line, the holding afterwards, where holdings showed it.
std::string order_id_
 The broker's order id, if known: from the start on a CANCEL line, and only on an answering line for a PLACE.
std::string detail_
 Why an answering line says what it says, for the operator.
bool requires_operator_ {false}
 Whether only an operator may resolve this instruction.
std::string scope_
 The broker and account the instruction belongs to, such as "kis:live:12345678-01".

Detailed Description

One journal line: an instruction and what was known about it when the line was written.

Every line repeats the whole instruction, so an answering line is readable on its own (with tail) and survives the loss of its PENDING line. recorded_at_ is the executor's clock (this machine's, unless one was injected), not the broker's.

Definition at line 360 of file journal.hpp.

Member Data Documentation

◆ action_

◆ baseline_

std::optional<Decimal64> algotradelib::runner::JournalEntry::baseline_

On a serialized runner's placement, the instrument's net holding the order was decided against; on a CONFIRMED line, the holding afterwards, where holdings showed it.

Empty on every line of an overlapping (or older) runner, which is how recovery tells them apart.

Definition at line 403 of file journal.hpp.

Referenced by algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), and algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place().

◆ detail_

◆ id_

◆ instrument_

◆ order_id_

std::string algotradelib::runner::JournalEntry::order_id_

◆ outcome_

◆ price_

◆ quantity_

◆ recorded_at_

◆ requires_operator_

bool algotradelib::runner::JournalEntry::requires_operator_ {false}

Whether only an operator may resolve this instruction.

Set on an instruction recovered from a damaged line, whose matching fields are missing; a sweep never resolves it. Written to the file, so it survives repair.

Definition at line 417 of file journal.hpp.

Referenced by algotradelib::runner::any_placement(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unattributable_journal_entry().

◆ scope_

std::string algotradelib::runner::JournalEntry::scope_

The broker and account the instruction belongs to, such as "kis:live:12345678-01".

Opaque to the library; it keeps one account's instruction from being matched against another account's orders. Stamped by the journal.

Definition at line 424 of file journal.hpp.

Referenced by algotradelib::runner::FileJournal::append(), algotradelib::runner::journal_entry_from_line(), and algotradelib::runner::journal_entry_to_line().

◆ session_

◆ side_

◆ time_in_force_

◆ trigger_price_

◆ type_

◆ venue_

std::optional<Venue> algotradelib::runner::JournalEntry::venue_ {Venue::UNSPECIFIED}

The venue the order actually goes to, as the binding resolves it.

UNSPECIFIED is a recorded fact (no venue was asked for, as always at Toss). Empty means the route cannot be known from the line (an older line, an unrecognized value, or a damaged line); recovery then reports a lookalike row as ambiguous rather than matching it.

Definition at line 390 of file journal.hpp.

Referenced by algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::route_evidence(), and algotradelib::runner::salvage_journal_line().


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