FastMM documentation
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::RiskHeadroom Struct Reference

How much more each limit admits for one instrument now: the largest order (or number of orders) that passes that limit's check at this instant, the others aside. More...

#include <fastmm/core/risk_limits.hpp>

Public Attributes

std::int64_t order_tokens = kUnlimited
 orders the rate limiter admits now (orders_per_sec)
 
std::int64_t open_orders = kUnlimited
 more open orders on the instrument (max_open_orders)
 
Qty max_order_qty = Qty::max()
 per order (max_order_qty)
 
Notional max_order_notional = Notional::max()
 per order (max_order_notional)
 
Qty buy_qty = Qty::max()
 Largest buy / sell passing max_position (position plus open orders on that side), rounded down to the lot.
 
Qty sell_qty = Qty::max()
 
Qty underlying_buy_qty = Qty::max()
 Largest buy / sell of this instrument passing [risk.underlying] max_net (the underlying's net plus its open orders on that side, over every instrument), in this instrument's contracts, rounded down to the lot; zero while an inverse contract of the underlying has no mark.
 
Qty underlying_sell_qty = Qty::max()
 
Notional gross_notional = Notional::max()
 Exposure an order may open: max_gross_notional minus the gross exposure, and per direction the net room of max_net_notional.
 
Notional net_buy_notional = Notional::max()
 
Notional net_sell_notional = Notional::max()
 
Notional exposure_buy_notional = Notional::max()
 The same two caps as the notional of one order on this instrument, in its settlement currency (the engine converts with the rate the check uses): the largest buy / sell notional that passes both.
 
Notional exposure_sell_notional = Notional::max()
 
Notional loss_budget = Notional::max()
 max_loss plus the net PnL it is measured against; the kill switch trips at zero or below.
 
Qty balance_buy_qty = Qty::max()
 Largest buy / sell at the book's mid the account's balance on the venue covers ([risk] check_balance, core/balance_book.hpp), rounded down to the lot; unlimited until the venue reports the balance the side draws on.
 
Qty balance_sell_qty = Qty::max()
 

Static Public Attributes

static constexpr std::int64_t kUnlimited = std::numeric_limits<std::int64_t>::max()
 

Detailed Description

How much more each limit admits for one instrument now: the largest order (or number of orders) that passes that limit's check at this instant, the others aside.

What check_new would use next: a request of exactly a room passes that check and one lot more is refused. kUnlimited where the limit is off. Notionals are in the reporting currency ([accounting]) where the check converts.

Member Data Documentation

◆ kUnlimited

constexpr std::int64_t fastmm::RiskHeadroom::kUnlimited = std::numeric_limits<std::int64_t>::max()
staticconstexpr

◆ order_tokens

std::int64_t fastmm::RiskHeadroom::order_tokens = kUnlimited

orders the rate limiter admits now (orders_per_sec)

◆ open_orders

std::int64_t fastmm::RiskHeadroom::open_orders = kUnlimited

more open orders on the instrument (max_open_orders)

◆ max_order_qty

Qty fastmm::RiskHeadroom::max_order_qty = Qty::max()

per order (max_order_qty)

◆ max_order_notional

Notional fastmm::RiskHeadroom::max_order_notional = Notional::max()

per order (max_order_notional)

◆ buy_qty

Qty fastmm::RiskHeadroom::buy_qty = Qty::max()

Largest buy / sell passing max_position (position plus open orders on that side), rounded down to the lot.

◆ sell_qty

Qty fastmm::RiskHeadroom::sell_qty = Qty::max()

◆ underlying_buy_qty

Qty fastmm::RiskHeadroom::underlying_buy_qty = Qty::max()

Largest buy / sell of this instrument passing [risk.underlying] max_net (the underlying's net plus its open orders on that side, over every instrument), in this instrument's contracts, rounded down to the lot; zero while an inverse contract of the underlying has no mark.

◆ underlying_sell_qty

Qty fastmm::RiskHeadroom::underlying_sell_qty = Qty::max()

◆ gross_notional

Notional fastmm::RiskHeadroom::gross_notional = Notional::max()

Exposure an order may open: max_gross_notional minus the gross exposure, and per direction the net room of max_net_notional.

◆ net_buy_notional

Notional fastmm::RiskHeadroom::net_buy_notional = Notional::max()

◆ net_sell_notional

Notional fastmm::RiskHeadroom::net_sell_notional = Notional::max()

◆ exposure_buy_notional

Notional fastmm::RiskHeadroom::exposure_buy_notional = Notional::max()

The same two caps as the notional of one order on this instrument, in its settlement currency (the engine converts with the rate the check uses): the largest buy / sell notional that passes both.

max() when neither cap is on. On the side that reduces the position, the part that closes it (after the open orders on that side, at the book's mid) is added to the gross room, as the caps never refuse it. Only that part while the currency's rate is unknown, where an order that opens exposure is refused (FxRateUnknown).

◆ exposure_sell_notional

Notional fastmm::RiskHeadroom::exposure_sell_notional = Notional::max()

◆ loss_budget

Notional fastmm::RiskHeadroom::loss_budget = Notional::max()

max_loss plus the net PnL it is measured against; the kill switch trips at zero or below.

◆ balance_buy_qty

Qty fastmm::RiskHeadroom::balance_buy_qty = Qty::max()

Largest buy / sell at the book's mid the account's balance on the venue covers ([risk] check_balance, core/balance_book.hpp), rounded down to the lot; unlimited until the venue reports the balance the side draws on.

◆ balance_sell_qty

Qty fastmm::RiskHeadroom::balance_sell_qty = Qty::max()