FIX 4.0 Demo 1.0
Loading...
Searching...
No Matches
fix40::MarketData Struct Reference

行情数据结构体 More...

#include <market_data.hpp>

Collaboration diagram for fix40::MarketData:
Collaboration graph

Public Member Functions

 MarketData ()
 默认构造函数,初始化所有字段为零值
 
void setInstrumentID (const char *id)
 设置合约代码
 
void setExchangeID (const char *id)
 设置交易所代码
 
void setTradingDay (const char *day)
 设置交易日
 
void setUpdateTime (const char *time)
 设置更新时间
 
std::string getInstrumentID () const
 获取合约代码字符串
 
std::string getExchangeID () const
 获取交易所代码字符串
 

Public Attributes

char instrumentID [INSTRUMENT_ID_LEN]
 合约代码
 
char exchangeID [EXCHANGE_ID_LEN]
 交易所代码
 
char tradingDay [DATE_LEN]
 交易日 (YYYYMMDD)
 
char updateTime [TIME_LEN]
 更新时间 (HH:MM:SS)
 
int32_t updateMillisec
 更新毫秒数
 
double lastPrice
 最新价
 
double preSettlementPrice
 昨结算价
 
double preClosePrice
 昨收盘价
 
double openPrice
 开盘价
 
double highestPrice
 最高价
 
double lowestPrice
 最低价
 
double closePrice
 收盘价
 
double settlementPrice
 结算价
 
double upperLimitPrice
 涨停价
 
double lowerLimitPrice
 跌停价
 
double averagePrice
 均价
 
int64_t volume
 成交量
 
double turnover
 成交额
 
double openInterest
 持仓量
 
double preOpenInterest
 昨持仓量
 
double bidPrice1
 买一价
 
int32_t bidVolume1
 买一量
 
double askPrice1
 卖一价
 
int32_t askVolume1
 卖一量
 
double bidPrice2
 买二价
 
int32_t bidVolume2
 买二量
 
double askPrice2
 卖二价
 
int32_t askVolume2
 卖二量
 
double bidPrice3
 买三价
 
int32_t bidVolume3
 买三量
 
double askPrice3
 卖三价
 
int32_t askVolume3
 卖三量
 
double bidPrice4
 买四价
 
int32_t bidVolume4
 买四量
 
double askPrice4
 卖四价
 
int32_t askVolume4
 卖四量
 
double bidPrice5
 买五价
 
int32_t bidVolume5
 买五量
 
double askPrice5
 卖五价
 
int32_t askVolume5
 卖五量
 

Detailed Description

行情数据结构体

设计原则:

  • Trivially copyable 类型,可安全地在无锁队列中传递
  • 使用固定长度字符数组,避免动态内存分配
  • 字段命名清晰,与业务含义对应
  • 与外部数据源(CTP 等)解耦
价格精度
所有价格字段使用 double 类型,精度由具体合约决定。 无效价格使用 0.0 或 DBL_MAX 表示。
线程安全
结构体本身是值类型,可安全复制。 在多线程环境中通过无锁队列传递。

Constructor & Destructor Documentation

◆ MarketData()

fix40::MarketData::MarketData ( )
inline

默认构造函数,初始化所有字段为零值

Member Function Documentation

◆ getExchangeID()

std::string fix40::MarketData::getExchangeID ( ) const
inline

获取交易所代码字符串

◆ getInstrumentID()

std::string fix40::MarketData::getInstrumentID ( ) const
inline

获取合约代码字符串

◆ setExchangeID()

void fix40::MarketData::setExchangeID ( const char *  id)
inline

设置交易所代码

Parameters
id交易所代码字符串

◆ setInstrumentID()

void fix40::MarketData::setInstrumentID ( const char *  id)
inline

设置合约代码

Parameters
id合约代码字符串

◆ setTradingDay()

void fix40::MarketData::setTradingDay ( const char *  day)
inline

设置交易日

Parameters
day交易日字符串 (YYYYMMDD)

◆ setUpdateTime()

void fix40::MarketData::setUpdateTime ( const char *  time)
inline

设置更新时间

Parameters
time时间字符串 (HH:MM:SS)

Member Data Documentation

◆ askPrice1

double fix40::MarketData::askPrice1

卖一价

◆ askPrice2

double fix40::MarketData::askPrice2

卖二价

◆ askPrice3

double fix40::MarketData::askPrice3

卖三价

◆ askPrice4

double fix40::MarketData::askPrice4

卖四价

◆ askPrice5

double fix40::MarketData::askPrice5

卖五价

◆ askVolume1

int32_t fix40::MarketData::askVolume1

卖一量

◆ askVolume2

int32_t fix40::MarketData::askVolume2

卖二量

◆ askVolume3

int32_t fix40::MarketData::askVolume3

卖三量

◆ askVolume4

int32_t fix40::MarketData::askVolume4

卖四量

◆ askVolume5

int32_t fix40::MarketData::askVolume5

卖五量

◆ averagePrice

double fix40::MarketData::averagePrice

均价

◆ bidPrice1

double fix40::MarketData::bidPrice1

买一价

◆ bidPrice2

double fix40::MarketData::bidPrice2

买二价

◆ bidPrice3

double fix40::MarketData::bidPrice3

买三价

◆ bidPrice4

double fix40::MarketData::bidPrice4

买四价

◆ bidPrice5

double fix40::MarketData::bidPrice5

买五价

◆ bidVolume1

int32_t fix40::MarketData::bidVolume1

买一量

◆ bidVolume2

int32_t fix40::MarketData::bidVolume2

买二量

◆ bidVolume3

int32_t fix40::MarketData::bidVolume3

买三量

◆ bidVolume4

int32_t fix40::MarketData::bidVolume4

买四量

◆ bidVolume5

int32_t fix40::MarketData::bidVolume5

买五量

◆ closePrice

double fix40::MarketData::closePrice

收盘价

◆ exchangeID

char fix40::MarketData::exchangeID[EXCHANGE_ID_LEN]

交易所代码

◆ highestPrice

double fix40::MarketData::highestPrice

最高价

◆ instrumentID

char fix40::MarketData::instrumentID[INSTRUMENT_ID_LEN]

合约代码

◆ lastPrice

double fix40::MarketData::lastPrice

最新价

◆ lowerLimitPrice

double fix40::MarketData::lowerLimitPrice

跌停价

◆ lowestPrice

double fix40::MarketData::lowestPrice

最低价

◆ openInterest

double fix40::MarketData::openInterest

持仓量

◆ openPrice

double fix40::MarketData::openPrice

开盘价

◆ preClosePrice

double fix40::MarketData::preClosePrice

昨收盘价

◆ preOpenInterest

double fix40::MarketData::preOpenInterest

昨持仓量

◆ preSettlementPrice

double fix40::MarketData::preSettlementPrice

昨结算价

◆ settlementPrice

double fix40::MarketData::settlementPrice

结算价

◆ tradingDay

char fix40::MarketData::tradingDay[DATE_LEN]

交易日 (YYYYMMDD)

◆ turnover

double fix40::MarketData::turnover

成交额

◆ updateMillisec

int32_t fix40::MarketData::updateMillisec

更新毫秒数

◆ updateTime

char fix40::MarketData::updateTime[TIME_LEN]

更新时间 (HH:MM:SS)

◆ upperLimitPrice

double fix40::MarketData::upperLimitPrice

涨停价

◆ volume

int64_t fix40::MarketData::volume

成交量


The documentation for this struct was generated from the following file: