|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#include <fastmm/core/quote_manager.hpp>
Public Member Functions | |
| QuoteManager (const QuoteParams &p={}) noexcept | |
| const QuoteParams & | params () const noexcept |
| void | set_params (const QuoteParams &p) noexcept |
| const QuoteStats & | stats () const noexcept |
| void | set_replace (InstrumentId id, bool on) noexcept |
| Whether the instrument's venue amends in place (default true; supports_replace still applies). | |
| bool | replaces (InstrumentId id) const noexcept |
| template<class Placer > | |
| 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. | |
| template<class Placer > | |
| 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(). | |
| void | pause_quotes (InstrumentId id) noexcept |
| Holds the instrument's orders as they are until resume(): no New, Cancel or Replace, and a target recorded for a slot is dropped (resume() re-applies the whole ladder). | |
| bool | paused (InstrumentId id) const noexcept |
| template<class Placer > | |
| 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 the orders resting now. | |
| bool | resumable (InstrumentId id) const noexcept |
| void | hold_side (Side side, bool on) noexcept |
Holds side on every instrument (on) or ends the hold (off). | |
| bool | side_held (Side side) const noexcept |
| void | hold_side (InstrumentId id, Side side, bool on) noexcept |
| The same for one instrument (the engine's hazard groups, core/hazard.hpp): the side is held while either hold is on. | |
| bool | side_held (InstrumentId id, Side side) const noexcept |
| template<class Placer > | |
| 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 arrives. | |
| template<class Placer > | |
| 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. | |
| bool | starved () const noexcept |
| Instruments whose quotes were held back for want of an order token, oldest first. | |
| std::size_t | starved_count () const noexcept |
| InstrumentId | pop_starved () noexcept |
| Takes the oldest starved instrument off the queue (the caller checks starved() first). | |
| template<class Placer > | |
| 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 pulled meanwhile stays pulled. | |
| bool | backed_off () const noexcept |
| Instruments with a New held back by a side's reject backoff: once the backoff ends, the engine re-applies their last desired quotes (retry_backed_off), so a side comes back by itself rather than at the strategy's next requote, which a quiet market may not bring. | |
| bool | backoff_due (Timestamp now) const noexcept |
| template<class F > | |
| 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); the others stay queued. | |
| template<class Placer > | |
| 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 meanwhile stays pulled. | |
| bool | priced_out () const noexcept |
| Instruments with a level priced out ([capacity]): the engine re-applies their last desired quotes (retry_priced) when the price may have fallen, a window rolling over or a fill giving a slot back. | |
| template<class F > | |
| void | take_priced (F &&f) noexcept |
| Takes every instrument queued now off the queue and calls f(InstrumentId); one priced out again during f queues itself for the next time. | |
| template<class Placer > | |
| std::uint32_t | retry_priced (const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept |
| template<class Placer > | |
| void | on_order_update (const OmsUpdate &u, const Instrument &inst, const Oms &oms, Timestamp now, Placer &&place) noexcept |
| Feed every OmsUpdate here. | |
| Handle< Order > | slot_handle (InstrumentId id, Side s, std::uint32_t level) const noexcept |
| bool | pulled (InstrumentId id) const noexcept |
| const DesiredQuotes & | desired (InstrumentId id) const noexcept |
| The last ladder reconcile() applied to the instrument (empty after a pull). | |
| bool | starved (InstrumentId id) const noexcept |
| The instrument waits for an order token (a New or Replace was rate-limited). | |
| bool | backing_off (InstrumentId id, Side s, Timestamp now) const noexcept |
The side is in its venue-reject backoff at now. | |
Static Public Member Functions | |
| 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. | |
| static constexpr bool | is_quote_tag (std::uint32_t tag) noexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Whether the instrument's venue amends in place (default true; supports_replace still applies).
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
user_tag encoding so a terminal OmsUpdate can be mapped back to its slot.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
Reconciles desired vs resting for one instrument. Returns the number of actions placed.
A level the ladder does not ask for and whose slot is empty has nothing to reconcile.
|
inlinenoexcept |
Cancels every working quote on the instrument and suppresses re-quoting until the next reconcile().
With keep_desired (a pause, not a decision to stop quoting) the last desired quotes are kept for resume(), unless the instrument was already pulled.
< pending: cannot touch; a later pull will catch it
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Ends a pause and re-applies the desired quotes kept by pause_quotes() or pull_quotes(keep_desired) to the orders resting now.
Returns the actions placed.
|
inlinenoexcept |
|
inlinenoexcept |
Holds side on every instrument (on) or ends the hold (off).
While it holds, the side's levels count as empty wherever quotes are reconciled; the desired quotes keep them for reapply().
|
inlinenoexcept |
|
inlinenoexcept |
The same for one instrument (the engine's hazard groups, core/hazard.hpp): the side is held while either hold is on.
|
inlinenoexcept |
|
inlinenoexcept |
Cancels the instrument's working quotes on side, now; one still pending is cancelled when its ack arrives.
The other side and the desired quotes stay as they are. Returns the actions placed.
|
inlinenoexcept |
Re-applies the instrument's last desired quotes (a hold ended); one pulled or paused stays as it is.
|
inlinenoexcept |
Instruments whose quotes were held back for want of an order token, oldest first.
|
inlinenoexcept |
|
inlinenoexcept |
Takes the oldest starved instrument off the queue (the caller checks starved() first).
|
inlinenoexcept |
Re-applies the last desired quotes of an instrument popped from the starved queue; one that was pulled meanwhile stays pulled.
An action held back again queues it at the back.
|
inlinenoexcept |
Instruments with a New held back by a side's reject backoff: once the backoff ends, the engine re-applies their last desired quotes (retry_backed_off), so a side comes back by itself rather than at the strategy's next requote, which a quiet market may not bring.
|
inlinenoexcept |
|
inlinenoexcept |
Takes each instrument whose held-back side may quote at now off the queue and calls f(InstrumentId); the others stay queued.
|
inlinenoexcept |
Re-applies the last desired quotes of an instrument take_backoff_due() handed out; one pulled meanwhile stays pulled.
A side still backing off queues it again.
|
inlinenoexcept |
Instruments with a level priced out ([capacity]): the engine re-applies their last desired quotes (retry_priced) when the price may have fallen, a window rolling over or a fill giving a slot back.
|
inlinenoexcept |
Takes every instrument queued now off the queue and calls f(InstrumentId); one priced out again during f queues itself for the next time.
|
inlinenoexcept |
|
inlinenoexcept |
Feed every OmsUpdate here.
A terminal update frees the slot it belonged to and, if a target was recorded for it (cancel-then-new, or a requote that met the order pending), places the New now. The ack of an order that was pending at a requote applies the recorded target. While the instrument is pulled, an order that has just become working is cancelled instead.
< the venue takes this side
The terminal order was this slot's unless the slot already holds a newer live order. Ids are not compared: a replace changes the order's id, and a stale id used to drop the update and leave the slot waiting for a terminal state forever.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The last ladder reconcile() applied to the instrument (empty after a pull).
|
inlinenoexcept |
The instrument waits for an order token (a New or Replace was rate-limited).
|
inlinenoexcept |
The side is in its venue-reject backoff at now.