|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
The prices, the windows and the learned yields of one engine. More...
#include <fastmm/core/capacity_price.hpp>
Public Member Functions | |
| void | configure (const CapacityConfig &cfg) noexcept |
| const CapacityConfig & | config () const noexcept |
| bool | on () const noexcept |
| CapacityMode | mode () const noexcept |
| const CapacityThreshold & | threshold () const noexcept |
| double | floor () const noexcept |
| bool | prices (VenueId account) const noexcept |
Whether orders on account are priced ([capacity] venues). | |
| bool | enforces (bool move) const noexcept |
| Whether a refusal below the price is enforced for a new order or for a move. | |
| void | on_send (VenueId account, VenueId primary, InstrumentId id, Side side, double notional, std::int64_t now_ns) noexcept |
A new order or a replace went to account (of the pool whose primary is primary). | |
| void | on_request (VenueId primary, std::int64_t now_ns) noexcept |
| A cancel (or any other request) of the pool: weight only. | |
| void | on_fill (VenueId account, InstrumentId id, Side side, double order_notional, double fill_notional, bool first, std::int64_t now_ns) noexcept |
A fill of an order placed with order_notional; first: the order's first fill. | |
| CapacityQuote | quote (VenueId account, VenueId primary, std::int64_t now_ns) const noexcept |
| double | price (VenueId account, VenueId primary, std::int64_t now_ns) const noexcept |
| double | learned_value (InstrumentId id, Side side, double notional) const noexcept |
The learned value of a quote of notional on (id, side), quote currency. | |
| bool | decide (VenueId account, double value, double price, bool move, bool enforced, InstrumentId id=InstrumentId{}, Side side=Side::Buy, std::int64_t now_ns=0) noexcept |
An action of value (a move: its gain) was priced at price on account; returns whether it passes. | |
| const CapacityMinute & | totals () const noexcept |
| bool | recheck_due (std::int64_t now_ns) const noexcept |
| A priced-out level is applied again once a window has rolled over or a fill gave a slot back. | |
| void | rechecked (std::int64_t now_ns) noexcept |
| bool | tick_due (std::int64_t now_ns) const noexcept |
| template<class Emit > | |
| void | tick (std::int64_t now_ns, Emit &&emit) noexcept |
Once a minute: decay the yields, refit the floor and the day prices, and hand each account's minute to emit(VenueId, const CapacityMinute&) before clearing it. | |
| double | day_price (VenueId account) const noexcept |
Static Public Attributes | |
| static constexpr int | kClasses = 6 |
| by notional over the minimum: <2, <6, <12, <22, <60, more | |
| static constexpr double | kPriorYield = 0.02 |
| filled per placed notional before any is learned | |
| static constexpr double | kShrinkOrders = 20.0 |
| a cell's estimate leans on its class's for this | |
| static constexpr std::int64_t | kTickNs = 60'000'000'000 |
| static constexpr std::int64_t | kWeightWindowNs = 60'000'000'000 |
| static constexpr double | kYieldHalfLifeS = 6.0 * 3600.0 |
The prices, the windows and the learned yields of one engine.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Whether orders on account are priced ([capacity] venues).
|
inlinenoexcept |
Whether a refusal below the price is enforced for a new order or for a move.
|
inlinenoexcept |
A new order or a replace went to account (of the pool whose primary is primary).
|
inlinenoexcept |
A cancel (or any other request) of the pool: weight only.
|
inlinenoexcept |
A fill of an order placed with order_notional; first: the order's first fill.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The learned value of a quote of notional on (id, side), quote currency.
|
inlinenoexcept |
An action of value (a move: its gain) was priced at price on account; returns whether it passes.
Records it in the account's minute and in the day's demand. A refusal of instrument id's side that was already refused in the same window is the same demand asked again (a strategy requoting a priced-out level): refused, and recorded once.
< unpriced
|
inlinenoexcept |
|
inlinenoexcept |
A priced-out level is applied again once a window has rolled over or a fill gave a slot back.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Once a minute: decay the yields, refit the floor and the day prices, and hand each account's minute to emit(VenueId, const CapacityMinute&) before clearing it.
|
inlinenoexcept |
|
staticconstexpr |
by notional over the minimum: <2, <6, <12, <22, <60, more
|
staticconstexpr |
filled per placed notional before any is learned
|
staticconstexpr |
a cell's estimate leans on its class's for this
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |