.. _grafana-reference: 数据结构表 ================================================== .. contents:: 目录 账户资金表 AccountSnap -------------------------------------------------- ========================== ========================== ========================== 字段名 类型 说明 ========================== ========================== ========================== trading_day Date 交易日 -------------------------- -------------------------- -------------------------- timestamp_seconds timestamp 时间(秒) -------------------------- -------------------------- -------------------------- user_key text 账户 -------------------------- -------------------------- -------------------------- investor_id text 投资者账号 -------------------------- -------------------------- -------------------------- user_desc text 用户描述 -------------------------- -------------------------- -------------------------- currency text 币种 -------------------------- -------------------------- -------------------------- pre_balance numeric(20, 2) 上日结存 -------------------------- -------------------------- -------------------------- deposit numeric(20, 2) 入金 -------------------------- -------------------------- -------------------------- withdraw numeric(20, 2) 出金 -------------------------- -------------------------- -------------------------- close_profit numeric(20, 2) 平仓盈亏 -------------------------- -------------------------- -------------------------- position_profit numeric(20, 2) 持仓盈亏 -------------------------- -------------------------- -------------------------- float_profit numeric(20, 2) 浮动盈亏 -------------------------- -------------------------- -------------------------- client_equity numeric(20, 2) 客户权益 -------------------------- -------------------------- -------------------------- balance numeric(20, 2) 市值权益 -------------------------- -------------------------- -------------------------- margin numeric(20, 2) 占用保证金 -------------------------- -------------------------- -------------------------- frozen_margin numeric(20, 2) 冻结保证金 -------------------------- -------------------------- -------------------------- commission numeric(20, 2) 手续费 -------------------------- -------------------------- -------------------------- frozen_commission numeric(20, 2) 冻结手续费 -------------------------- -------------------------- -------------------------- premium numeric(20, 2) 权利金 -------------------------- -------------------------- -------------------------- frozen_premium numeric(20, 2) 冻结权利金 -------------------------- -------------------------- -------------------------- available numeric(20, 2) 可用资金 -------------------------- -------------------------- -------------------------- risk_ratio double 风险度 -------------------------- -------------------------- -------------------------- ref_risk_ratio double 参考风险度 -------------------------- -------------------------- -------------------------- option_market_value numeric(20, 2) 期权市值 -------------------------- -------------------------- -------------------------- option_buy_market_value numeric(20, 2) 期权多头市值 -------------------------- -------------------------- -------------------------- option_sell_market_value numeric(20, 2) 期权空头市值 ========================== ========================== ========================== 账户持仓表 PositionSnap -------------------------------------------------- ========================== ========================== ========================== 字段名 类型 说明 ========================== ========================== ========================== trading_day Date 交易日 -------------------------- -------------------------- -------------------------- timestamp_seconds timestamp 时间(秒) -------------------------- -------------------------- -------------------------- user_key text 账户 -------------------------- -------------------------- -------------------------- investor_id text 投资者账号 -------------------------- -------------------------- -------------------------- exchange_id text 交易所代码 -------------------------- -------------------------- -------------------------- instrument_id text 合约代码 -------------------------- -------------------------- -------------------------- product_id text 品种代码 -------------------------- -------------------------- -------------------------- volume_multiple bigint 合约乘数 -------------------------- -------------------------- -------------------------- last_price double 最新价 -------------------------- -------------------------- -------------------------- hedge_type text 投机套保标志 -------------------------- -------------------------- -------------------------- direction text 买卖方向 -------------------------- -------------------------- -------------------------- volume_yesterday bigint 盘前持仓手数 -------------------------- -------------------------- -------------------------- volume_today bigint 今日持仓手数 -------------------------- -------------------------- -------------------------- volume_his bigint 历史持仓手数 -------------------------- -------------------------- -------------------------- volume_comb bigint 组合持仓手数 -------------------------- -------------------------- -------------------------- volume_today_frozen bigint 今日冻结手数 -------------------------- -------------------------- -------------------------- volume_his_frozen bigint 历史冻结手数 -------------------------- -------------------------- -------------------------- open_price numeric(20, 4) 开仓均价 -------------------------- -------------------------- -------------------------- float_profit numeric(20, 2) 浮动盈亏 -------------------------- -------------------------- -------------------------- position_price numeric(20, 4) 持仓均价 -------------------------- -------------------------- -------------------------- position_profit numeric(20, 2) 持仓盈亏 -------------------------- -------------------------- -------------------------- close_profit numeric(20, 2) 当日平仓盈亏 -------------------------- -------------------------- -------------------------- margin numeric(20, 2) 占用保证金 -------------------------- -------------------------- -------------------------- commission numeric(20, 2) 手续费 -------------------------- -------------------------- -------------------------- market_value numeric(20, 2) 持仓市值 -------------------------- -------------------------- -------------------------- premium numeric(20, 2) 权利金 -------------------------- -------------------------- -------------------------- untrade_profit double 不操作盈亏 -------------------------- -------------------------- -------------------------- ins_class text | 合约类型, | 期货:'FUTURE',期权:'OPTION' | 主连:'CONT',指数:'INDEX',仓单:'SPOT' | 股票:'STOCK',债券:'BOND',基金:'FUND' | 组合:'COMBINE',自组合:'CUSCOMBINE' -------------------------- -------------------------- -------------------------- delta_amount numeric(20, 2) $delta -------------------------- -------------------------- -------------------------- gamma_amount numeric(20, 2) 1%$gamma -------------------------- -------------------------- -------------------------- vega_amount numeric(20, 2) $vega -------------------------- -------------------------- -------------------------- theta_amount numeric(20, 2) $theta -------------------------- -------------------------- -------------------------- rho_amount numeric(20, 2) $rho -------------------------- -------------------------- -------------------------- time_value numeric(20, 2) $时间价值 -------------------------- -------------------------- -------------------------- position_delta numeric(20, 2) 持仓delta -------------------------- -------------------------- -------------------------- position_gamma numeric(20, 2) 持仓gamma -------------------------- -------------------------- -------------------------- position_vega numeric(20, 2) 持仓vega -------------------------- -------------------------- -------------------------- position_theta numeric(20, 2) 持仓theta -------------------------- -------------------------- -------------------------- position_rho numeric(20, 2) 持仓rho ========================== ========================== ========================== 合约服务表 InstrumentSnap -------------------------------------------------- ========================== ========================== ========================== 字段名 类型 说明 ========================== ========================== ========================== trading_day Date 交易日 -------------------------- -------------------------- -------------------------- timestamp_seconds timestamp 时间(秒) -------------------------- -------------------------- -------------------------- exchange_id text 交易所代码 -------------------------- -------------------------- -------------------------- instrument_id text 合约代码 -------------------------- -------------------------- -------------------------- product_id text 品种代码 -------------------------- -------------------------- -------------------------- category text 板块代码 -------------------------- -------------------------- -------------------------- category_chinese text 板块名 -------------------------- -------------------------- -------------------------- ins_class text | 合约类型, | 期货:'FUTURE',期权:'OPTION' | 主连:'CONT',指数:'INDEX',仓单:'SPOT' | 股票:'STOCK',债券:'BOND',基金:'FUND' | 组合:'COMBINE',自组合:'CUSCOMBINE' -------------------------- -------------------------- -------------------------- volume_multiple bigint 合约乘数 -------------------------- -------------------------- -------------------------- pre_open_interest bigint 昨持仓量 -------------------------- -------------------------- -------------------------- pre_settlement numeric(20, 2) 昨结算 -------------------------- -------------------------- -------------------------- pre_close numeric(20, 2) 昨收盘 -------------------------- -------------------------- -------------------------- price_tick numeric(20, 2) 最小变动单位 -------------------------- -------------------------- -------------------------- price_decs bigint 合约价格小数位数 -------------------------- -------------------------- -------------------------- underlying_symbol text 标的合约 -------------------------- -------------------------- -------------------------- strike_price numeric(20, 2) 行权价 -------------------------- -------------------------- -------------------------- instrument_name text 合约名 -------------------------- -------------------------- -------------------------- expire_datetime timestamp 到期日(秒) -------------------------- -------------------------- -------------------------- delivery_year bigint 期货交割日年份 -------------------------- -------------------------- -------------------------- delivery_month bigint 期货交割日月份 -------------------------- -------------------------- -------------------------- last_exercise_datetime timestamp 期权最后行权日(秒) -------------------------- -------------------------- -------------------------- exercise_year bigint 期权最后行权日年份 -------------------------- -------------------------- -------------------------- exercise_month bigint 期权最后行权日月份 -------------------------- -------------------------- -------------------------- option_class text 期权方向,看涨:'C',看跌:'P' -------------------------- -------------------------- -------------------------- exercise_type text 期权行权方式,美式:'A',欧式:'E' -------------------------- -------------------------- -------------------------- trading_time text 交易时间段 ========================== ========================== ========================== 板块-品种对应关系 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ================ ====================== ================================================================== 板块名 板块代码 对应品种 ================ ====================== ================================================================== 黑色金属 FERROUS 螺纹钢、热卷、铁矿石、不锈钢、硅铁、锰硅、线材 ---------------- ---------------------- ------------------------------------------------------------------ 有色金属 NONFERROUS_METALS 沪铜、沪锌、沪铝、沪铅、沪镍、沪锡、国际铜、工业硅、氧化铝 ---------------- ---------------------- ------------------------------------------------------------------ 贵金属 PRECIOUS_METALS 沪金、沪银 ---------------- ---------------------- ------------------------------------------------------------------ 煤炭 COAL 焦炭,焦煤,动力煤 ---------------- ---------------------- ------------------------------------------------------------------ 轻工 LIGHT_INDUSTRY 玻璃、纸浆、纤维板、胶合板 ---------------- ---------------------- ------------------------------------------------------------------ 化工 CHEMICAL | TA,PVC,橡胶,20号胶,塑料,短纤,乙二醇,甲醇,聚丙烯,苯乙烯, | 尿素,纯碱,丁橡胶,碳酸锂,对二甲苯,烧碱 ---------------- ---------------------- ------------------------------------------------------------------ 石油 OIL 原油,燃油,低硫油,沥青,液化气 ---------------- ---------------------- ------------------------------------------------------------------ 油脂油料 GREASE 豆一,豆二,豆粕,豆油,菜籽,菜粕,菜油,棕榈油,花生仁 ---------------- ---------------------- ------------------------------------------------------------------ 软商 SOFT_COMMODITY 棉花、棉纱、白糖 ---------------- ---------------------- ------------------------------------------------------------------ 谷物 GRAIN 豆一,豆二,玉米,淀粉,强麦,普麦,粳米,早籼稻,粳稻,晚籼稻 ---------------- ---------------------- ------------------------------------------------------------------ 农副 AGRICULTURAL 鸡蛋,生猪,苹果,红枣 ---------------- ---------------------- ------------------------------------------------------------------ 股指期货 EQUITY_INDEX 沪深,上证,中证500,中证1000 ---------------- ---------------------- ------------------------------------------------------------------ 国债期货 TREASURY_BOND 2年债,5年债,10年债,30年债 ================ ====================== ==================================================================