63#include "fastmm/core/config_macros.hpp"
64#include "fastmm/core/containers/ring_buffer.hpp"
65#include "fastmm/core/containers/static_vector.hpp"
82 StaticVector<Level, kMaxQuoteLevels>
bids;
83 StaticVector<Level, kMaxQuoteLevels>
asks;
91 std::array<float, kMaxQuoteLevels>
bid_value = no_values();
92 std::array<float, kMaxQuoteLevels>
ask_value = no_values();
93 std::array<float, kMaxQuoteLevels>
bid_keep = no_values();
94 std::array<float, kMaxQuoteLevels>
ask_keep = no_values();
114 [[nodiscard]]
float value(
Side s, std::uint32_t lvl)
const noexcept {
117 [[nodiscard]]
float keep(
Side s, std::uint32_t lvl)
const noexcept {
120 [[nodiscard]]
const StaticVector<Level, kMaxQuoteLevels>&
side(
Side s)
const noexcept {
123 [[nodiscard]]
bool empty() const noexcept {
return bids.empty() &&
asks.empty(); }
127 return px.is_positive() && qty.is_positive() &&
bids.push_back(
Level{px, qty});
130 return px.is_positive() && qty.is_positive() &&
asks.push_back(
Level{px, qty});
134 if (!
bid(px, qty))
return false;
139 if (!
ask(px, qty))
return false;
150 static constexpr std::array<float, kMaxQuoteLevels> no_values() noexcept {
151 std::array<float, kMaxQuoteLevels> a{};
223 std::uint64_t
news = 0;
241 static constexpr std::int64_t kNever = std::numeric_limits<std::int64_t>::max();
251 [[nodiscard]]
const QuoteStats&
stats() const noexcept {
return stats_; }
254 InstState& st = state_[
id.value];
255 st.venue_no_replace = !on;
258 [[nodiscard]]
bool replaces(
InstrumentId id)
const noexcept {
return state_[
id.value].replace; }
261 [[nodiscard]]
static constexpr std::uint32_t
make_tag(
Side s, std::uint32_t level)
noexcept {
262 return 0x5100'0000U | (
static_cast<std::uint32_t
>(s) << 8) | level;
264 [[nodiscard]]
static constexpr bool is_quote_tag(std::uint32_t tag)
noexcept {
265 return (tag & 0xFFFF'0000U) == 0x5100'0000U;
269 template <
class Placer>
274 Placer&& place)
noexcept {
275 InstState& st = state_[inst.id.value];
278 st.resumable =
false;
280 std::uint32_t actions = 0;
282 const auto s =
static_cast<std::size_t
>(side);
283 const auto& want = st.desired.
side(side);
285 const std::uint32_t n = std::max(
static_cast<std::uint32_t
>(want.size()), st.used[s]);
286 std::uint32_t used = 0;
287 for (std::uint32_t lvl = 0; lvl < n; ++lvl) {
288 Slot& slot = st.slots[s][lvl];
289 const bool has_want = !held(st, side) && lvl < want.size() && want[lvl].qty.is_positive();
290 actions += reconcile_slot(inst,
296 has_want ? want[lvl] :
Level{},
297 st.desired.account(side, lvl),
298 st.desired.value(side, lvl),
299 st.desired.keep(side, lvl),
302 if (!slot.empty()) used = lvl + 1;
312 template <
class Placer>
316 bool keep_desired =
false) noexcept {
317 InstState& st = state_[inst.
id.
value];
319 st.resumable = st.resumable || (!st.pulled && !st.desired.empty());
321 st.resumable =
false;
326 std::uint32_t actions = 0;
329 Slot& slot = st.slots[
static_cast<std::size_t
>(side)][lvl];
330 slot.apply_want =
false;
331 if (!owns(oms, inst, side, lvl, slot))
continue;
332 const Order& o = oms.
get(slot.handle);
334 actions += cancel(inst, side, lvl, slot, place);
344 InstState& st = state_[
id.value];
345 st.resumable = st.resumable || (!st.pulled && !st.desired.empty());
347 for (
auto& side : st.slots)
348 for (Slot& slot : side) slot.apply_want = false;
350 [[nodiscard]]
bool paused(
InstrumentId id)
const noexcept {
return state_[
id.value].paused; }
354 template <
class Placer>
358 Placer&& place)
noexcept {
359 InstState& st = state_[inst.id.value];
361 if (!st.resumable)
return 0;
366 return state_[
id.value].resumable;
371 void hold_side(
Side side,
bool on)
noexcept { side_held_[
static_cast<std::size_t
>(side)] = on; }
373 return side_held_[
static_cast<std::size_t
>(side)];
378 state_[
id.value].side_held[
static_cast<std::size_t
>(side)] = on;
381 return state_[
id.value].side_held[
static_cast<std::size_t
>(side)];
386 template <
class Placer>
389 InstState& st = state_[inst.id.value];
390 const auto s =
static_cast<std::size_t
>(side);
391 std::uint32_t actions = 0;
392 std::uint32_t used = 0;
393 for (std::uint32_t lvl = 0; lvl < st.used[s]; ++lvl) {
394 Slot& slot = st.slots[s][lvl];
395 actions += reconcile_slot(
396 inst, st, oms, side, lvl, slot,
Level{},
VenueId{},
kNoValue,
kNoValue, now, place);
397 if (!slot.empty()) used = lvl + 1;
404 template <
class Placer>
405 std::uint32_t
reapply(
const Instrument& inst,
408 Placer&& place)
noexcept {
409 InstState& st = state_[inst.id.value];
410 if (st.pulled || st.paused || st.desired.empty())
return 0;
416 [[nodiscard]]
bool starved() const noexcept {
return !starved_.empty(); }
417 [[nodiscard]] std::size_t
starved_count() const noexcept {
return starved_.size(); }
422 state_[
id.value].starved =
false;
427 template <
class Placer>
431 Placer&& place)
noexcept {
432 InstState& st = state_[inst.id.value];
433 if (st.pulled || st.paused)
return 0;
442 [[nodiscard]]
bool backed_off() const noexcept {
return !backed_off_.empty(); }
443 [[nodiscard]]
bool backoff_due(Timestamp now)
const noexcept {
return now >= backoff_due_; }
448 if (now < backoff_due_)
return;
450 for (std::size_t n = backed_off_.size(); n > 0; --n) {
451 const std::uint16_t
id = backed_off_.front();
453 InstState& st = state_[id];
454 if (now < st.retry_at) {
455 static_cast<void>(backed_off_.try_push(
id));
456 backoff_due_ = std::min(backoff_due_, st.retry_at);
459 st.retry_at = Timestamp{kNever};
465 template <
class Placer>
469 Placer&& place)
noexcept {
470 InstState& st = state_[inst.id.value];
471 if (st.pulled || st.paused)
return 0;
479 [[nodiscard]]
bool priced_out() const noexcept {
return !priced_.empty(); }
484 for (std::size_t n = priced_.size(); n > 0; --n) {
485 const std::uint16_t
id = priced_.front();
487 state_[id].priced =
false;
491 template <
class Placer>
495 Placer&& place)
noexcept {
496 InstState& st = state_[inst.id.value];
497 if (st.pulled || st.paused)
return 0;
506 template <
class Placer>
511 Placer&& place)
noexcept {
513 const Side side =
static_cast<Side>((u.order.user_tag >> 8) & 1U);
514 const std::uint32_t lvl = u.order.user_tag & 0xFFU;
516 InstState& st = state_[inst.id.value];
517 Slot& slot = st.slots[
static_cast<std::size_t
>(side)][lvl];
522 st.backoff[
static_cast<std::size_t
>(side)] =
Duration{};
523 if (!u.handle.valid() || slot.handle.idx != u.handle.idx ||
524 !owns(oms, inst, side, lvl, slot) || !u.order.is_working())
527 static_cast<void>(cancel(inst, side, lvl, slot, place));
530 if (st.paused)
return;
531 if (slot.apply_want &&
533 slot.apply_want =
false;
534 static_cast<void>(reconcile_slot(inst,
540 held(st, side) ?
Level{} : slot.want,
552 if (owns(oms, inst, side, lvl, slot))
return;
555 slot.awaiting_terminal =
false;
556 if (st.pulled || st.paused || !slot.apply_want)
return;
557 slot.apply_want =
false;
558 if (!slot.want.qty.is_positive() || held(st, side))
return;
560 kept_backoff(st, inst.id, side);
577 std::uint32_t level)
const noexcept {
578 return state_[
id.value].slots[
static_cast<std::size_t
>(s)][level].handle;
580 [[nodiscard]]
bool pulled(
InstrumentId id)
const noexcept {
return state_[
id.value].pulled; }
583 return state_[
id.value].desired;
586 [[nodiscard]]
bool starved(
InstrumentId id)
const noexcept {
return state_[
id.value].starved; }
596 Timestamp last_requote{};
602 bool apply_want =
false;
603 bool awaiting_terminal =
false;
605 [[nodiscard]]
bool empty() const noexcept {
606 return !handle.
valid() && !apply_want && !awaiting_terminal;
613 std::uint32_t used[2] = {};
614 DesiredQuotes desired;
617 bool resumable =
false;
618 bool side_held[2] = {};
619 bool venue_no_replace =
false;
620 bool replace =
false;
621 Duration backoff[2] = {};
622 Timestamp blocked_until[2] = {};
623 bool starved =
false;
625 Timestamp retry_at{kNever};
628 [[nodiscard]]
bool held(
const InstState& st,
Side side)
const noexcept {
629 const auto i =
static_cast<std::size_t
>(side);
630 return side_held_[i] || st.side_held[i];
632 [[nodiscard]]
static bool backing_off(
const InstState& st,
Side side, Timestamp now)
noexcept {
633 const auto i =
static_cast<std::size_t
>(side);
634 return st.backoff[i].ns > 0 && now < st.blocked_until[i];
640 const Timestamp until = st.blocked_until[
static_cast<std::size_t
>(side)];
641 if (st.retry_at.ns == kNever) {
642 if (!backed_off_.try_push(
static_cast<std::uint16_t
>(
id.value)))
return;
644 st.retry_at = std::min(st.retry_at, until);
645 backoff_due_ = std::min(backoff_due_, until);
647 void on_venue_reject(InstState& st,
Side side,
RejectReason reason, Timestamp now)
noexcept {
653 back_off(st, side, now);
656 void back_off(InstState& st,
Side side, Timestamp now)
noexcept {
658 const auto i =
static_cast<std::size_t
>(side);
659 Duration next = st.backoff[i].ns <= 0 ? params_.
reject_backoff : st.backoff[i] + st.backoff[i];
662 st.backoff[i] = next;
663 st.blocked_until[i] = now + next;
669 template <
class Placer>
670 std::uint32_t reconcile_slot(
const Instrument& inst,
681 Placer& place)
noexcept {
682 const bool has_want = target.qty.is_positive();
683 if (owns(oms, inst, side, lvl, slot)) {
684 const Order& o = oms.get(slot.handle);
689 slot.want_account = account;
690 slot.want_value = value;
691 slot.want_keep = keep;
692 slot.apply_want =
true;
695 slot.apply_want =
false;
696 if (!has_want)
return cancel(inst, side, lvl, slot, place);
698 if (account.valid() && o.venue != account) {
700 slot.want_account = account;
701 slot.want_value = value;
702 slot.want_keep = keep;
703 slot.apply_want =
true;
705 return cancel(inst, side, lvl, slot, place);
707 const std::int64_t dpx = (target.price - o.price).abs().raw / inst.tick.raw;
708 const bool qty_ok =
static_cast<Int128
>(o.leaves_qty().raw) * 10'000 >=
709 static_cast<Int128
>(target.qty.raw) * params_.
min_qty_bps;
719 if (st.replace && !
backing_off(st, side, now) && !relocates(place, o, account)) {
738 if (side ==
Side::Buy ? target.price < o.price : target.price > o.price)
739 return move(inst, side, lvl, slot, target, account, value, keep, place);
741 queue_priced(st, inst.id);
745 held_back(st, inst.id, a, now);
750 slot.last_requote = now;
753 return move(inst, side, lvl, slot, target, account, value, keep, place);
758 slot.handle = Handle<Order>{};
759 slot.awaiting_terminal =
false;
760 slot.apply_want =
false;
761 if (!has_want)
return 0;
763 kept_backoff(st, inst.id, side);
766 return submit_new(inst, side, lvl, slot, target, account, value, now, place);
770 template <
class Placer>
771 [[nodiscard]]
static bool relocates(Placer& place,
const Order& o,
VenueId account)
noexcept {
772 if constexpr (
requires {
773 { place.relocates(o, account) } -> std::convertible_to<bool>;
775 return place.relocates(o, account);
782 [[nodiscard]]
static bool owns(
const Oms& oms,
783 const Instrument& inst,
786 const Slot& slot)
noexcept {
787 if (!slot.handle.valid() || !oms.is_live(slot.handle))
return false;
788 const Order& o = oms.get(slot.handle);
789 return o.instrument == inst.id && o.user_tag ==
make_tag(side, lvl);
794 template <
class Placer>
795 std::uint32_t move(
const Instrument& inst,
803 Placer& place)
noexcept {
819 slot.want_account = account;
820 slot.want_value = value;
821 slot.want_keep = keep;
822 slot.apply_want =
true;
826 slot.apply_want =
false;
828 queue_priced(state_[inst.id.value], inst.id);
830 slot.apply_want =
false;
839 slot.awaiting_terminal =
true;
843 template <
class Placer>
844 std::uint32_t cancel(
845 const Instrument& inst,
Side side, std::uint32_t lvl, Slot& slot, Placer& place)
noexcept {
863 slot.awaiting_terminal =
true;
866 template <
class Placer>
867 std::uint32_t submit_new(
const Instrument& inst,
876 bool deferred =
false) noexcept {
891 a.paid = deferred && slot.paid;
893 if (!place(a) || !a.handle.valid()) {
896 queue_priced(state_[inst.id.value], inst.id);
897 }
else if (a.withheld) {
900 held_back(state_[inst.id.value], inst.id, a, now);
905 slot.handle = a.handle;
906 slot.cl_ord_id = a.cl_ord_id;
907 slot.last_requote = now;
908 slot.awaiting_terminal =
false;
914 void held_back(InstState& st,
InstrumentId id,
const QuoteAction& a, Timestamp now)
noexcept {
915 if (!a.rate_limited) {
918 back_off(st, a.side, now);
922 if (st.starved)
return;
924 static_cast<void>(starved_.try_push(
static_cast<std::uint16_t
>(
id.value)));
927 void queue_priced(InstState& st,
InstrumentId id)
noexcept {
928 if (st.priced)
return;
929 st.priced = priced_.try_push(
static_cast<std::uint16_t
>(
id.value));
932 void resolve_replace() noexcept {
933 for (InstState& st : state_) st.replace = params_.supports_replace && !st.venue_no_replace;
939 RingBuffer<std::uint16_t, kMaxInstruments> starved_;
940 RingBuffer<std::uint16_t, kMaxInstruments> priced_;
943 RingBuffer<std::uint16_t, kMaxInstruments> backed_off_;
944 Timestamp backoff_due_{kNever};
945 bool side_held_[2] = {};
The capacity price ([capacity]): every action that uses an order slot is a purchase.
const Order & get(Handle< Order > h) const noexcept
Definition oms.hpp:627
Definition quote_manager.hpp:242
const QuoteParams & params() const noexcept
Definition quote_manager.hpp:248
bool starved() const noexcept
Instruments whose quotes were held back for want of an order token, oldest first.
Definition quote_manager.hpp:418
std::uint32_t retry_backed_off(const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Re-applies the last desired quotes of an instrument take_backoff_due() handed out; one pulled meanwhi...
Definition quote_manager.hpp:468
std::uint32_t reapply(const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Re-applies the instrument's last desired quotes (a hold ended); one pulled or paused stays as it is.
Definition quote_manager.hpp:407
std::uint32_t reconcile(const Instrument &inst, const DesiredQuotes &desired, const Oms &oms, Timestamp now, Placer &&place) noexcept
Reconciles desired vs resting for one instrument. Returns the number of actions placed.
Definition quote_manager.hpp:272
std::uint32_t pull_side(const Instrument &inst, Side side, const Oms &oms, Timestamp now, Placer &&place) noexcept
Cancels the instrument's working quotes on side, now; one still pending is cancelled when its ack arr...
Definition quote_manager.hpp:389
std::uint32_t retry_priced(const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Definition quote_manager.hpp:494
bool backed_off() const noexcept
Instruments with a New held back by a side's reject backoff: once the backoff ends,...
Definition quote_manager.hpp:444
std::size_t starved_count() const noexcept
Definition quote_manager.hpp:419
static constexpr std::uint32_t make_tag(Side s, std::uint32_t level) noexcept
user_tag encoding so a terminal OmsUpdate can be mapped back to its slot.
Definition quote_manager.hpp:263
const QuoteStats & stats() const noexcept
Definition quote_manager.hpp:253
void take_priced(F &&f) noexcept
Takes every instrument queued now off the queue and calls f(InstrumentId); one priced out again durin...
Definition quote_manager.hpp:485
bool resumable(InstrumentId id) const noexcept
Definition quote_manager.hpp:367
void pause_quotes(InstrumentId id) noexcept
Holds the instrument's orders as they are until resume(): no New, Cancel or Replace,...
Definition quote_manager.hpp:345
bool side_held(Side side) const noexcept
Definition quote_manager.hpp:374
bool backing_off(InstrumentId id, Side s, Timestamp now) const noexcept
The side is in its venue-reject backoff at now.
Definition quote_manager.hpp:590
std::uint32_t retry(const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Re-applies the last desired quotes of an instrument popped from the starved queue; one that was pulle...
Definition quote_manager.hpp:430
static constexpr bool is_quote_tag(std::uint32_t tag) noexcept
Definition quote_manager.hpp:266
bool paused(InstrumentId id) const noexcept
Definition quote_manager.hpp:352
bool backoff_due(Timestamp now) const noexcept
Definition quote_manager.hpp:445
const DesiredQuotes & desired(InstrumentId id) const noexcept
The last ladder reconcile() applied to the instrument (empty after a pull).
Definition quote_manager.hpp:584
std::uint32_t resume(const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Ends a pause and re-applies the desired quotes kept by pause_quotes() or pull_quotes(keep_desired) to...
Definition quote_manager.hpp:357
void set_replace(InstrumentId id, bool on) noexcept
Whether the instrument's venue amends in place (default true; supports_replace still applies).
Definition quote_manager.hpp:255
bool replaces(InstrumentId id) const noexcept
Definition quote_manager.hpp:260
void set_params(const QuoteParams &p) noexcept
Definition quote_manager.hpp:249
Handle< Order > slot_handle(InstrumentId id, Side s, std::uint32_t level) const noexcept
Definition quote_manager.hpp:577
bool pulled(InstrumentId id) const noexcept
Definition quote_manager.hpp:582
void hold_side(Side side, bool on) noexcept
Holds side on every instrument (on) or ends the hold (off).
Definition quote_manager.hpp:373
void on_order_update(const OmsUpdate &u, const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept
Feed every OmsUpdate here.
Definition quote_manager.hpp:509
InstrumentId pop_starved() noexcept
Takes the oldest starved instrument off the queue (the caller checks starved() first).
Definition quote_manager.hpp:421
void take_backoff_due(Timestamp now, F &&f) noexcept
Takes each instrument whose held-back side may quote at now off the queue and calls f(InstrumentId); ...
Definition quote_manager.hpp:449
std::uint32_t pull_quotes(const Instrument &inst, const Oms &oms, Placer &&place, bool keep_desired=false) noexcept
Cancels every working quote on the instrument and suppresses re-quoting until the next reconcile().
Definition quote_manager.hpp:315
bool priced_out() const noexcept
Instruments with a level priced out ([capacity]): the engine re-applies their last desired quotes (re...
Definition quote_manager.hpp:481
Instrument: the single definition of a tradable contract (5.3 / 5.15).
Event bus message structs (5.5).
Definition strategy.hpp:23
StrongId< struct ClientOrderTag, std::uint64_t, 0 > ClientOrderId
48-bit: session_epoch(16) << 32 | seq(32). 0 is never issued.
Definition strong_id.hpp:41
constexpr Duration milliseconds(std::int64_t v) noexcept
Definition time.hpp:38
constexpr bool is_pending(OrderState s) noexcept
Definition enums.hpp:93
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
Fixed< struct QtyTag > Qty
Definition fixed_point.hpp:333
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
Fixed< struct PriceTag > Price
Definition fixed_point.hpp:332
constexpr std::size_t kMaxInstruments
Definition instrument.hpp:26
QuoteActionKind
Definition quote_manager.hpp:187
constexpr std::size_t kMaxQuoteLevels
Definition quote_manager.hpp:81
StrongId< struct VenueTag, std::uint8_t > VenueId
Definition strong_id.hpp:39
Order management (5.8): a Pool<Order> + OpenHashMap<ClientOrderId, Handle> + a ring of recently termi...
Definition quote_manager.hpp:83
StaticVector< Level, kMaxQuoteLevels > asks
Definition quote_manager.hpp:85
std::array< float, kMaxQuoteLevels > bid_keep
Definition quote_manager.hpp:95
std::array< VenueId, kMaxQuoteLevels > ask_account
Definition quote_manager.hpp:89
void clear() noexcept
Definition quote_manager.hpp:97
void set_value(Side s, std::uint32_t lvl, float value, float keep=kNoValue) noexcept
Sets the value of level lvl of a side and, optionally, the keep value of its resting order.
Definition quote_manager.hpp:111
std::array< float, kMaxQuoteLevels > ask_value
Definition quote_manager.hpp:94
std::array< float, kMaxQuoteLevels > ask_keep
Definition quote_manager.hpp:96
const StaticVector< Level, kMaxQuoteLevels > & side(Side s) const noexcept
Definition quote_manager.hpp:122
VenueId account(Side s, std::uint32_t lvl) const noexcept
Definition quote_manager.hpp:107
float keep(Side s, std::uint32_t lvl) const noexcept
Definition quote_manager.hpp:119
bool bid(Price px, Qty qty) noexcept
Append the next level of a side (index 0 first).
Definition quote_manager.hpp:128
StaticVector< Level, kMaxQuoteLevels > bids
index 0 = closest to mid
Definition quote_manager.hpp:84
bool empty() const noexcept
Definition quote_manager.hpp:125
std::array< float, kMaxQuoteLevels > bid_value
What a level's order is worth, in the quote currency ([capacity], core/capacity_price....
Definition quote_manager.hpp:93
std::array< VenueId, kMaxQuoteLevels > bid_account
The pool account a level's order goes from (NewOrderRequest::account); invalid = the engine's automat...
Definition quote_manager.hpp:88
bool ask(Price px, Qty qty) noexcept
Definition quote_manager.hpp:131
void uncross(Price tick) noexcept
Never cross ourselves at level 0: an ask at or below the best bid moves one tick above it.
Definition quote_manager.hpp:146
float value(Side s, std::uint32_t lvl) const noexcept
Definition quote_manager.hpp:116
std::int64_t ns
Definition time.hpp:23
Definition strong_id.hpp:54
Definition instrument.hpp:29
InstrumentId id
4
Definition instrument.hpp:42
One price level. Shared by book messages and the L2 book.
Definition messages.hpp:31
constexpr bool is_working() const noexcept
Definition order.hpp:51
Definition quote_manager.hpp:189
bool paid
A Cancel that moves, output: the move was bought, so the New after it is not priced again.
Definition quote_manager.hpp:221
bool post_only
Definition quote_manager.hpp:198
bool withheld
New output: not sent, the balance does not cover it (deferred only)
Definition quote_manager.hpp:202
VenueId account
New: the pool account to send it from (invalid = automatic)
Definition quote_manager.hpp:206
bool rate_limited
New / Replace output: not sent, no order token for it now (QuoteParams::token_reserve,...
Definition quote_manager.hpp:205
float value
New / Replace / a Cancel that moves: the level's value and the resting order's keep value (DesiredQuo...
Definition quote_manager.hpp:215
bool deferred
New: the target was recorded while an earlier order held the slot and is placed now that it ended (on...
Definition quote_manager.hpp:201
bool priced_out
Output: not sent, the action is worth less than the order slot it takes ([capacity]).
Definition quote_manager.hpp:218
InstrumentId instrument
Definition quote_manager.hpp:191
Price price
Definition quote_manager.hpp:196
ClientOrderId cl_ord_id
New output (the placer fills it)
Definition quote_manager.hpp:195
float keep
Definition quote_manager.hpp:216
RejectReason refused
New / Replace output: the pre-trade check that refused it (None: sent, or not refused by one).
Definition quote_manager.hpp:208
Side side
Definition quote_manager.hpp:192
bool held
Cancel / Replace output: not sent, the move goes towards the touch and the order's account is short o...
Definition quote_manager.hpp:212
std::uint32_t level
Definition quote_manager.hpp:193
Qty qty
Definition quote_manager.hpp:197
QuoteActionKind kind
Definition quote_manager.hpp:190
Handle< Order > handle
Cancel/Replace input; New output.
Definition quote_manager.hpp:194
Definition quote_manager.hpp:159
Duration min_requote_interval
Definition quote_manager.hpp:161
Duration reject_backoff
0 = no backoff after venue rejects
Definition quote_manager.hpp:168
std::int64_t min_qty_bps
leaves >= 80 % of desired -> qty ok
Definition quote_manager.hpp:162
Duration reject_backoff_max
Definition quote_manager.hpp:169
std::int64_t send_reserve
Order tokens every quote leaves for the orders a strategy sends itself (ctx.send, a hedge or an unwin...
Definition quote_manager.hpp:179
std::int64_t min_requote_ticks
|desired - resting| < this -> keep
Definition quote_manager.hpp:160
std::int64_t token_reserve
Order tokens ([risk] orders_per_sec) a quote that does not reduce the position leaves for the orders ...
Definition quote_manager.hpp:173
bool replace_all_venues
Replace only if every instrument's venue can (the engine before replace was per venue; set to replay ...
Definition quote_manager.hpp:166
bool post_only
Definition quote_manager.hpp:167
std::int64_t room_reserve
Orders an account's venue order windows (ctx.order_budget) keep for News into empty levels and for mo...
Definition quote_manager.hpp:184
bool supports_replace
off: never replace; on: where the instrument's venue can
Definition quote_manager.hpp:163
Definition quote_manager.hpp:224
std::uint64_t rejected
Definition quote_manager.hpp:231
std::uint64_t kept_hysteresis
Definition quote_manager.hpp:228
std::uint64_t cancels
Definition quote_manager.hpp:226
std::uint64_t kept_interval
Definition quote_manager.hpp:229
std::uint64_t reject_backoffs
venue rejects that started or extended a side backoff
Definition quote_manager.hpp:232
std::uint64_t priced_out
News not sent: worth less than their order slot ([capacity])
Definition quote_manager.hpp:238
std::uint64_t kept_room
moves towards the touch held: the account is short of room
Definition quote_manager.hpp:236
std::uint64_t priced_out_moves
moves not made, the order left where it rests
Definition quote_manager.hpp:239
std::uint64_t retries
retry() calls that re-applied a starved instrument's quotes
Definition quote_manager.hpp:237
std::uint64_t kept_backoff
News withheld because their side was backing off.
Definition quote_manager.hpp:233
std::uint64_t news
Definition quote_manager.hpp:225
std::uint64_t skipped_pending
Definition quote_manager.hpp:230
std::uint64_t kept_balance
deferred News withheld: the balance no longer covers them
Definition quote_manager.hpp:234
std::uint64_t replaces
Definition quote_manager.hpp:227
std::uint64_t kept_rate_limit
News / Replaces held back for want of an order token.
Definition quote_manager.hpp:235
Rep value
Definition strong_id.hpp:26
constexpr bool valid() const noexcept
Definition strong_id.hpp:31