# 八、C / C++ / C# 共用資料結構 ## 8.1 TradeSession_List 交易時段列表 交易時段列表資料結構 C / C++ ``` typedef struct _Mdcm_TradeSession_List { Mdct_OffsetMinute OffMinute; /* 時間偏移(分鐘) T 日:0~1439 , T-1 日:-1439~0 , T+1 日:1440~2879 */ Mdct_OffsetDay OffDay; /* 日期偏移(日) */ Mdct_TradeSession_Kind Kind; /* 交易時段-盤別種類 */ Mdcs_TradeSession_State State; /* 交易時段-盤別狀態 */ Mdcs_TradeSession_Action Action; /* 交易時段-State 動作旗號 */ } Mdcm_TradeSession_List, *LPMdcm_TradeSession_List; ``` C# class MdcCSApi::TradeSessionList 說明: 時間偏移為負值,表示為前一天。 Ex: OffMinute=-180,即前一日 21:00 為開盤 日期偏移為負值,表示為 “前一個交易日” (非單純的前一日) Ex: OffDay=-1, 若今天是星期一, 所表示的日期為上星期五 --- ## 8.2 PriceScale_SubItem 價格間距子項 價格間距子項資料結構 C / C++ ``` typedef struct _Mdcm_PriceScale_SubItem { Mdct_Price ScopeMin; /* 價格範圍最小值(下限) */ Mdct_Price ScopeMax; /* 價格範圍是大值(上限) */ Mdct_ScopeMode ScopeMode; /* 價格範圍比較模式 */ Mdct_Float Numerator; /* 價格基準分子 */ Mdct_Float Denominator; /* 價格基準分母 */ Mdct_Int MinMovement; /* 最小跳動點數 */ *LPMdcm_PriceScale_SubItem; ``` C# class MdcCSApi::CommodityRoot::PriceScaleSubItem --- ## 8.3 PriceScale_Item 價格間距 價格間距資料結構 C / C++ ``` typedef struct _Mdcm_PriceScale_Item { Mdct_PriceScaleKind Kind; /* 價格檔位種類 */ Mdct_Int Count; /* 價格間距筆數 */ Mdcm_PriceScale_SubItem Item[Mdcm_PriceScale_Sub_MAX]; /* 價格間距資訊 */ } Mdcm_PriceScale_Item, *LPMdcm_PriceScale_Item; ``` C# class MdcCSApi::CommodityRoot::PriceScaleItem --- ## 8.4 Exchange 交易所資訊 交易所資料結構 C / C++ ``` typedef struct _Mdcs_Exchange { Mdct_SExchangeAbbr Abbr; /* 交易所傳輸代碼 */ Mdct_SExchangeName Name; /* 交易所名稱 */ Mdcs_ExchOrderType OrderType; /* 下單類別旗號 */ } Mdcs_Exchange, *LPMdcs_Exchange; #define MDCS_EXCHANGE_LENGTH sizeof(Mdcs_Exchange) ``` C# class MdcCSApi::Exchange --- ## 8.5 CommodityRoot 商品根(品種)資訊 商品根(品種)資料結構 C / C++ ``` typedef struct _Mdcs_CommodityRoot { Mdct_SExchangeAbbr ExchangeAbbr; /* 交易所傳輸代碼 */ Mdct_SCommodityRootAbbr Abbr; /* 品種傳輸代碼 */ Mdct_SCommodityRootName Name; /* 品種名稱 */ Mdct_Int TradeSessionCount; /* 交易時段資訊筆數 */ Mdct_Int PriceScaleCount; /* 價格間距資訊筆數 */ Mdcm_TradeSession_List TradeSessions[Mdcm_TradeSession_List_MAX]; /* 交易時段資訊 */ Mdcm_PriceScale_Item PriceScales[Mdcm_PriceScale_MAX]; /* 價格間距資訊 */ Mdct_SExchangeAbbr TargetExchCode; /* 衍生性商品的交易所 */ Mdct_SCommodityCode TargetCommCode; /* 衍生性商品的標地物 */ Mdct_Double ContractMultiplier; /* 契約乘數 */ Mdct_SCurrency Currency; /* 貨幣代碼 */ Mdct_Double Fee; /* 手續費 */ Mdct_Double TransactionTax; /* 交易稅 */ Mdct_Int BoardLot; /* 最小單位股數 */ Mdct_CommodityCategory Category; /* 根商品類別 */ Mdct_Utc Utc; /* 時區 (分鐘單位) */ Mdct_CommodityRootCondition Condition; /* 根商品延伸資訊 */ } Mdcs_CommodityRoot, *LPMdcs_CommodityRoot; ``` C# class MdcCSApi::CommodityRoot --- ## 8.6 Commodity 商品資料 商品資料結構 C / C++ ``` typedef struct _Mdcs_Commodity { Mdct_SExchangeAbbr ExchangeAbbr; /* 交易所傳輸代碼 */ Mdct_SCommodityCode Code; /* 商品代碼 */ Mdct_SCommodityName Name; /* 商品名稱 */ Mdct_SCommodityRootAbbr CommRootAbbr; /* 品種傳輸代碼 */ Mdct_Date DeliveryYM; /* 契約月份 */ Mdct_Date OrgContractDate; /* 交易所原生契約月份 */ Mdct_Date CreateDate; /* 上市日期 */ Mdct_Date SettlementDate; /* 結算日期 */ Mdct_Date NoticeDate1; /* 第一通知日 */ Mdct_Date NoticeDate2; /* 第二通知日 */ Mdct_Date ExpireDate; /* 市場最後交易日 */ Mdct_Date LastTradingday; /* 最後可交易日期 */ Mdct_CommodityCategory Category; /* 商品類別 */ Mdct_BoardLot BoardLot; /* 最小單位股數 */ Mdct_Price StrikePrice; /* 選擇權履約價 */ Mdcm_CommodityCategoryCondition CategoryCondition; /* 商品類別附加資訊 */ Mdct_Int PriceScaleCount; /* 價格間距筆數 */ Mdcm_PriceScale_SubItem PriceScales[Mdcm_PriceScale_Sub_MAX]; /* 價格間距資訊 */ } Mdcs_Commodity, *LPMdcs_Commodity; ``` C# class MdcCSApi::Commodity --- ## 8.7 CommodityResponse 商品資訊查詢回應資料 商品資訊查詢回應資料結構 C / C++ ``` typedef struct _Mdcs_CommodityResponse { Mdct_Int ErrorCode; /* 錯誤代碼 */ Mdct_CPChar ErrorMessage; /* 錯誤訊息 */ Mdct_Int ExchangeCount; /* 交易所數量 */ LPMdcs_Exchange Exchange; /* 交易所資訊 */ Mdct_Int CommodityRootCount; /* 商品品種數量 */ LPMdcs_CommodityRoot CommodityRoot; /* 商品品種資訊 */ Mdct_Int CommodityCount; /* 商品數量 */ LPMdcs_Commodity Commodity; /* 商品資訊 */ } Mdcs_CommodityResponse, *LPMdcs_CommodityResponse; ``` C# class MdcCSApi::CommodityResponse 說明 ErrorCode 為0 時,表示查詢成功,ErrorMessage 也為 NULL (無說明),Count 為 數量,資料在指標陣列中取出。 --- ## 8.8 QuotationFlagBase 行情資料結構旗號基礎 行情資料結構 C / C++ ``` typedef struct _Mdcs_Quot_FlagBase { struct { Mdcs_Quot_Column_Flag Exist; /* 存在旗號 */ Mdcs_Quot_Column_Flag Update; /* 更新旗號 */ } _flag; } Mdcs_Quot_FlagBase; ``` C# struct MdcCSApi::Mdcs_Quot_FlagBase< T> --- ## 8.9 QuotationBasic 行情靜態資料結構 C / C++ ``` typedef struct _Mdcs_Quot_Basic : public Mdcs_Quot_FlagBase { Mdcs_QCT_Basic_TsState TsState; /* 交易時段狀態 */ Mdcs_QCT_Basic_TradingDay TradingDay; /* 交易日期 */ Mdcs_QCT_Basic_UpperLimitPrice UpperLimitPrice; /* 漲停價 */ Mdcs_QCT_Basic_LowerLimitPrice LowerLimitPrice; /* 跌停價 */ Mdcs_QCT_Basic_SettlementPrice SettlementPrice; /* 結算價 */ Mdcs_QCT_Basic_PreSettlementPrice PreSettlementPrice; /* 昨日結算價 */ Mdcs_QCT_Basic_PreClosePrice PreClosePrice; /* 昨日收盤價 */ Mdcs_QCT_Basic_PreOpenInterest PreOpenInterest; /* 昨日未平倉 */ Mdcs_QCT_Basic_TsKind TsKind; /*交易時段種類 */ Mdcs_QCT_Basic_ClosePrice ClosePrice; /* 收盤價 */ Mdcs_QCT_Basic_ReferencePrice ReferencePrice; /* 參考價 */ Mdcs_QCT_Basic_Utc Utc; /* UTC 分鐘時間 */ } Mdcs_Quot_Basic, *LPMdcs_Quot_Basic; ``` C# struct MdcCSApi::Mdcs_Quot_Basic --- ## 8.10 QuotationDeal 行情成交資料結構 C / C++ ``` typedef struct _Mdcs_Quot_Deal : public Mdcs_Quot_FlagBase { Mdcs_QCT_Deal_Date Date; /* 日期 */ Mdcs_QCT_Deal_Time Time; /* 時間 */ Mdcs_QCT_Deal_LastPrice LastPrice; /* 最新價 */ Mdcs_QCT_Deal_OpenPrice OpenPrice; /* 今日開盤價 */ Mdcs_QCT_Deal_Amount Amount; /* 成交金額 */ Mdcs_QCT_Deal_TotalAmount TotalAmount; /* 總成交金額 */ Mdcs_QCT_Deal_HighestPrice HighestPrice; /* 最高價 */ Mdcs_QCT_Deal_LowestPrice LowestPrice; /* 最低價 */ Mdcs_QCT_Deal_Volume Volume; /* 現量 */ Mdcs_QCT_Deal_TotalVolume TotalVolume; /* 總量 */ Mdcs_QCT_Deal_OpenInterest OpenInterest; /* 合約持倉量 */ Mdcs_QCT_Deal_OutStandingVolume OutStandingVolume; /* 當前未平倉量 */ Mdcs_QCT_Deal_PriceInDepth PriceInDepth; /* 價位於委託簿位置 */ Mdcs_QCT_Deal_BidPrice BidPrice; /* 買價 */ Mdcs_QCT_Deal_AskPrice AskPrice; /* 賣價 */ Mdcs_QCT_Deal_BidVolume BidVolume; /* 買量 */ Mdcs_QCT_Deal_AskVolume AskVolume; /* 賣量 */ Mdcs_QCT_Deal_TradeCondition TradeCondition; /* 交易狀態 */ Mdcs_QCT_Deal_OTCVolume OTCVolume; /* 場外交易量(Over The Counter) */ } Mdcs_Quot_Deal, *LPMdcs_Quot_Deal; ``` C# struct MdcCSApi::Mdcs_Quot_Deal --- ## 8.11 QuotationDepth 行情委託簿資料結構 C / C++ ``` typedef struct _Mdcs_Quot_Depth : public Mdcs_Quot_FlagBase { Mdcs_QCT_Depth_Date Date; /* 日期 */ Mdcs_QCT_Depth_Time Time; /* 時間 */ Mdcs_QCT_Depth_BidPrice1 BidPrice1; /* 買價1 */ Mdcs_QCT_Depth_AskPrice1 AskPrice1; /* 賣價1 */ Mdcs_QCT_Depth_BidVolume1 BidVolume1; /* 買量1 */ Mdcs_QCT_Depth_AskVolume1 AskVolume1; /* 賣量1 */ Mdcs_QCT_Depth_BidPrice2 BidPrice2; /* 買價2 */ Mdcs_QCT_Depth_AskPrice2 AskPrice2; /* 賣價2 */ Mdcs_QCT_Depth_BidVolume2 BidVolume2; /* 買量2 */ Mdcs_QCT_Depth_AskVolume2 AskVolume2; /* 賣量2 */ Mdcs_QCT_Depth_BidPrice3 BidPrice3; /* 買價3 */ Mdcs_QCT_Depth_AskPrice3 AskPrice3; /* 賣價3 */ Mdcs_QCT_Depth_BidVolume3 BidVolume3; /* 買量3 */ Mdcs_QCT_Depth_AskVolume3 AskVolume3; /* 賣量3 */ Mdcs_QCT_Depth_BidPrice4 BidPrice4; /* 買價4 */ Mdcs_QCT_Depth_AskPrice4 AskPrice4; /* 賣價4 */ Mdcs_QCT_Depth_BidVolume4 BidVolume4; /* 買量4 */ Mdcs_QCT_Depth_AskVolume4 AskVolume4; /* 賣量4 */ Mdcs_QCT_Depth_BidPrice5 BidPrice5; /* 買價5 */ Mdcs_QCT_Depth_AskPrice5 AskPrice5; /* 賣價5 */ Mdcs_QCT_Depth_BidVolume5 BidVolume5; /* 買量5 */ Mdcs_QCT_Depth_AskVolume5 AskVolume5; /* 賣量5 */ Mdcs_QCT_Depth_BidPrice6 BidPrice6; /* 買價6 */ Mdcs_QCT_Depth_AskPrice6 AskPrice6; /* 賣價6 */ Mdcs_QCT_Depth_BidVolume6 BidVolume6; /* 買量6 */ Mdcs_QCT_Depth_AskVolume6 AskVolume6; /* 賣量6 */ Mdcs_QCT_Depth_BidPrice7 BidPrice7; /* 買價7 */ Mdcs_QCT_Depth_AskPrice7 AskPrice7; /* 賣價7 */ Mdcs_QCT_Depth_BidVolume7 BidVolume7; /* 買量7 */ Mdcs_QCT_Depth_AskVolume7 AskVolume7; /* 賣量7 */ Mdcs_QCT_Depth_BidPrice8 BidPrice8; /* 買價8 */ Mdcs_QCT_Depth_AskPrice8 AskPrice8; /* 賣價8 */ Mdcs_QCT_Depth_BidVolume8 BidVolume8; /* 買量8 */ Mdcs_QCT_Depth_AskVolume8 AskVolume8; /* 賣量8 */ Mdcs_QCT_Depth_BidPrice9 BidPrice9; /* 買價9 */ Mdcs_QCT_Depth_AskPrice9 AskPrice9; /* 賣價9 */ Mdcs_QCT_Depth_BidVolume9 BidVolume9; /* 買量9 */ Mdcs_QCT_Depth_AskVolume9 AskVolume9; /* 賣量9 */ Mdcs_QCT_Depth_BidPrice10 BidPrice10; /* 買價10 */ Mdcs_QCT_Depth_AskPrice10 AskPrice10; /* 賣價10 */ Mdcs_QCT_Depth_BidVolume10 BidVolume10; /* 買量10 */ Mdcs_QCT_Depth_AskVolume10 AskVolume10; /* 賣量10 */ Mdcs_QCT_Depth_BidPrice11 BidPrice11; /* 買價11 */ Mdcs_QCT_Depth_AskPrice11 AskPrice11; /* 賣價11 */ Mdcs_QCT_Depth_BidVolume11 BidVolume11; /* 買量11 */ Mdcs_QCT_Depth_AskVolume11 AskVolume11; /* 賣量11 */ Mdcs_QCT_Depth_BidPrice12 BidPrice12; /* 買價12 */ Mdcs_QCT_Depth_AskPrice12 AskPrice12; /* 賣價12 */ Mdcs_QCT_Depth_BidVolume12 BidVolume12; /* 買量12 */ Mdcs_QCT_Depth_AskVolume12 AskVolume12; /* 賣量12 */ Mdcs_QCT_Depth_BidPrice13 BidPrice13; /* 買價13 */ Mdcs_QCT_Depth_AskPrice13 AskPrice13; /* 賣價13 */ Mdcs_QCT_Depth_BidVolume13 BidVolume13; /* 買量13 */ Mdcs_QCT_Depth_AskVolume13 AskVolume13; /* 賣量13 */ Mdcs_QCT_Depth_BidPrice14 BidPrice14; /* 買價14 */ Mdcs_QCT_Depth_AskPrice14 AskPrice14; /* 賣價14 */ Mdcs_QCT_Depth_BidVolume14 BidVolume14; /* 買量14 */ Mdcs_QCT_Depth_AskVolume14 AskVolume14; /* 賣量14 */ Mdcs_QCT_Depth_BidPrice15 BidPrice15; /* 買價15 */ Mdcs_QCT_Depth_AskPrice15 AskPrice15; /* 賣價15 */ Mdcs_QCT_Depth_BidVolume15 BidVolume15; /* 買量15 */ Mdcs_QCT_Depth_AskVolume15 AskVolume15; /* 賣量15 */ Mdcs_QCT_Depth_BidPrice16 BidPrice16; /* 買價16 */ Mdcs_QCT_Depth_AskPrice16 AskPrice16; /* 賣價16 */ Mdcs_QCT_Depth_BidVolume16 BidVolume16; /* 買量16 */ Mdcs_QCT_Depth_AskVolume16 AskVolume16; /* 賣量16 */ Mdcs_QCT_Depth_BidPrice17 BidPrice17; /* 買價17 */ Mdcs_QCT_Depth_AskPrice17 AskPrice17; /* 賣價17 */ Mdcs_QCT_Depth_BidVolume17 BidVolume17; /* 買量17 */ Mdcs_QCT_Depth_AskVolume17 AskVolume17; /* 賣量17 */ Mdcs_QCT_Depth_BidPrice18 BidPrice18; /* 買價18 */ Mdcs_QCT_Depth_AskPrice18 AskPrice18; /* 賣價18 */ Mdcs_QCT_Depth_BidVolume18 BidVolume18; /* 買量18 */ Mdcs_QCT_Depth_AskVolume18 AskVolume18; /* 賣量18 */ Mdcs_QCT_Depth_BidPrice19 BidPrice19; /* 買價19 */ Mdcs_QCT_Depth_AskPrice19 AskPrice19; /* 賣價19 */ Mdcs_QCT_Depth_BidVolume19 BidVolume19; /* 買量19 */ Mdcs_QCT_Depth_AskVolume19 AskVolume19; /* 賣量19 */ Mdcs_QCT_Depth_BidPrice20 BidPrice20; /* 買價20 */ Mdcs_QCT_Depth_AskPrice20 AskPrice20; /* 賣價20 */ Mdcs_QCT_Depth_BidVolume20 BidVolume20; /* 買量20 */ Mdcs_QCT_Depth_AskVolume20 AskVolume20; /* 賣量20 */ } Mdcs_Quot_Depth, *LPMdcs_Quot_Depth; ``` C# struct MdcCSApi::Mdcs_Quot_Depth --- ## 8.12 QuotationPtr 事件使用行情結構指位器 C / C++ ``` typedef struct _Mdcs_QuotationPtr { Mdct_PChar Exchange; /* 交易所 */ Mdct_PChar Commodity; /* 商品代碼 */ Mdct_UniqueID UniqueID; /* 唯一識別ID */ LPMdcs_Quot_Basic Basic; /* 基本資料 */ LPMdcs_Quot_Deal Deal; /* 成交資料 */ LPMdcs_Quot_Depth Depth; /* 委託簿資料 */ } Mdcs_QuotationPtr, *LPMdcs_QuotationPtr; ``` C# [struct MdcCSApi::Mdcs_Quotation](/t--ZA6_RRXS99V04pAiJ7Q#114-MdcCommon-%E9%80%9A%E7%94%A8%E8%B3%87%E8%A8%8A%E7%89%A9%E4%BB%B6) ※ UniqueID 特性請參 [附錄二、QuotationPtr.UniqueID 應用邏輯與特性](/lSqguQgsQ_W9FmmSMztgBQ#132-%E9%99%84%E9%8C%84%E4%BA%8C%E3%80%81QuotationPtrUniqueID-%E6%87%89%E7%94%A8%E9%82%8F%E8%BC%AF%E8%88%87%E7%89%B9%E6%80%A7) --- ## 8.13 QuotationResponse 行情快照回應 行情快照查詢回應資料結構 C / C++ ``` typedef struct _Mdcs_QuotationResponse { Mdct_Int ErrorCode; /* 錯誤代碼 */ Mdct_CPChar ErrorMessage; /* 錯誤訊息 */ Mdct_Int QuotationCount; /* 回傳陣列筆數 */ LPMdcs_QuotationPtr Quotation; /* 回傳查詢陣列 */ } Mdcs_QuotationResponse, *LPMdcs_QuotationResponse; ``` C# class MdcCSApi::QuotationResponse 說明 ErrorCode 為0 時,表示查詢成功,ErrorMessage 也為 NULL (無說明), QuotationCount 為查詢回應的數量,資料在指標陣列中取出。 --- ## 8.14 RequestArgument 查詢參數 歷史及即時資料查詢參數 C / C++ ``` typedef struct _Mdcs_RequestArgument { Mdct_RequestId RequestId; /* 查詢唯一識別碼 */ Mdct_SExchangeAbbr ExchangeAbbr; /* 交易所代碼 */ Mdct_SCommodityCode CommodityCode; /* 商品代碼 */ Mdcm_DataType DataType; /* 資料類型(Mdcm_DT_xxxx)*/ Mdcs_DockMode DockMode; /* 指定資料歸線模式 */ Mdct_Bool Realtime; /* 指明需要即時行情加入 */ Mdct_Int DockValue; /* 指定歸線參數(N 分線) */ Mdcs_Condition Condition; /* 附加條件(Mdcs_CND_xxxx) */ Mdct_Date StartDate; /* 查詢的起始日期 */ Mdct_TimeEx StartTime; /* 查詢的起始時間 */ Mdct_Date EndDate; /* 查詢的起始日期 */ Mdct_TimeEx EndTime; /* 查詢的起始時間 */ Mdcs_TimeZone TimeZone; /* 查詢的日期時間所屬時區*/ } Mdcs_RequestArgument, *LPMdcs_RequestArgument; ``` C# class MdcCSApi::RequestArgument --- ## 8.15 Tick 逐筆成交 逐筆成交的歷史及即時資料結構 C / C++ ``` typedef struct _Mdcs_Tick { Mdcs_HCT_Date Date; /* 日期 YYYYMMDD */ Mdcs_HCT_Time Time; /* 時間 HHMMSSfff */ Mdcs_HCT_Price Price; /* 成交價 */ Mdcs_HCT_Volume Volume; /* 成交單量 */ Mdcs_HCT_Amount Amount; /* 成交金額 */ Mdcs_HCT_PriceInDepth PriceInDepth; /* 價位於委託簿位置 */ Mdcs_RespDataStatus Status; /* 狀態旗號 */ } Mdcs_Tick, *LPMdcs_Tick; ``` C# Struct MdcCSApi::Mdcs_Tick --- ## 8.16 Depth 買賣20檔 買賣檔位 (委託簿) 歷史及即時資料結構 C / C++ ``` typedef struct _Mdcs_Depth { Mdcs_HCT_Date Date; /* 日期 YYYYMMDD */ Mdcs_HCT_Time Time; /* 時間 HHMMSSfff */ Mdcs_HCT_BidPrice1 BidPrice1; /* 買價1 */ Mdcs_HCT_AskPrice1 AskPrice1; /* 賣價1 */ Mdcs_HCT_BidVolume1 BidVolume1; /* 買量1 */ Mdcs_HCT_AskVolume1 AskVolume1; /* 賣量1 */ Mdcs_HCT_BidPrice2 BidPrice2; /* 買價2 */ Mdcs_HCT_AskPrice2 AskPrice2; /* 賣價2 */ Mdcs_HCT_BidVolume2 BidVolume2; /* 買量2 */ Mdcs_HCT_AskVolume2 AskVolume2; /* 賣量2 */ Mdcs_HCT_BidPrice3 BidPrice3; /* 買價3 */ Mdcs_HCT_AskPrice3 AskPrice3; /* 賣價3 */ Mdcs_HCT_BidVolume3 BidVolume3; /* 買量3 */ Mdcs_HCT_AskVolume3 AskVolume3; /* 賣量3 */ Mdcs_HCT_BidPrice4 BidPrice4; /* 買價4 */ Mdcs_HCT_AskPrice4 AskPrice4; /* 賣價4 */ Mdcs_HCT_BidVolume4 BidVolume4; /* 買量4 */ Mdcs_HCT_AskVolume4 AskVolume4; /* 賣量4 */ Mdcs_HCT_BidPrice5 BidPrice5; /* 買價5 */ Mdcs_HCT_AskPrice5 AskPrice5; /* 賣價5 */ Mdcs_HCT_BidVolume5 BidVolume5; /* 買量5 */ Mdcs_HCT_AskVolume5 AskVolume5; /* 賣量5 */ Mdcs_HCT_BidPrice6 BidPrice6; /* 買價6 */ Mdcs_HCT_AskPrice6 AskPrice6; /* 賣價6 */ Mdcs_HCT_BidVolume6 BidVolume6; /* 買量6 */ Mdcs_HCT_AskVolume6 AskVolume6; /* 賣量6 */ Mdcs_HCT_BidPrice7 BidPrice7; /* 買價7 */ Mdcs_HCT_AskPrice7 AskPrice7; /* 賣價7 */ Mdcs_HCT_BidVolume7 BidVolume7; /* 買量7 */ Mdcs_HCT_AskVolume7 AskVolume7; /* 賣量7 */ Mdcs_HCT_BidPrice8 BidPrice8; /* 買價8 */ Mdcs_HCT_AskPrice8 AskPrice8; /* 賣價8 */ Mdcs_HCT_BidVolume8 BidVolume8; /* 買量8 */ Mdcs_HCT_AskVolume8 AskVolume8; /* 賣量8 */ Mdcs_HCT_BidPrice9 BidPrice9; /* 買價9 */ Mdcs_HCT_AskPrice9 AskPrice9; /* 賣價9 */ Mdcs_HCT_BidVolume9 BidVolume9; /* 買量9 */ Mdcs_HCT_AskVolume9 AskVolume9; /* 賣量9 */ Mdcs_HCT_BidPrice10 BidPrice10; /* 買價10 */ Mdcs_HCT_AskPrice10 AskPrice10; /* 賣價10 */ Mdcs_HCT_BidVolume10 BidVolume10; /* 買量10 */ Mdcs_HCT_AskVolume10 AskVolume10; /* 賣量10 */ Mdcs_HCT_BidPrice11 BidPrice11; /* 買價11 */ Mdcs_HCT_AskPrice11 AskPrice11; /* 賣價11 */ Mdcs_HCT_BidVolume11 BidVolume11; /* 買量11 */ Mdcs_HCT_AskVolume11 AskVolume11; /* 賣量11 */ Mdcs_HCT_BidPrice12 BidPrice12; /* 買價12 */ Mdcs_HCT_AskPrice12 AskPrice12; /* 賣價12 */ Mdcs_HCT_BidVolume12 BidVolume12; /* 買量12 */ Mdcs_HCT_AskVolume12 AskVolume12; /* 賣量12 */ Mdcs_HCT_BidPrice13 BidPrice13; /* 買價13 */ Mdcs_HCT_AskPrice13 AskPrice13; /* 賣價13 */ Mdcs_HCT_BidVolume13 BidVolume13; /* 買量13 */ Mdcs_HCT_AskVolume13 AskVolume13; /* 賣量13 */ Mdcs_HCT_BidPrice14 BidPrice14; /* 買價14 */ Mdcs_HCT_AskPrice14 AskPrice14; /* 賣價14 */ Mdcs_HCT_BidVolume14 BidVolume14; /* 買量14 */ Mdcs_HCT_AskVolume14 AskVolume14; /* 賣量14 */ Mdcs_HCT_BidPrice15 BidPrice15; /* 買價15 */ Mdcs_HCT_AskPrice15 AskPrice15; /* 賣價15 */ Mdcs_HCT_BidVolume15 BidVolume15; /* 買量15 */ Mdcs_HCT_AskVolume15 AskVolume15; /* 賣量15 */ Mdcs_HCT_BidPrice16 BidPrice16; /* 買價16 */ Mdcs_HCT_AskPrice16 AskPrice16; /* 賣價16 */ Mdcs_HCT_BidVolume16 BidVolume16; /* 買量16 */ Mdcs_HCT_AskVolume16 AskVolume16; /* 賣量16 */ Mdcs_HCT_BidPrice17 BidPrice17; /* 買價17 */ Mdcs_HCT_AskPrice17 AskPrice17; /* 賣價17 */ Mdcs_HCT_BidVolume17 BidVolume17; /* 買量17 */ Mdcs_HCT_AskVolume17 AskVolume17; /* 賣量17 */ Mdcs_HCT_BidPrice18 BidPrice18; /* 買價18 */ Mdcs_HCT_AskPrice18 AskPrice18; /* 賣價18 */ Mdcs_HCT_BidVolume18 BidVolume18; /* 買量18 */ Mdcs_HCT_AskVolume18 AskVolume18; /* 賣量18 */ Mdcs_HCT_BidPrice19 BidPrice19; /* 買價19 */ Mdcs_HCT_AskPrice19 AskPrice19; /* 賣價19 */ Mdcs_HCT_BidVolume19 BidVolume19; /* 買量19 */ Mdcs_HCT_AskVolume19 AskVolume19; /* 賣量19 */ Mdcs_HCT_BidPrice20 BidPrice20; /* 買價20 */ Mdcs_HCT_AskPrice20 AskPrice20; /* 賣價20 */ Mdcs_HCT_BidVolume20 BidVolume20; /* 買量20 */ Mdcs_HCT_AskVolume20 AskVolume20; /* 賣量20 */ Mdcs_RespDataStatus Status; /* 狀態旗號 */ } Mdcs_Depth, *LPMdcs_Depth; ``` C# Struct MdcCSApi::Mdcs_Depth --- ## 8.17 Candlestick 燭K線 燭K 線 (分線、日線) 的歷史與即時資料結構 C / C++ ``` typedef struct _Mdcs_Candlestick { Mdcs_HCT_Date Date; /* 日期 YYYYMMDD */ Mdcs_HCT_Time Time; /* 時間 HHMMSSfff */ Mdcs_HCT_OpenPrice OpenPrice; /* 開價 */ Mdcs_HCT_HighestPrice HighestPrice; /* 高價 */ Mdcs_HCT_LowestPrice LowestPrice; /* 低價 */ Mdcs_HCT_ClosePrice ClosePrice; /* 收價 */ Mdcs_HCT_TotalVolume TotalVolume; /* 總成交量 */ Mdcs_HCT_TotalAmount TotalAmount; /* 總成交金額 */ Mdcs_HCT_OpenInterest OpenInterest; /* 未平倉量 */ Mdcs_HCT_UpTicks UpTicks; /* 上漲筆數 */ Mdcs_HCT_UpVolume UpVolume; /* 上漲量 */ Mdcs_HCT_UnchangedTicks UnchangedTicks; /* 平盤筆數 */ Mdcs_HCT_UnchangedVolume UnchangedVolume; /* 平盤量 */ Mdcs_HCT_DownTicks DownTicks; /* 下跌筆數 */ Mdcs_HCT_DownVolume DownVolume; /* 下跌量 */ Mdcs_RespDataStatus Status; /* 狀態旗號 */ } Mdcs_Candlestick, *LPMdcs_Candlestick; ``` C# Struct MdcCSApi::Mdcs_Candlestick --- ## 8.18 HistoryResponse 歷史查詢回應資料 歷史查詢回應資料結構 C / C++ ``` typedef struct _Mdcs_HistoryResponse { Mdct_Int ErrorCode; /* 錯誤代碼 */ Mdct_CPChar ErrorMessage; /* 錯誤訊息 */ Mdcs_ResponseDataType RespDataType; /* 資料結構類別 */ Mdct_PVoid pData; /* 指向不同的資料結構 */ Mdct_Size Count; /* 資料結構筆數 */ } Mdcs_HistoryResponse, *LPMdcs_HistoryResponse; ``` C# Struct MdcCSApi::HistoryResponse 說明 ErrorCode 為0 時,表示查詢成功,ErrorMessage 也為 NULL (無說明)。 resp_data_type: 資料結構類別 ([Mdcs_RDT_XXXX](/dU9xSl1YTW2oYjzsjHtSZQ#719-ResponseDataType-%E6%AD%B7%E5%8F%B2%E8%B3%87%E6%96%99%E9%A1%9E%E5%9E%8B)) pdata: 依 resp_data_type 指向不同的資料結構 count: 資料結構筆數 特別說明 resp_data_type / pdata |Resp_data_type|Pdata| |---|---| |Mdcs_RDT_Tick |[LPMdcs_Tick](/v-KO6tAmRqmK8ykncHtxSQ#815-Tick-%E9%80%90%E7%AD%86%E6%88%90%E4%BA%A4)| |Mdcs_RDT_Depth |[LPMdcs_Depth](/v-KO6tAmRqmK8ykncHtxSQ#816-Depth-%E8%B2%B7%E8%B3%A320-%E6%AA%94)| |Mdcs_RDT_Candlestick |[LPMdcs_Candlestick](/v-KO6tAmRqmK8ykncHtxSQ#817-Candlestick-%E7%87%ADK-%E7%B7%9A)| --- ## 8.19 ContinuousCode 連續月商品資訊 連續月商品資料結構 C / C++ ``` typedef struct _Mdcs_ContinuousCode { Mdct_SExchangeAbbr ExchangeAbbr; /* 交易所代碼 */ Mdct_SCommodityCode CommodityCode; /* 連續月商品代碼 */ Mdct_SCommodityName CommodityName; /* 連續月商品名稱 */ Mdct_SCommodityCode NowRefCode; /* 當下參考商品代碼 */ Mdct_SCommodityCode NextRefCode; /* 切換商品代碼 */ Mdct_Date NextUtcDate; /* 切換UTC 日期(YYYYMMDD) */ Mdct_Time NextUtcTime; /* 切換UTC 時間(HHMMSSfff) */ } Mdcs_ContinuousCode, *LPMdcs_ContinuousCode; ``` C# Struct MdcCSApi::ContinuousCode --- ###### tags: `行情API技術文件`