![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
One journal line: an instruction and what was known about it when the line was written. More...
#include <algotradelib/src/runner/journal.hpp>
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". | |
| std::shared_ptr< const RunRecord > | run_ |
| What the line says about a run budget's ledger; null on a line of a runner without one, except one closing a restored order of a run, which keeps that order's run. | |
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 482 of file journal.hpp.
| JournalAction algotradelib::runner::JournalEntry::action_ {JournalAction::PLACE} |
Whether the instruction is a placement or a cancellation.
Definition at line 490 of file journal.hpp.
Referenced by algotradelib::runner::any_placement(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unresolvable_reason().
| 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 525 of file journal.hpp.
Referenced by algotradelib::runner::journal_entry_from_line(), and algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place().
| std::string algotradelib::runner::JournalEntry::detail_ |
Why an answering line says what it says, for the operator.
Definition at line 532 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unattributable_journal_entry().
| std::string algotradelib::runner::JournalEntry::id_ |
Links an answering line to its PENDING line.
Generated locally; it is not an idempotency key and no broker has seen it.
Definition at line 488 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::decide_nothing(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::recorded_owner(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unattributable_journal_entry().
| InstrumentId algotradelib::runner::JournalEntry::instrument_ |
The instrument (identity; the routing venue is venue_).
Definition at line 496 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::decide_nothing(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::recover_into(), and algotradelib::runner::salvage_journal_line().
| std::string algotradelib::runner::JournalEntry::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.
Definition at line 530 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::recorded_placements(), and algotradelib::runner::unresolvable_reason().
| JournalOutcome algotradelib::runner::JournalEntry::outcome_ {JournalOutcome::PENDING} |
What the line says about the instruction.
Definition at line 492 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::resolution_entry(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unattributable_journal_entry().
| std::optional<Decimal64> algotradelib::runner::JournalEntry::price_ |
The price, if the order has one.
Definition at line 516 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unresolvable_reason().
| Decimal64 algotradelib::runner::JournalEntry::quantity_ |
The quantity, which recovery matches against.
Definition at line 514 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), and algotradelib::runner::salvage_journal_line().
| std::chrono::system_clock::time_point algotradelib::runner::JournalEntry::recorded_at_ {} |
When the line was written (for PENDING, before the request went out).
Definition at line 494 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::journal_entry_to_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), and algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::record().
| 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 539 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().
| std::shared_ptr<const RunRecord> algotradelib::runner::JournalEntry::run_ |
What the line says about a run budget's ledger; null on a line of a runner without one, except one closing a restored order of a run, which keeps that order's run.
Definition at line 551 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().
| 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 546 of file journal.hpp.
Referenced by algotradelib::runner::FileJournal::append(), algotradelib::runner::journal_entry_from_line(), and algotradelib::runner::journal_entry_to_line().
| OrderSession algotradelib::runner::JournalEntry::session_ {OrderSession::REGULAR} |
The session.
Definition at line 504 of file journal.hpp.
Referenced by algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), and algotradelib::runner::salvage_journal_line().
| OrderSide algotradelib::runner::JournalEntry::side_ {OrderSide::BUY} |
The side.
Definition at line 498 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), and algotradelib::runner::salvage_journal_line().
| TimeInForce algotradelib::runner::JournalEntry::time_in_force_ {TimeInForce::DAY} |
The time in force.
Definition at line 502 of file journal.hpp.
Referenced by algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), and algotradelib::runner::salvage_journal_line().
| std::optional<Decimal64> algotradelib::runner::JournalEntry::trigger_price_ |
The trigger price of a stop-limit order; empty otherwise (and on lines that predate it).
Definition at line 518 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unresolvable_reason().
| OrderType algotradelib::runner::JournalEntry::type_ {OrderType::LIMIT} |
The order type; recovery matches on type, time in force and session together.
Definition at line 500 of file journal.hpp.
Referenced by algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::cancel(), algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::salvage_journal_line(), and algotradelib::runner::unresolvable_reason().
| 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 512 of file journal.hpp.
Referenced by algotradelib::runner::journal_entry_from_line(), algotradelib::runner::JournalingExecutor< Inner, Journal, Clock >::place(), algotradelib::runner::route_evidence(), and algotradelib::runner::salvage_journal_line().