|
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
|
Quoting helpers for strategies (ADR-0012): integer-only, noexcept, no allocation. More...
#include "fastmm/core/config_macros.hpp"#include "fastmm/core/enums.hpp"#include "fastmm/core/fixed_point.hpp"#include "fastmm/core/instrument.hpp"#include "fastmm/core/messages.hpp"#include "fastmm/core/quote_manager.hpp"#include <cstdint>Go to the source code of this file.
Namespaces | |
| namespace | fastmm |
Functions | |
| constexpr Price | fastmm::mid (Price bid, Price ask) noexcept |
| constexpr Price | fastmm::microprice (Level bid, Level ask) noexcept |
| Size-weighted microprice of the touch, truncated toward zero. | |
| constexpr Ratio | fastmm::spread_ratio (Price bid, Price ask) noexcept |
| (ask - bid) / mid; zero when the mid is not positive. 1 bp == Ratio raw 10'000. | |
| constexpr Price | fastmm::away_from (Price ref, Side side, Price dist) noexcept |
A price dist away from ref on the passive side: Buy -> ref - dist, Sell -> ref + dist. | |
| constexpr bool | fastmm::inventory_allows (Side side, Qty position, Qty qty, Qty limit) noexcept |
Whether a fill of qty on side keeps the position within +-limit: Buy needs position + qty <= limit, Sell needs position - qty >= -limit. | |
| void | fastmm::keep_passive (DesiredQuotes &q, Price best_bid, Price best_ask, Price tick) noexcept |
| Post-only quotes must not cross the market. | |
| void | fastmm::fit_side (StaticVector< Level, kMaxQuoteLevels > &levels, Qty room, const Instrument &inst) noexcept |
Cuts one side of a ladder to room in total, keeping the levels closest to the mid: each level is rounded down to the lot, and one left under the lot, the instrument's min_qty or its min_notional ends the side (the venue would refuse it). | |
| template<class Ctx > | |
| void | fastmm::fit_to_reported (Ctx &ctx, InstrumentId id, const Instrument &inst, DesiredQuotes &q) noexcept |
| Cuts both sides of a ladder to what the account's balance on the instrument's venue covers (StrategyContext::balance_room, priced at the side's dearest level). | |
| template<class Ctx > | |
| FASTMM_FORCE_INLINE void | fastmm::fit_to_balance (Ctx &ctx, InstrumentId id, const Instrument &inst, DesiredQuotes &q) noexcept |
Quoting helpers for strategies (ADR-0012): integer-only, noexcept, no allocation.
mid(bid, ask) (bid + ask) / 2, truncated like the books' mid() microprice(bid_level, ask_level) size-weighted mid of the touch spread_ratio(bid, ask) (ask - bid) / mid as a Ratio away_from(ref, side, dist) a bid dist below ref, an ask dist above inventory_allows(side, pos, qty, lim) may this side add qty without passing the limit keep_passive(q, best_bid, best_ask, tick) shift a ladder so level 0 is one tick inside the touch fit_side(levels, room, inst) cut a side to a total quantity fit_to_balance(ctx, id, inst, q) cut both sides to what the account's balance covers
Together with Instrument::ticks(n), DesiredQuotes::bid/ask/uncross and the Ratio operators and literals in core/fixed_point.hpp.