98 Instrument(
const std::string& instId,
const std::string& exchId,
99 const std::string& prodId,
double tick,
int multiple,
double margin)
163 double remainder = std::fmod(price,
priceTick);
165 return remainder < 1e-9 || (
priceTick - remainder) < 1e-9;
215 return !(*
this == other);
Definition matching_engine.hpp:23
合约静态信息
Definition instrument.hpp:48
Instrument(const std::string &instId, const std::string &exchId, const std::string &prodId, double tick, int multiple, double margin)
带基本参数的构造函数
Definition instrument.hpp:98
std::string productId
品种代码(如 "IF")
Definition instrument.hpp:54
bool isPriceValid(double price) const
检查价格是否在涨跌停范围内
Definition instrument.hpp:141
void updateLimitPrices(double upper, double lower)
更新涨跌停价格
Definition instrument.hpp:176
double calculateMargin(double price, int64_t volume) const
计算开仓保证金
Definition instrument.hpp:127
double priceTick
最小变动价位(如 0.2)
Definition instrument.hpp:59
double marginRate
保证金率(如 0.12 表示 12)
Definition instrument.hpp:61
double lowerLimitPrice
跌停价
Definition instrument.hpp:67
bool isPriceTickValid(double price) const
检查价格是否符合最小变动价位
Definition instrument.hpp:159
bool operator==(const Instrument &other) const
相等比较操作符
Definition instrument.hpp:196
Instrument()
默认构造函数
Definition instrument.hpp:79
double upperLimitPrice
涨停价
Definition instrument.hpp:66
bool operator!=(const Instrument &other) const
不等比较操作符
Definition instrument.hpp:214
int volumeMultiple
合约乘数(如 300)
Definition instrument.hpp:60
double preSettlementPrice
昨结算价
Definition instrument.hpp:68
std::string instrumentId
合约代码(如 "IF2601")
Definition instrument.hpp:52
std::string exchangeId
交易所代码(如 "CFFEX")
Definition instrument.hpp:53