15 enum Flags : std::uint8_t {
49 [[nodiscard]]
constexpr bool is_working() const noexcept {
52 [[nodiscard]]
constexpr bool has(
Flags f)
const noexcept {
return (
flags & f) != 0; }
54static_assert(
sizeof(
Order) == 128 && std::is_trivially_copyable_v<Order>);
72 std::numeric_limits<double>::quiet_NaN(),
73 std::numeric_limits<double>::quiet_NaN(),
74 std::numeric_limits<double>::quiet_NaN()};
76static_assert(
sizeof(QuoteContext) == 32 && std::is_trivially_copyable_v<QuoteContext>);
92static_assert(std::is_trivially_copyable_v<OrderTrail>);
96inline constexpr float kNoValue = std::numeric_limits<float>::quiet_NaN();
97[[nodiscard]]
constexpr bool value_stated(
float v)
noexcept {
103struct NewOrderRequest {
152 [[nodiscard]]
constexpr LimitOrder tag(std::uint32_t user_tag)
const noexcept {
Fixed<Tag>: int64 fixed point with a global 1e-8 scale (ADR-0001).
Definition strategy.hpp:23
constexpr std::size_t kQuoteContextSize
The numbers a strategy publishes about its quotes on one side of an instrument (StrategyContext::quot...
Definition order.hpp:71
OrderType
Definition enums.hpp:23
OrderState
Definition enums.hpp:79
FixedString< 40 > VenueOrderId
Definition strong_id.hpp:42
RejectReason
Ordered exactly like RiskEngine::check_new evaluates them (5.7), followed by OMS / transport / venue ...
Definition enums.hpp:123
Side
Definition enums.hpp:12
constexpr bool is_terminal(OrderState s) noexcept
Definition enums.hpp:90
constexpr float kNoValue
What an order or a quote level is worth when the strategy did not say ([capacity],...
Definition order.hpp:98
StrongId< struct InstrumentTag, std::uint32_t > InstrumentId
Dense index into the engine's instrument table.
Definition strong_id.hpp:38
constexpr bool value_stated(float v) noexcept
Definition order.hpp:99
TimeInForce
Definition enums.hpp:36
Strongly typed identifiers.
Chainable builder returned by NewOrderRequest::limit(); converts to NewOrderRequest.
Definition order.hpp:133
constexpr LimitOrder reduce_only() const noexcept
Definition order.hpp:142
constexpr LimitOrder value(float v) const noexcept
What the order is worth ([capacity], NewOrderRequest::value).
Definition order.hpp:160
constexpr LimitOrder account(VenueId venue) const noexcept
The account of the instrument's pool to send from (NewOrderRequest::account).
Definition order.hpp:166
constexpr LimitOrder tag(std::uint32_t user_tag) const noexcept
user_tag: echoed in the order record.
Definition order.hpp:154
NewOrderRequest request
Definition order.hpp:134
constexpr LimitOrder ioc() const noexcept
Definition order.hpp:147
constexpr LimitOrder post_only() const noexcept
Definition order.hpp:136
VenueId account
The account to send it from where the instrument's venue has a pool (core/account_pool....
Definition order.hpp:111
bool reduce_only
Definition order.hpp:116
Side side
Definition order.hpp:112
VenueId venue
Definition order.hpp:107
OrderType type
Definition order.hpp:113
bool post_only
Definition order.hpp:115
std::uint32_t user_tag
Definition order.hpp:119
Price price
Definition order.hpp:117
static constexpr LimitOrder limit(InstrumentId instrument, Side side, Price price, Qty qty) noexcept
A GTC limit order, refined with the builder's methods: ctx.send(NewOrderRequest::limit(id,...
Definition order.hpp:174
TimeInForce tif
Definition order.hpp:114
float value
What the order is worth, in the quote currency: [capacity] sends it only if this covers the price of ...
Definition order.hpp:122
InstrumentId instrument
Definition order.hpp:106
Qty qty
Definition order.hpp:118
When the order's working leg (the order, or its latest replacement once acknowledged) was sent and ac...
Definition order.hpp:60
Timestamp sent
engine clock when the order or replace went out
Definition order.hpp:61
Timestamp local_ack
the ack's recv_ts: when it reached us
Definition order.hpp:63
Timestamp venue_ack
the ack's exch_ts: the venue's accept time (Binance: whole ms)
Definition order.hpp:62
OrderTimes times
the working leg: sent (the order, or its last accepted replace)
Definition order.hpp:84
Price placed_px
the first leg's price
Definition order.hpp:88
std::uint32_t pad_
Definition order.hpp:90
Timestamp pending_sent
the cancel or replace in flight went out; invalid: none.
Definition order.hpp:86
std::uint32_t amends
replaces the venue accepted
Definition order.hpp:89
Timestamp placed
the first leg went out
Definition order.hpp:85
QuoteContext pending_context
the side's context when the replace in flight went out
Definition order.hpp:92
QuoteContext context
the side's context when the working leg went out
Definition order.hpp:91
OrderState state
1
Definition order.hpp:36
TimeInForce tif
1 -> 64
Definition order.hpp:35
VenueOrderId venue_order_id
41 -> 49
Definition order.hpp:28
ClientOrderId cl_ord_id
8
Definition order.hpp:27
Qty qty
8 -> 88
Definition order.hpp:42
constexpr Qty leaves_qty() const noexcept
Definition order.hpp:49
std::uint8_t arm
1 [ab] arm at its last new or replace: 0 none, k + 1 arm k
Definition order.hpp:29
std::uint8_t flags
1
Definition order.hpp:38
Price pending_price
8 -> 120
Definition order.hpp:46
constexpr bool has(Flags f) const noexcept
Definition order.hpp:54
std::uint8_t cancel_attempts
1
Definition order.hpp:39
ClientOrderId pending_cl_ord_id
8 -> 112 replace: id of the replacement order
Definition order.hpp:45
Timestamp created
8 -> 104
Definition order.hpp:44
constexpr bool is_open() const noexcept
Definition order.hpp:50
VenueId venue
1
Definition order.hpp:32
constexpr bool is_working() const noexcept
Definition order.hpp:51
Qty pending_qty
8 -> 128
Definition order.hpp:47
InstrumentId instrument
4 -> 60
Definition order.hpp:31
Side side
1
Definition order.hpp:33
std::uint8_t pad0_[6]
-> 56
Definition order.hpp:30
std::uint32_t user_tag
4 -> 72 (QuoteManager slot id etc.)
Definition order.hpp:40
RejectReason reject_reason
1
Definition order.hpp:37
Qty cum_qty
8 -> 96
Definition order.hpp:43
OrderType type
1
Definition order.hpp:34
Price price
8 -> 80
Definition order.hpp:41
Flags
Definition order.hpp:17
@ kReplaceOldCanceled
cancel-then-new replace: old leg already cancelled
Definition order.hpp:24
@ kSynthetic
created from reconcile (venue had it, we did not)
Definition order.hpp:23
@ kReconciled
state fixed up by reconciliation
Definition order.hpp:21
@ kReduceOnly
Definition order.hpp:19
@ kPostOnly
Definition order.hpp:18
@ kSeenInReconcile
scratch flag during a reconcile pass
Definition order.hpp:22
@ kUnsolicitedCancel
venue cancelled it (not requested by us)
Definition order.hpp:20
double v[kQuoteContextSize]
Definition order.hpp:73