Repository: timercrack/trader
Branch: master
Commit: 371edcfa1ad1
Files: 81
Total size: 1.6 MB
Directory structure:
gitextract_abenshp1/
├── .gitignore
├── LICENSE.md
├── README.md
├── README.rst
├── __init__.py
├── ctp_native/
│ ├── __init__.py
│ ├── bus.py
│ ├── gateway.py
│ └── state_store.py
├── dashboard/
│ ├── __init__.py
│ ├── settings.py
│ ├── static/
│ │ ├── css/
│ │ │ └── global.css
│ │ └── js/
│ │ ├── bar.js
│ │ ├── corr.js
│ │ ├── global.js
│ │ ├── nav.js
│ │ └── status.js
│ ├── templates/
│ │ ├── global/
│ │ │ ├── base_site.html
│ │ │ ├── paginator-mobile.html
│ │ │ ├── paginator.html
│ │ │ └── top_navbar.html
│ │ └── panel/
│ │ ├── correlation.html
│ │ ├── instrument.html
│ │ ├── performance.html
│ │ └── status.html
│ ├── urls.py
│ └── wsgi.py
├── main.py
├── manage.py
├── native/
│ └── ctp_bridge/
│ ├── CMakeLists.txt
│ ├── CMakePresets.json
│ ├── README.md
│ ├── api/
│ │ ├── linux/
│ │ │ ├── DataCollect.h
│ │ │ ├── ThostFtdcMdApi.h
│ │ │ ├── ThostFtdcTraderApi.h
│ │ │ ├── ThostFtdcUserApiDataType.h
│ │ │ ├── ThostFtdcUserApiStruct.h
│ │ │ ├── error.dtd
│ │ │ └── error.xml
│ │ └── win/
│ │ ├── DataCollect.h
│ │ ├── ThostFtdcMdApi.h
│ │ ├── ThostFtdcTraderApi.h
│ │ ├── ThostFtdcUserApiDataType.h
│ │ ├── ThostFtdcUserApiStruct.h
│ │ ├── WinDataCollect.lib
│ │ ├── error.dtd
│ │ ├── error.xml
│ │ ├── thostmduserapi_se.lib
│ │ └── thosttraderapi_se.lib
│ ├── build_win.bat
│ ├── scripts/
│ │ ├── build_native_bridge.ps1
│ │ └── sync_thost_api.ps1
│ └── src/
│ └── py_module.cpp
├── panel/
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── const.py
│ ├── forms.py
│ ├── models.py
│ ├── templatetags/
│ │ ├── __init__.py
│ │ └── custom_tag.py
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── requirements.txt
├── runtime_config.py
├── strategy/
│ ├── __init__.py
│ ├── base_strategy.py
│ ├── brother2.py
│ └── kronos.py
├── utils/
│ ├── ApiStruct.py
│ ├── __init__.py
│ ├── fetch_data.py
│ ├── func_container.py
│ ├── model/
│ │ ├── __init__.py
│ │ ├── kronos.py
│ │ └── module.py
│ ├── my_logger.py
│ ├── read_config.py
│ └── tick.py
└── weixin_notifier.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# ===== Python =====
__pycache__/
*.py[cod]
*$py.class
*.pyd
*.so
*.egg-info/
.Python
.github/
# Virtual environments
.venv/
venv/
env/
ENV/
.python-version
# Packaging / build artifacts
build/
dist/
pip-wheel-metadata/
# Test / type-check / coverage caches
.pytest_cache/
.mypy_cache/
.ruff_cache/
.pyre/
.hypothesis/
.coverage
.coverage.*
htmlcov/
# ===== Django =====
*.log
db.sqlite3
db.sqlite3-journal
media/
staticfiles/
# ===== Local runtime/config/secrets =====
config.ini
config.yaml
examples/
test/
deploy/
brother3.py
doc/
migrations/
# ===== IDE / Editor =====
.idea/
.vscode/
*.swp
*.swo
.cache/
**/.cache/
.clang*
# ===== OS files =====
.DS_Store
Thumbs.db
Desktop.ini
# ===== C/C++ / CMake / Visual Studio artifacts =====
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
compile_commands.json
Makefile
*.dir/
*.vcxproj.user
*.suo
*.user
*.userosscache
*.sln.docstates
*.obj
*.o
*.pdb
*.idb
*.ilk
*.exp
# Project-native build outputs
native/**/build/
native/**/x64/
native/**/Release/
native/**/Debug/
ctp_native/**/build/
# CTP runtime flow/log dirs
native/ctp_bridge/flow/
dashboard/Logs/
# Runtime state / local snapshots
native_state.json
*.pid
================================================
FILE: LICENSE.md
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2016 timercrack
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# trader
`trader` 是一个以 **CTP 原生链路** 为核心的交易项目,包含:
- 原生网关(`native/ctp_bridge` + `ctp_native`)
- 策略执行(`strategy`)
- Django 管理与可视化(`dashboard` + `panel`)
## 架构概览
### 核心模块
- `runtime_config.py`:运行时配置入口(仅读取根目录 `config.yaml`)
- `ctp_native/`:Python 侧网关与本地消息总线
- `native/ctp_bridge/`:pybind11 C++ 扩展,连接 Thost API
- `strategy/`:交易策略与查询/报单流程
- `dashboard/` + `panel/`:Django 后台与页面展示
### 运行链路(简化)
1. 读取 `config.yaml`
2. 初始化 `ctp_bridge_native` 并登录 CTP
3. `ctp_native` 在本地总线上分发请求/回报
4. `strategy` 消费事件并执行策略逻辑
## 快速开始
### 1) 环境准备
- Python 3.14(项目当前使用版本)
- 安装依赖:`requirements.txt`
- Windows 如使用 CTP 原生扩展:需可用 MSVC + CMake
### 2) 配置
编辑项目根目录 `config.yaml`,重点检查 `ctp_native` 章节:
- `gateway = pybind`
- `module = ctp_bridge_native`
- `module_path` 指向本地编译输出目录
- 补齐登录参数(`broker_id`、`investor_id`、`password`、`appid`、`authcode` 等)
企业微信日志推送配置在 `weixin` 章节:
- `CorpID`
- `Secret`
- `Token`、`EncodingAESKey`(保留与 flower 配置结构对齐)
发送策略默认沿用旧 flower 行为:`agentid=0`、`touser=@all`。
配置后,`trader` 会直接推送日志到企业微信,不再依赖单独运行 `flower`。
默认配置键结构(示例值)如下,和当前代码中的默认配置字典保持一致:
```yaml
trade:
command_timeout: 5
ignore_inst: ""
transport: native
ctp_native:
gateway: pybind
module: ctp_bridge_native
client_class: CtpClient
module_path: /path/to/trader/native/ctp_bridge/build
dll_dir: /path/to/trader/native/ctp_bridge/api/win
trade_front: tcp://xxx:xxx
market_front: tcp://xxx:xxx
broker_id: "9999"
investor_id: "123456"
password: passwd
appid: xxx
authcode: xxx
userinfo: xxx
flow_path: /path/to/trader/native/ctp_bridge/flow
request_timeout_ms: 10000
test_instrument: IF99
log:
level: DEBUG
format: "%(asctime)s %(name)s [%(levelname)s] %(message)s"
weixin_level: INFO
weixin_format: "[%(levelname)s] %(message)s"
host:
ip: 1.2.3.4
mac: 02:03:04:5a:6b:7c
ssh_tunnel:
enabled: false
host: 127.0.0.1
port: 22
local_node: localhost
private_key_linux: /root/.ssh/id_ed25519
private_key_win: C:\\Users\\timer\\.ssh\\id_ed25519.ppk
weixin:
Token: ""
EncodingAESKey: ""
CorpID: ""
Secret: ""
```
### 3) 常用命令
- 启动交易主程序:`python main.py`
- Django 检查:`python manage.py check`
- Native 查询烟测:`python test/test_ctp.py`
### 4) 原生扩展构建(可选)
若需要本地编译 `ctp_bridge_native`:
- Windows(MSVC):
```powershell
cd native/ctp_bridge
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Release
```
- Linux:
```bash
cd native/ctp_bridge
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
```
详细说明见:`native/ctp_bridge/README.md`
## 目录说明
- `native/ctp_bridge`:C++ 扩展源码与 CMake
- `ctp_native`:Python 网关封装
- `strategy`:策略实现
- `dashboard`、`panel`、`templates`、`static`:Web 展示与后台
================================================
FILE: README.rst
================================================
trader
======
操盘大哥的交易组件
INSTALL
=======
先装talib的C库,再用pip装依赖。
修改 mysql 配置文件 /etc/my.cnf.d/server.cnf ,增加如下配置:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
重启mysql服务
License
-------
``trader`` is offered under the Apache 2 license.
================================================
FILE: __init__.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# version is a human-readable version number.
# version_info is a four-tuple for programmatic comparison. The first
# three numbers are the components of the version number. The fourth
# is zero for an official release, positive for a development branch,
# or negative for a release candidate or beta (after the base version
# number has been incremented)
version = "0.1"
version_info = (0, 1, 0, 0)
================================================
FILE: ctp_native/__init__.py
================================================
# coding=utf-8
from .bus import LocalRedisLikeClient
from .gateway import NativeGateway, get_gateway
from .state_store import state_store
__all__ = [
'LocalRedisLikeClient',
'NativeGateway',
'get_gateway',
'state_store',
]
================================================
FILE: ctp_native/bus.py
================================================
# coding=utf-8
from __future__ import annotations
import asyncio
import fnmatch
import inspect
import logging
from typing import Any
import orjson
from ctp_native.gateway import NativeGateway, get_gateway
from ctp_native.state_store import state_store
from runtime_config import runtime_config
logger = logging.getLogger('NativeBus')
class LocalPubSub:
def __init__(self, bus: 'LocalEventBus', ignore_subscribe_messages: bool = True):
self._bus = bus
self._ignore_subscribe_messages = ignore_subscribe_messages
self._queue: asyncio.Queue[dict[str, Any]] = asyncio.Queue()
self._patterns: set[str] = set()
self.in_pubsub = False
self._closed = False
async def psubscribe(self, *patterns: str):
for pattern in patterns:
self._patterns.add(pattern)
self._bus.register(pattern, self)
if not self._ignore_subscribe_messages:
await self._queue.put({'type': 'psubscribe', 'pattern': pattern, 'channel': None, 'data': 1})
self.in_pubsub = len(self._patterns) > 0
async def punsubscribe(self, *patterns: str):
targets = set(patterns) if patterns else set(self._patterns)
for pattern in list(targets):
self._bus.unregister(pattern, self)
self._patterns.discard(pattern)
if not self._ignore_subscribe_messages:
await self._queue.put({'type': 'punsubscribe', 'pattern': pattern, 'channel': None, 'data': 0})
self.in_pubsub = len(self._patterns) > 0
await self._queue.put({'type': 'punsubscribe', 'pattern': None, 'channel': None, 'data': 0})
async def unsubscribe(self):
await self.punsubscribe()
async def close(self):
if self._closed:
return
await self.punsubscribe()
self._closed = True
async def _push(self, pattern: str, channel: str, data: Any):
await self._queue.put({'type': 'pmessage', 'pattern': pattern, 'channel': channel, 'data': data})
async def listen(self):
while True:
msg = await self._queue.get()
yield msg
if msg.get('type') == 'punsubscribe' and not self.in_pubsub:
break
class LocalEventBus:
def __init__(self):
self._subs: dict[str, set[LocalPubSub]] = {}
def register(self, pattern: str, sub: LocalPubSub):
self._subs.setdefault(pattern, set()).add(sub)
def unregister(self, pattern: str, sub: LocalPubSub):
subs = self._subs.get(pattern)
if not subs:
return
subs.discard(sub)
if not subs:
self._subs.pop(pattern, None)
async def publish(self, channel: str, payload: Any):
for pattern, subs in list(self._subs.items()):
if not fnmatch.fnmatch(channel, pattern):
continue
for sub in list(subs):
await sub._push(pattern, channel, payload)
class LocalRedisLikeClient:
def __init__(self, loop: asyncio.AbstractEventLoop):
self._loop = loop
self._bus = LocalEventBus()
self._gateway: NativeGateway = get_gateway()
self._request_format = runtime_config.get('MSG_CHANNEL', 'request_format', fallback='MSG:CTP:REQ:{}')
self._trade_response_format = runtime_config.get('MSG_CHANNEL', 'trade_response_format', fallback='MSG:CTP:RSP:TRADE:{}:{}')
self._market_response_format = runtime_config.get('MSG_CHANNEL', 'market_response_format', fallback='MSG:CTP:RSP:MARKET:{}:{}')
self._request_prefix = self._request_format.split('{}')[0]
self._gateway.set_event_callback(self._on_gateway_event_sync)
async def start(self):
await self._gateway.start()
async def stop(self):
await self._gateway.stop()
state_store.dump_snapshot()
def pubsub(self, ignore_subscribe_messages: bool = True):
return LocalPubSub(self._bus, ignore_subscribe_messages=ignore_subscribe_messages)
def get(self, key: str):
return state_store.get(key)
def set(self, key: str, value: Any, ex: int | None = None):
state_store.set(key, value, ex=ex)
def publish(self, channel: str, payload: Any):
if channel.startswith(self._request_prefix):
req_name = channel[len(self._request_prefix):]
self._schedule(self._handle_request(req_name, payload))
return 1
self._schedule(self._bus.publish(channel, payload))
return 1
async def _on_gateway_event(self, topic: str, data: dict[str, Any]):
if topic in {
'OnFrontConnected',
'OnFrontDisconnected',
'OnFrontConnectedMd',
'OnFrontDisconnectedMd',
'OnRspAuthenticate',
'OnRspUserLogin',
'OnRspUserLoginMd',
'OnRspSettlementInfoConfirm',
'OnRspError',
}:
logger.debug('gateway event %s: %s', topic, data)
# 统一兼容历史 channel 风格
if topic.startswith('OnRtnDepthMarketData'):
inst = data.get('InstrumentID', 'UNKNOWN')
channel = self._market_response_format.format('OnRtnDepthMarketData', inst)
else:
order_ref = data.get('OrderRef', data.get('RequestID', 0))
channel = self._trade_response_format.format(topic, order_ref)
await self._bus.publish(channel, orjson.dumps(data))
def _on_gateway_event_sync(self, topic: str, data: dict[str, Any]):
self._schedule(self._on_gateway_event(topic, data))
async def _handle_request(self, req_name: str, payload: Any):
try:
data = orjson.loads(payload) if payload else {}
except Exception:
data = payload
request_id = 0
if isinstance(data, dict):
request_id = int(data.get('RequestID', 0) or 0)
try:
rows = await self._gateway.request(req_name, data)
rows = rows or []
if req_name.startswith('ReqQry'):
rsp_name = 'OnRspQry' + req_name[6:]
await self._publish_rows(self._trade_response_format.format(rsp_name, request_id), rows)
elif req_name in {'SubscribeMarketData', 'UnSubscribeMarketData'}:
rsp_name = 'OnRspSubMarketData' if req_name == 'SubscribeMarketData' else 'OnRspUnSubMarketData'
await self._publish_rows(self._market_response_format.format(rsp_name, 0), rows)
elif req_name == 'ReqOrderAction':
await self._publish_rows(self._trade_response_format.format('OnRspOrderAction', 0), rows)
else:
# ReqOrderInsert 无需同步回包,回报由 OnRtnOrder/OnRtnTrade 异步事件提供
pass
except Exception as e:
logger.warning('native request failed: %s payload=%s err=%s', req_name, data, repr(e), exc_info=True)
err_row = {'ErrorID': -1, 'ErrorMsg': repr(e), 'RequestID': request_id, 'bIsLast': True}
if req_name in {'SubscribeMarketData', 'UnSubscribeMarketData'}:
await self._bus.publish(self._market_response_format.format('OnRspError', request_id), orjson.dumps(err_row))
else:
await self._bus.publish(self._trade_response_format.format('OnRspError', request_id), orjson.dumps(err_row))
async def _publish_rows(self, channel: str, rows: list[dict[str, Any]]):
if not rows:
await self._bus.publish(channel, orjson.dumps({'empty': True, 'bIsLast': True}))
return
for idx, row in enumerate(rows):
if 'bIsLast' not in row:
row['bIsLast'] = idx == len(rows) - 1
await self._bus.publish(channel, orjson.dumps(row))
def _schedule(self, coro):
if inspect.isawaitable(coro):
self._loop.call_soon_threadsafe(asyncio.create_task, coro) # type: ignore[arg-type]
================================================
FILE: ctp_native/gateway.py
================================================
# coding=utf-8
from __future__ import annotations
import logging
import importlib
import sys
import os
import asyncio
from abc import ABC, abstractmethod
from typing import Any, Callable
from runtime_config import runtime_config
logger = logging.getLogger('NativeGateway')
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))).replace('\\', '/')
class NativeGateway(ABC):
@abstractmethod
async def start(self):
raise NotImplementedError()
@abstractmethod
async def stop(self):
raise NotImplementedError()
@abstractmethod
async def request(self, req_name: str, payload: Any) -> list[dict[str, Any]]:
raise NotImplementedError()
@abstractmethod
def set_event_callback(self, cb: Callable[[str, dict[str, Any]], Any]):
raise NotImplementedError()
class PlaceholderGateway(NativeGateway):
def __init__(self):
self._cb = None
async def start(self):
logger.warning('当前使用 PlaceholderGateway,请接入 pybind11 Thost 原生扩展。')
async def stop(self):
return None
async def request(self, req_name: str, payload: Any) -> list[dict[str, Any]]:
request_id = 0
if isinstance(payload, dict):
request_id = int(payload.get('RequestID', 0) or 0)
return [{
'ErrorID': -1,
'ErrorMsg': f'Native gateway is not implemented for {req_name}',
'RequestID': request_id,
'bIsLast': True,
'empty': True,
}]
def set_event_callback(self, cb: Callable[[str, dict[str, Any]], Any]):
self._cb = cb
class PybindGateway(NativeGateway):
def __init__(self):
self._cb = None
self._client = None
self._fallback_reason = None
self._request_timeout_ms = 10000
async def start(self):
try:
def _resolve(path: str) -> str:
"""将相对路径解析为相对于项目根目录的绝对路径"""
if path and not os.path.isabs(path):
return os.path.normpath(os.path.join(REPO_ROOT, path))
return path
dll_dir = _resolve(runtime_config.get('CTP_NATIVE', 'dll_dir', fallback=f'{REPO_ROOT}/native/ctp_bridge/api/win').strip())
if os.name == 'nt' and dll_dir and os.path.isdir(dll_dir):
os.add_dll_directory(dll_dir)
module_path = _resolve(runtime_config.get('CTP_NATIVE', 'module_path', fallback=f'{REPO_ROOT}/native/ctp_bridge/build').strip())
if module_path and module_path not in sys.path:
sys.path.insert(0, module_path)
module_name = runtime_config.get('CTP_NATIVE', 'module', fallback='ctp_bridge_native')
class_name = runtime_config.get('CTP_NATIVE', 'client_class', fallback='CtpClient')
module = importlib.import_module(module_name)
client_cls = getattr(module, class_name)
self._client = client_cls()
login_cfg = {
'trade_front': runtime_config.get('CTP_NATIVE', 'trade_front', fallback='').strip(),
'market_front': runtime_config.get('CTP_NATIVE', 'market_front', fallback='').strip(),
'broker_id': runtime_config.get('CTP_NATIVE', 'broker_id', fallback='').strip(),
'investor_id': runtime_config.get('CTP_NATIVE', 'investor_id', fallback='').strip(),
'password': runtime_config.get('CTP_NATIVE', 'password', fallback='').strip(),
'appid': runtime_config.get('CTP_NATIVE', 'appid', fallback='').strip(),
'authcode': runtime_config.get('CTP_NATIVE', 'authcode', fallback='').strip(),
'userinfo': runtime_config.get('CTP_NATIVE', 'userinfo', fallback='').strip(),
}
missing = [k for k, v in login_cfg.items() if not v]
if missing:
raise RuntimeError(f'CTP_NATIVE required config missing: {", ".join(missing)}')
if hasattr(self._client, 'configure'):
self._request_timeout_ms = runtime_config.getint('CTP_NATIVE', 'request_timeout_ms', fallback=10000)
self._client.configure({
**login_cfg,
'ip': runtime_config.get('CTP_NATIVE', 'ip', fallback='1.2.3.4'),
'mac': runtime_config.get('CTP_NATIVE', 'mac', fallback='02:03:04:5a:6b:7c'),
'flow_path': _resolve(runtime_config.get('CTP_NATIVE', 'flow_path', fallback=f'{REPO_ROOT}/native/ctp_bridge/flow')),
'request_timeout_ms': self._request_timeout_ms,
})
if self._cb and hasattr(self._client, 'set_event_callback'):
self._client.set_event_callback(self._cb)
if hasattr(self._client, 'start'):
self._client.start()
self._fallback_reason = None
except Exception as e:
self._client = None
self._fallback_reason = repr(e)
logger.warning('Pybind gateway unavailable, fallback to placeholder mode: %s', self._fallback_reason)
async def stop(self):
if self._client and hasattr(self._client, 'stop'):
loop = asyncio.get_running_loop()
await loop.run_in_executor(None, self._client.stop)
async def request(self, req_name: str, payload: Any) -> list[dict[str, Any]]:
if not self._client:
request_id = 0
if isinstance(payload, dict):
request_id = int(payload.get('RequestID', 0) or 0)
return [{
'ErrorID': -1,
'ErrorMsg': f'Pybind gateway unavailable: {self._fallback_reason}',
'RequestID': request_id,
'bIsLast': True,
'empty': True,
}]
if not hasattr(self._client, 'request'):
raise RuntimeError('pybind client missing request(req_name, payload) method')
loop = asyncio.get_running_loop()
timeout_s = max(float(self._request_timeout_ms) / 1000.0 + 2.0, 3.0)
try:
result = await asyncio.wait_for(
loop.run_in_executor(None, self._client.request, req_name, payload),
timeout=timeout_s,
)
except asyncio.TimeoutError as exc:
raise TimeoutError(f'Pybind request timeout after {timeout_s:.1f}s: {req_name}') from exc
if result is None:
return []
if isinstance(result, dict):
return [result]
return list(result)
def set_event_callback(self, cb: Callable[[str, dict[str, Any]], Any]):
self._cb = cb
if self._client and hasattr(self._client, 'set_event_callback'):
self._client.set_event_callback(cb)
def get_gateway() -> NativeGateway:
gateway_name = runtime_config.get('CTP_NATIVE', 'gateway', fallback='placeholder').lower().strip()
if gateway_name == 'pybind':
return PybindGateway()
if gateway_name == 'placeholder':
return PlaceholderGateway()
logger.warning('未知 native gateway=%s,自动回退 placeholder', gateway_name)
return PlaceholderGateway()
================================================
FILE: ctp_native/state_store.py
================================================
# coding=utf-8
import os
import threading
import time
from typing import Any
from appdirs import AppDirs
import orjson
class NativeStateStore:
def __init__(self):
self._lock = threading.RLock()
self._kv: dict[str, Any] = {}
self._expire_at: dict[str, float] = {}
dirs = AppDirs('trader')
self._cache_dir = dirs.user_cache_dir
self._snapshot_file = os.path.join(self._cache_dir, 'native_state.json')
self._load_snapshot()
def _load_snapshot(self):
if not os.path.exists(self._snapshot_file):
return
try:
with open(self._snapshot_file, 'rt', encoding='utf-8') as f:
data = orjson.loads(f.read())
if isinstance(data, dict):
self._kv.update(data.get('kv', {}))
expire_at = data.get('expire_at', {})
if isinstance(expire_at, dict):
self._expire_at.update({str(k): float(v) for k, v in expire_at.items()})
except Exception:
# 快照损坏不应阻塞主流程
pass
def dump_snapshot(self):
try:
if not os.path.exists(self._cache_dir):
os.makedirs(self._cache_dir)
payload = {
'kv': self._kv,
'expire_at': self._expire_at,
}
with open(self._snapshot_file, 'wb') as f:
f.write(orjson.dumps(payload))
except Exception:
# 快照失败不影响交易流程
pass
def _is_expired(self, key: str) -> bool:
expire_at = self._expire_at.get(key)
if expire_at is None:
return False
if expire_at <= time.time():
self._kv.pop(key, None)
self._expire_at.pop(key, None)
return True
return False
def get(self, key: str, default: Any = None):
with self._lock:
if self._is_expired(key):
return default
return self._kv.get(key, default)
def set(self, key: str, value: Any, ex: int | None = None):
with self._lock:
self._kv[key] = value
if ex is not None:
self._expire_at[key] = time.time() + ex
else:
self._expire_at.pop(key, None)
def delete(self, key: str):
with self._lock:
self._kv.pop(key, None)
self._expire_at.pop(key, None)
state_store = NativeStateStore()
================================================
FILE: dashboard/__init__.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
================================================
FILE: dashboard/settings.py
================================================
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
import sys
import atexit
import logging
from appdirs import AppDirs
from pathlib import Path
import platform
import yaml
LOCAL_PORT = 3306
logger = logging.getLogger('dashboard.settings')
ssh_tunnel = None
BASE_DIR = Path(__file__).resolve().parent.parent
def _load_root_config_yaml():
config_path = BASE_DIR / 'config.yaml'
if not config_path.exists():
return {}
with open(config_path, 'rt', encoding='utf-8') as f:
data = yaml.safe_load(f) or {}
return data if isinstance(data, dict) else {}
ROOT_CONFIG = _load_root_config_yaml()
def _start_ssh_tunnel_if_needed():
global ssh_tunnel, LOCAL_PORT
tunnel_cfg = ROOT_CONFIG.get('ssh_tunnel', {}) if isinstance(ROOT_CONFIG.get('ssh_tunnel', {}), dict) else {}
local_node = str(tunnel_cfg.get('local_node', '')).strip()
if local_node and platform.node() == local_node:
return
try:
enabled = bool(tunnel_cfg.get('enabled', True))
if not enabled:
logger.info('SSH tunnel disabled by config.yaml ssh_tunnel.enabled=false')
return
from sshtunnel import SSHTunnelForwarder
ssh_host = str(tunnel_cfg.get('host', '')).strip()
ssh_port = int(tunnel_cfg.get('port', 22) or 22)
ssh_username = 'root'
if sys.platform == 'win32':
ssh_key = str(tunnel_cfg.get('private_key_win', '')).strip()
else:
ssh_key = str(tunnel_cfg.get('private_key_linux', '')).strip()
if not ssh_host or not ssh_key:
logger.warning('SSH tunnel config missing required fields(host/private_key_[linux|win]), fallback to local mysql 3306')
LOCAL_PORT = 3306
return
ssh_tunnel = SSHTunnelForwarder(
(ssh_host, ssh_port),
ssh_private_key=ssh_key,
ssh_username=ssh_username,
remote_bind_address=('127.0.0.1', 3306),
)
ssh_tunnel.start()
LOCAL_PORT = ssh_tunnel.local_bind_port
def _cleanup_tunnel():
try:
if ssh_tunnel:
ssh_tunnel.stop()
except Exception:
pass
atexit.register(_cleanup_tunnel)
except Exception as e:
logger.warning('SSH tunnel start failed, fallback to local mysql 3306: %s', repr(e))
LOCAL_PORT = 3306
_start_ssh_tunnel_if_needed()
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-m@zyyr4j=$8t4n^cj7!y4$yep&6-&kor6+zn8bk)ygfq*l2kk('
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'panel.apps.PanelConfig'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'dashboard.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'dashboard.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'quantdb',
'HOST': '127.0.0.1',
'USER': 'quant',
'PASSWORD': '123456',
'PORT': LOCAL_PORT
},
}
app_dir = AppDirs('dashboard')
LOGGING = {
'version': 1,
'formatters': {'my_formatter': {'format': '%(asctime)s %(name)s [%(levelname)s] %(message)s'}},
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(app_dir.user_log_dir, 'dashboard.log'),
'maxBytes': 1024 * 1024 * 5, # 5 MB
'backupCount': 5,
'formatter': 'my_formatter',
},
'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'my_formatter'},
},
'loggers': {
'panel': {'handlers': ['file', 'console'], 'level': 'DEBUG'},
'dashboard.settings': {'handlers': ['file', 'console'], 'level': 'DEBUG'},
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "trader-dashboard-local-cache",
"TIMEOUT": 3600 * 24, # one day
}
}
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
LOGIN_URL = '/admin/'
LOGIN_REDIRECT_URL = '/'
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
if sys.platform == 'linux':
DEBUG = True
ALLOWED_HOSTS = ['*']
================================================
FILE: dashboard/static/css/global.css
================================================
body {
font-family: -apple-system, "Helvetica Neue", "Arial", "PingFang SC", "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "Microsoft JhengHei", "Source Han Sans SC", "Noto Sans CJK SC", "Source Han Sans CN", "Noto Sans SC", "Source Han Sans TC", "Noto Sans CJK TC", "WenQuanYi Micro Hei", SimSun, sans-serif;
}
.panel-heading-sm{
height: 28px;
padding: 4px 10px;
}
.panel-body-sm{
padding: 5px 10px;
}
table.table-heading-sm thead tr th, table.table-heading-sm tbody tr td{
font-size: 12px;
height: 28px;
padding: 4px 10px;
}
.table-body-sm{
padding: 5px 10px;
}
.capitalize {
text-transform: capitalize;
}
.navbar-default {
background-color: #2da8e4;
border-color: #108ec9;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffffff;
}
.navbar-default .navbar-text {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffffff;
}
.navbar-default .navbar-nav > li > .dropdown-menu {
background-color: #2da8e4;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: #108ec9;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
background-color: #108ec9;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #108ec9;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #108ec9;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #ffffff;
background-color: #108ec9;
}
.navbar-default .navbar-toggle {
border-color: #108ec9;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #108ec9;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #ffffff;
}
.navbar-default .navbar-link {
color: #ffffff;
}
.navbar-default .navbar-link:hover {
color: #ffffff;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #108ec9;
}
}
================================================
FILE: dashboard/static/js/bar.js
================================================
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById("main"));
option = {
backgroundColor: "#000000",
color: [
"#ff0",
"#0f0",
"#61a0a8",
"#d48265",
"#91c7ae",
"#749f83",
"#ca8622",
"#bda29a",
"#6e7074",
"#546570",
"#c4ccd3",
],
title: {
text: "交易信号",
left: 0,
textStyle: {
color: "#ffdf00",
},
},
animation: false,
grid: {
left: "4%",
right: "3%",
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "line",
},
},
legend: {
data: [
"日K",
{
name: "UP_LINE",
},
{
name: "DOWN_LINE",
},
],
selectedMode: false,
textStyle: {
color: "#fff",
},
},
xAxis: {
type: "category",
data: [],
axisLine: {
lineStyle: {
color: "#9c0000",
},
},
boundaryGap: false,
},
yAxis: {
type: "value",
splitNumber: 3,
splitLine: {
lineStyle: {
color: "#9c0000",
},
},
axisLine: {
lineStyle: {
color: "#9c0000",
},
},
scale: true,
min: "dataMin",
max: "dataMax",
},
dataZoom: [
{
show: true,
type: "slider",
backgroundColor: "#000",
fillerColor: "#212421",
borderColor: "#525152",
handleIcon:
"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
handleSize: "70%",
textStyle: {
color: "#94aede",
},
throttle: 0,
start: 80,
end: 100,
},
],
series: [
{
name: "日K",
type: "candlestick",
data: [],
itemStyle: {
normal: {
color: "#000000",
color0: "#6be7ff",
borderColor: "#ff4142",
borderColor0: "#6be7ff",
},
},
markLine: {
symbol: ["none", "none"],
label: {
normal: { show: false },
emphasis: { show: false },
},
lineStyle: {
normal: {
width: 3,
type: "solid",
color: "#fff",
},
},
animation: false,
data: [],
},
},
{
name: "UP_LINE",
type: "line",
lineStyle: { normal: { width: 1, color: "#ff0" } },
showSymbol: false,
data: [],
},
{
name: "DOWN_LINE",
type: "line",
lineStyle: { normal: { width: 1, color: "#0f0" } },
showSymbol: false,
data: [],
},
],
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
$.get(
"/bar_data?strategy=" +
getUrlParameter("strategy") +
"&inst_id=" +
getUrlParameter("inst_id"),
function (rst) {
myChart.setOption({
title: {
text: rst.title,
},
xAxis: {
data: rst.x,
},
series: [
{
name: "日K",
data: rst.k,
markLine: {
data: rst.trade,
},
},
{
name: "UP_LINE",
data: rst.up,
},
{
name: "DOWN_LINE",
data: rst.down,
},
],
});
},
);
$(window).on("resize", function () {
myChart.resize();
});
================================================
FILE: dashboard/static/js/corr.js
================================================
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById("main"));
option = {
tooltip: {
position: "top",
},
grid: {
top: "8%",
left: "11%",
right: "1%",
bottom: "1%",
},
xAxis: {
type: "category",
position: "top",
axisLabel: {
interval: 0,
rotate: -45,
},
data: [],
},
yAxis: {
type: "category",
axisLabel: { interval: 0 },
inverse: true,
data: [],
},
visualMap: {
type: "piecewise",
min: -1,
max: 1,
calculable: true,
precision: 0.01,
splitNumber: 8,
orient: "vertical",
left: "right",
bottom: "19%",
inRange: {
color: [
"#313695",
"#4575b4",
"#74add1",
"#abd9e9",
"#e0f3f8",
"#ffffbf",
"#fee090",
"#fdae61",
"#f46d43",
"#d73027",
"#a50026",
],
},
},
series: [
{
name: "相关性系数",
type: "heatmap",
data: [],
},
{
name: "投资组合评分",
title: { offsetCenter: [0, "20%"] },
type: "gauge",
axisLine: {
lineStyle: {
color: [
[0.2, "#be201f"],
[0.4, "#f99a27"],
[0.6, "#fade00"],
[0.8, "#8bc536"],
[1, "#009f47"],
],
},
},
splitLine: { show: false },
min: 0,
max: 100,
center: ["75%", "31%"],
radius: "45%",
data: [],
},
],
};
// 使用刚指定的配置项和数据显示图表。
myChart.showLoading();
myChart.setOption(option);
function load_chart() {
myChart.showLoading();
var $checked = $("input[type=checkbox]:checked");
if ($checked.length == 0) {
return;
}
var ids = [];
$checked.each(function () {
ids.push($(this).val());
});
$.get(
"/corr_data?strategy=" +
getUrlParameter("strategy") +
"&year=" +
getUrlParameter("year") +
"&insts=" +
JSON.stringify(ids),
function (rst) {
myChart.hideLoading();
myChart.setOption({
xAxis: {
data: rst.index,
},
yAxis: {
data: rst.index,
},
series: [
{
name: "相关性系数",
data: rst.data,
},
{
name: "投资组合评分",
data: [{ value: rst.score, name: "投资组合评分" }],
},
],
});
},
);
}
$(window).on("resize", function () {
myChart.resize();
});
$(function () {
$(".button-checkbox").each(function () {
// Settings
var $widget = $(this),
$button = $widget.find("button"),
$checkbox = $widget.find("input:checkbox"),
color = $button.data("color"),
settings = {
on: {
icon: "glyphicon glyphicon-check",
},
off: {
icon: "glyphicon glyphicon-unchecked",
},
};
// Event Handlers
$button.on("click", function () {
$checkbox.prop("checked", !$checkbox.is(":checked"));
var checks = $(
"#div" + $(this).data("sec") + " > span > input:checked",
).length;
$("#" + $(this).data("sec") + " > b").text(checks);
load_chart();
$checkbox.triggerHandler("change");
updateDisplay();
});
$checkbox.on("change", function () {
updateDisplay();
});
// Actions
function updateDisplay() {
var isChecked = $checkbox.is(":checked");
// Set the button's state
$button.data("state", isChecked ? "on" : "off");
// Set the button's icon
$button
.find(".state-icon")
.removeClass()
.addClass("state-icon " + settings[$button.data("state")].icon);
// Update the button's color
if (isChecked) {
$button.removeClass("btn-default").addClass("btn-" + color + " active");
} else {
$button.removeClass("btn-" + color + " active").addClass("btn-default");
}
}
// Initialization
function init() {
updateDisplay();
// Inject the icon if applicable
if ($button.find(".state-icon").length == 0) {
$button.prepend(
' ',
);
}
}
init();
});
load_chart();
});
================================================
FILE: dashboard/static/js/global.js
================================================
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
================================================
FILE: dashboard/static/js/nav.js
================================================
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById("main"));
// 指定图表的配置项和数据
var option = {
title: {
text: "操盘大哥v2.0",
},
tooltip: {
trigger: "axis",
},
toolbox: {
feature: {
saveAsImage: {},
},
},
legend: {
data: ["单位净值"],
},
xAxis: {
type: "time",
splitLine: {
show: false,
},
},
yAxis: {
type: "value",
splitLine: {
show: false,
},
scale: true,
boundaryGap: ["10%", "10%"],
},
// dataZoom: [
// { // 这个dataZoom组件,默认控制x轴。
// type: 'slider', // 这个 dataZoom 组件是 slider 型 dataZoom 组件
// start: 50, // 左边在 10% 的位置。
// end: 100 // 右边在 60% 的位置。
// }
// ],
series: [
{
name: "单位净值",
type: "line",
data: [],
},
],
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
$.get("/nav_data?strategy=" + getUrlParameter("strategy"), function (rst) {
myChart.setOption({
series: [
{
name: "单位净值",
data: rst,
},
],
});
});
$(window).on("resize", function () {
myChart.resize();
});
================================================
FILE: dashboard/static/js/status.js
================================================
// 基于准备好的dom,初始化echarts实例
var secChart = echarts.init(document.getElementById("section"));
var posChart = echarts.init(document.getElementById("position"));
secChart.setOption({
title: {
text: "持仓合约分类",
},
tooltip: {
trigger: "axis",
},
legend: {
x: "center",
data: ["持仓"],
},
radar: [
{
indicator: [],
},
],
series: [
{
type: "radar",
tooltip: {
trigger: "item",
},
itemStyle: { normal: { areaStyle: { type: "default" } } },
data: [
{
value: [],
name: "持仓",
},
],
},
],
color: ["#2e78b9"],
});
posChart.setOption({
title: {
text: "持仓方向对比",
x: "center",
},
color: [
"#ab4340",
"#3a773a",
"#61a0a8",
"#d48265",
"#91c7ae",
"#749f83",
"#ca8622",
"#bda29a",
"#6e7074",
"#546570",
"#c4ccd3",
],
tooltip: {
trigger: "item",
formatter: "{a} {b} : {c} ({d}%)",
},
legend: {
orient: "vertical",
left: "left",
data: ["多头持仓", "空头持仓"],
},
series: [
{
name: "持仓",
type: "pie",
data: [],
label: {
normal: {
show: true,
position: "inside",
formatter: "{c}",
},
},
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
],
});
$.get("/status_data?strategy=" + getUrlParameter("strategy"), function (rst) {
var maxVal = Math.max.apply(null, rst.section) || 10;
secChart.setOption({
radar: [
{
indicator: rst.section_labels.map(function (label) {
return { text: label, max: maxVal };
}),
},
],
series: [
{
data: [
{
value: rst.section,
name: "持仓",
},
],
},
],
});
posChart.setOption({
series: [
{
name: "持仓",
data: [
{ value: rst.long, name: "多头持仓" },
{ value: rst.short, name: "空头持仓" },
],
},
],
});
});
$(window).on("resize", function () {
secChart.resize();
});
================================================
FILE: dashboard/templates/global/base_site.html
================================================
{% load static %}
和弦基金
{% block extracss %}{% endblock %}
{% include 'global/top_navbar.html' %}
{% block content %}{% endblock %}
{% block extrajs %}{% endblock %}
================================================
FILE: dashboard/templates/global/paginator-mobile.html
================================================
{% load custom_tag %}
{% if paginator %}
{% if page_obj.has_previous %}
上一页
{% endif %}
{% if page_obj.has_next %}
下一页
{% endif %}
{% endif %}
================================================
FILE: dashboard/templates/global/paginator.html
================================================
{% load custom_tag %}
{% if paginator %}
共 {{ paginator.count }} 条
每页条数
5
10
20
50
{% endif %}
================================================
FILE: dashboard/templates/global/top_navbar.html
================================================
{% load custom_tag %}
{{ cur_stra.name }}
{% url 'panel:status_view' as stat_url %}
{% url 'panel:performance_view' as perf_url %}
{% url 'panel:instrument_view' as inst_url %}
{% url 'panel:correlation_view' as corr_url %}
状态监控
绩效分析
合约分析
组合分析
后台管理
================================================
FILE: dashboard/templates/panel/correlation.html
================================================
{% extends 'global/base_site.html' %}
{% load static %}
{% block extrajs %}
{{ block.super }}
{% endblock %}
{% block content %}
{% for section, insts in inst_list %}
{% endfor %}
{% endblock %}
================================================
FILE: dashboard/templates/panel/instrument.html
================================================
{% extends 'global/base_site.html' %}
{% load static %}
{% block extrajs %}
{{ block.super }}
{% endblock %}
{% block content %}
{% for exchange, insts in inst_list.items %}
{% endfor %}
{% endblock %}
================================================
FILE: dashboard/templates/panel/performance.html
================================================
{% extends 'global/base_site.html' %}
{% load static %}
{% block extrajs %}
{{ block.super }}
{% endblock %}
{% block content %}
{% endblock %}
================================================
FILE: dashboard/templates/panel/status.html
================================================
{% extends 'global/base_site.html' %}
{% load static %}
{% load custom_tag %}
{% block extrajs %}
{{ block.super }}
{% endblock %}
{% block content %}
合约
代码
夜盘
方向
数量
持仓均价
开仓日期
持仓盈亏
{% for sig in open_list %}
{{ sig.instrument }} (开仓)
{{ sig.code }}
{% if sig.instrument.night_trade == 1 %}有{% endif %}
{{ sig.get_type_display }}
{{ sig.volume }}
{{ sig.price|number }}
{{ sig.trigger_time.date }}
-
{% endfor %}
{% for pos in pos_list %}
{{ pos.instrument }}{% if pos.code in close_list %} (平仓) {% elif pos.code in roll_list %} (换月) {% endif %}
{{ pos.code }}
{% if pos.instrument.night_trade == 1 %}有{% endif %}
{{ pos.direction }}
{{ pos.shares }}
{{ pos.avg_entry_price|number }}
{{ pos.open_time.date }}
{% if pos.profit == None %}0{% else %}{{ pos.profit|number }}{% endif %}
{% endfor %}
{% endblock %}
================================================
FILE: dashboard/urls.py
================================================
"""dashboard URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.urls import include, re_path
from django.contrib import admin
from django.views.generic import RedirectView
admin.site.site_header = '操盘大哥v2.0-商品期货版'
urlpatterns = [
re_path(r'^admin/', admin.site.urls),
re_path(r'^', include('panel.urls', namespace='panel')),
re_path(r'^$', RedirectView.as_view(url='/status?strategy=1'), name='go-to-status'),
]
================================================
FILE: dashboard/wsgi.py
================================================
"""
WSGI config for dashboard project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard.settings")
application = get_wsgi_application()
================================================
FILE: main.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import sys
import os
import re
import importlib
import pathlib
import django
ROOT = os.path.dirname(os.path.abspath(__file__))
if ROOT not in sys.path:
sys.path.insert(0, ROOT)
os.environ["DJANGO_SETTINGS_MODULE"] = "dashboard.settings"
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
django.setup()
import logging
from logging import handlers
_strategy_dir = pathlib.Path(ROOT) / 'strategy'
_brother_re = re.compile(r'^brother(\d+)\.py$')
_candidates: list[tuple[int, str]] = []
for f in _strategy_dir.iterdir():
m = _brother_re.match(f.name)
if m:
_candidates.append((int(m.group(1)), f.stem))
_candidates.sort(reverse=True)
TradeStrategy = None
_strategy_name = None
for _ver, _mod_name in _candidates:
try:
_mod = importlib.import_module(f'strategy.{_mod_name}')
TradeStrategy = _mod.TradeStrategy
_strategy_name = getattr(TradeStrategy, '__doc__', '')
if '—' in _strategy_name:
_strategy_name = _strategy_name.split('—')[0].strip()
elif '-' in _strategy_name:
_strategy_name = _strategy_name.split('-')[0].strip()
break
except ImportError:
continue
if TradeStrategy is None:
raise RuntimeError('未找到任何 strategy/brotherXXX.py 策略文件')
from utils.read_config import config_file, app_dir, config
from weixin_notifier import install_weixin_log_handler
if __name__ == '__main__':
if not os.path.exists(app_dir.user_log_dir):
os.makedirs(app_dir.user_log_dir)
log_file = os.path.join(app_dir.user_log_dir, 'trader.log')
file_handler = handlers.RotatingFileHandler(log_file, encoding='utf-8', maxBytes=1024*1024, backupCount=1)
general_formatter = logging.Formatter(config.get('LOG', 'format'))
file_handler.setFormatter(general_formatter)
file_handler.setLevel(config.get('LOG', 'file_level', fallback='DEBUG'))
console_handler = logging.StreamHandler()
console_handler.setFormatter(general_formatter)
console_handler.setLevel('DEBUG')
logger = logging.getLogger()
logger.setLevel('DEBUG')
logger.addHandler(file_handler)
logger.addHandler(console_handler)
install_weixin_log_handler(logger)
logger = logging.getLogger("main")
pid_path = os.path.join(app_dir.user_cache_dir, 'trader.pid')
if not os.path.exists(pid_path):
if not os.path.exists(app_dir.user_cache_dir):
os.makedirs(app_dir.user_cache_dir)
with open(pid_path, 'w') as pid_file:
pid_file.write(str(os.getpid()))
print('Big Brother is watching you!')
print('used config file:', config_file)
print('log stored in:', app_dir.user_log_dir)
print('pid file:', pid_path)
print('strategy:', _strategy_name)
TradeStrategy(name=_strategy_name).run()
================================================
FILE: manage.py
================================================
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
================================================
FILE: native/ctp_bridge/CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.31)
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
project(ctp_bridge_native VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Export compile_commands.json" FORCE)
option(CTP_STRICT_LINK "Fail configure when Thost native libs are missing" OFF)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
execute_process(
COMMAND "${Python3_EXECUTABLE}" -m pybind11 --cmakedir
OUTPUT_VARIABLE _pybind11_cmake_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY
)
set(pybind11_DIR "${_pybind11_cmake_dir}" CACHE PATH "pybind11 CMake config dir")
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(ctp_bridge_native src/py_module.cpp)
target_compile_features(ctp_bridge_native PRIVATE cxx_std_23)
set_target_properties(ctp_bridge_native PROPERTIES
CXX_EXTENSIONS OFF
)
if(MSVC)
target_compile_options(ctp_bridge_native PRIVATE /std:c++latest /utf-8 /bigobj /EHsc)
endif()
if(WIN32)
set(THOST_API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/win")
elseif(UNIX)
set(THOST_API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/linux")
else()
message(FATAL_ERROR "Unsupported platform for Thost API")
endif()
target_include_directories(ctp_bridge_native PRIVATE
"$"
)
if(WIN32)
set(THOST_TRADER_LIB "${THOST_API_DIR}/thosttraderapi_se.lib")
set(THOST_MD_LIB "${THOST_API_DIR}/thostmduserapi_se.lib")
if(EXISTS "${THOST_TRADER_LIB}" AND EXISTS "${THOST_MD_LIB}")
target_link_libraries(ctp_bridge_native PRIVATE
"${THOST_TRADER_LIB}"
"${THOST_MD_LIB}"
)
elseif(CTP_STRICT_LINK)
message(FATAL_ERROR "Thost .lib files not found under ${THOST_API_DIR}")
else()
message(WARNING "Thost .lib files not found under ${THOST_API_DIR}, build will use header-only skeleton.")
endif()
endif()
if(UNIX)
set(THOST_TRADER_SO "${THOST_API_DIR}/thosttraderapi_se.so")
set(THOST_MD_SO "${THOST_API_DIR}/thostmduserapi_se.so")
if(EXISTS "${THOST_TRADER_SO}" AND EXISTS "${THOST_MD_SO}")
# 使用 -l:filename 兼容非 lib*.so 命名,并通过 target_link_libraries 保证库顺序正确
target_link_directories(ctp_bridge_native PRIVATE "${THOST_API_DIR}")
target_link_libraries(ctp_bridge_native PRIVATE
"-l:thosttraderapi_se.so"
"-l:thostmduserapi_se.so"
)
set_target_properties(ctp_bridge_native PROPERTIES
BUILD_RPATH "${THOST_API_DIR}"
INSTALL_RPATH "$ORIGIN/native/ctp_bridge/api/linux;$ORIGIN"
)
elseif(CTP_STRICT_LINK)
message(FATAL_ERROR "Thost .so files not found under ${THOST_API_DIR}")
else()
message(WARNING "Thost .so files not found under ${THOST_API_DIR}, build will use header-only skeleton.")
endif()
endif()
================================================
FILE: native/ctp_bridge/CMakePresets.json
================================================
{
"version": 3,
"configurePresets": [
{
"name": "win",
"displayName": "Windows (Ninja)",
"description": "Use Ninja + MSVC cl and generate compile_commands.json",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "linux",
"displayName": "Linux (Default Generator)",
"description": "Use system default generator and generate compile_commands.json",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
}
],
"buildPresets": [
{
"name": "win",
"configurePreset": "win"
},
{
"name": "linux",
"configurePreset": "linux"
}
]
}
================================================
FILE: native/ctp_bridge/README.md
================================================
# ctp_bridge_native(简化说明)
`ctp_bridge_native` 是 `trader` 的本地 C++ 扩展,用于通过 pybind11 直连 CTP Thost API。
## 目录结构
- `CMakeLists.txt`:构建入口
- `src/py_module.cpp`:`CtpClient` 导出与回调桥接
- `api/win`、`api/linux`:Thost 头文件与库
## 构建
在 `native/ctp_bridge` 目录下执行 CMake 构建。
当前构建设置:
- C++ 标准:`C++23`
- Windows + MSVC:启用 `/std:c++latest` 与 `/utf-8`
### Windows(MSVC)最小命令
```powershell
cd native/ctp_bridge
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Release
```
### Linux(GCC/Clang)最小命令
```bash
cd native/ctp_bridge
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
```
### 动态库准备(按平台,必须)
除了头文件,还需要把 CTP 动态库放到对应平台目录:
- Linux:`native/ctp_bridge/api/linux/`
- `thosttraderapi_se.so`
- `thostmduserapi_se.so`
- `DataCollect.so` 或 `LinuxDataCollect.so`
- Windows:`native/ctp_bridge/api/win/`
- 对应的 Trader/Md/DataCollect 运行库(通常为 `.dll`,并与 `.lib` 配套)
> 注意:前两个交易/行情库用于编译与链接 Python 扩展模块;`DataCollect` 库为行情链路运行时自动调用依赖,也必须放在对应目录。
编译成功后,通常模块输出在:
- `native/ctp_bridge/build`
## 配置
在项目根目录 `config.yaml` 的 `ctp_native` 章节确保:
- `gateway = pybind`
- `module = ctp_bridge_native`
- `module_path = <构建输出目录>`(例如 `native/ctp_bridge/build`)
## 快速验证
回到项目根目录执行:
- `python test/test_ctp.py`
Linux 建议先做一次依赖检查(确认模块已正确链接 Thost 动态库):
```bash
ldd ctp_bridge_native.cpython-314-x86_64-linux-gnu.so
```
输出中应能看到:
- `thosttraderapi_se.so => .../native/ctp_bridge/api/linux/thosttraderapi_se.so`
- `thostmduserapi_se.so => .../native/ctp_bridge/api/linux/thostmduserapi_se.so`
按当前配置方案,只需在 `config.yaml` 里设置好 `ctp_native.module_path`,无需把扩展模块复制到项目根目录。
若需要企业微信日志推送,请在 `config.yaml` 的 `weixin` 章节补齐 `CorpID`、`Secret`(以及可选 `AgentID`、`ToUser`)。
当前 `trader` 已内置该推送能力,无需再单独运行 `flower`。
可选环境变量:
- `CTP_TEST_WARMUP_SECONDS`:登录预热秒数
- `CTP_TEST_INSTRUMENT`:优先测试合约(若无效会自动回退)
## 常见问题(Linux)
- `ModuleNotFoundError: No module named 'ctp_bridge_native'`
- 原因:`ctp_native.module_path` 未指向构建目录。
- 处理:检查 `config.yaml` 中 `ctp_native.module_path` 是否正确。
- `ImportError: undefined symbol: CThostFtdc...CreateFtdc...`
- 原因:模块未正确链接/加载 Thost 动态库。
- 处理:确认 `api/linux` 下两个 `thost*.so` 文件存在,重新执行 CMake 构建,并用 `ldd` 验证依赖是否解析成功。
================================================
FILE: native/ctp_bridge/api/linux/DataCollect.h
================================================
#ifndef DATA_COLLECT_H
#define DATA_COLLECT_H
#define DLL_EXPORT __declspec(dllexport)
#if defined(IS_WINCOLLECT_LIB) && defined(WIN32)
#ifdef LIB_DATA_COLLECT_API_EXPORT
#define DATA_COLLECT_API_EXPORT __declspec(dllexport)
#else
#define DATA_COLLECT_API_EXPORT __declspec(dllimport)
#endif
#else
#define DATA_COLLECT_API_EXPORT
#endif
/// 获取AES加密和RSA加密的终端信息 pSystemInfo的空间需要调用者自己分配
/// 至少270个字节
/// windows返回值定义
/* 返回的int值 不为0 表示采集信息有误 具体哪个采集项有问题需要做如下判断
从低位开始分别标示 终端信息 ->系统盘分区信息
返回值 & (0x01 << 0) 不为0 表示终端类型未采集到
返回值 & (0x01 << 1) 不为0 表示 信息采集时间获取异常
返回值 & (0x01 << 2) 不为0 表示ip 获取失败
(采集多个相同类型信息的场景有一个采集到 即表示采集成功) 返回值 & (0x01 << 3)
不为0 表示mac 获取失败 返回值 & (0x01 << 4) 不为0 表示 设备名 获取失败 返回值
& (0x01 << 5) 不为0 表示 操作系统版本 获取失败 返回值 & (0x01 << 6) 不为0
表示 硬盘序列号 获取失败 返回值 & (0x01 << 7) 不为0 表示 CPU序列号 获取失败
返回值 & (0x01 << 8) 不为0 表示 BIOS 获取失败
返回值 & (0x01 << 9) 不为0 表示 系统盘分区信息 获取失败
*/
/// linux返回值定义
/* 返回的int值 不为0 表示采集信息有误 具体哪个采集项有问题需要做如下判断
从低位开始分别标示 终端信息 -> BIOS信息
返回值 & (0x01 << 0) 不为0 表示终端类型未采集到
返回值 & (0x01 << 1) 不为0 表示 信息采集时间获取异常
返回值 & (0x01 << 2) 不为0 表示ip 获取失败
(采集多个相同类型信息的场景有一个采集到 即表示采集成功) 返回值 & (0x01 << 3)
不为0 表示mac 获取失败 返回值 & (0x01 << 4) 不为0 表示 设备名 获取失败 返回值
& (0x01 << 5) 不为0 表示 操作系统版本 获取失败 返回值 & (0x01 << 6) 不为0
表示 硬盘序列号 获取失败 返回值 & (0x01 << 7) 不为0 表示 CPU序列号 获取失败
返回值 & (0x01 << 8) 不为0 表示 BIOS 获取失败
*/
DATA_COLLECT_API_EXPORT int CTP_GetSystemInfo(char *pSystemInfo, int &nLen);
// 版本号格式
// Sfit + 生产还是测试秘钥(pro/tst) + 秘钥版本 + 编译时间 + 版本(内部)
DATA_COLLECT_API_EXPORT const char *CTP_GetDataCollectApiVersion(void);
#endif
================================================
FILE: native/ctp_bridge/api/linux/ThostFtdcMdApi.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcMdApi.h
///@brief 定义了客户端接口
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCMDAPI_H)
#define THOST_FTDCMDAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_MD_API_EXPORT
#define MD_API_EXPORT __declspec(dllexport)
#else
#define MD_API_EXPORT __declspec(dllimport)
#endif
#else
#define MD_API_EXPORT
#endif
class CThostFtdcMdSpi
{
public:
///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
virtual void OnFrontConnected(){};
///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。
///@param nReason 错误原因
/// 0x1001 网络读失败
/// 0x1002 网络写失败
/// 0x2001 接收心跳超时
/// 0x2002 发送心跳失败
/// 0x2003 收到错误报文
virtual void OnFrontDisconnected(int nReason){};
///心跳超时警告。当长时间未收到报文时,该方法被调用。
///@param nTimeLapse 距离上次接收报文的时间
virtual void OnHeartBeatWarning(int nTimeLapse){};
///登录请求响应
virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登出请求响应
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询组播合约响应
virtual void OnRspQryMulticastInstrument(CThostFtdcMulticastInstrumentField *pMulticastInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///错误应答
virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///订阅行情应答
virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///取消订阅行情应答
virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///订阅询价应答
virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///取消订阅询价应答
virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///深度行情通知
virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {};
///询价通知
virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {};
};
class MD_API_EXPORT CThostFtdcMdApi
{
public:
///创建MdApi
///@param pszFlowPath 存贮订阅信息文件的目录,默认为当前目录
///@param bIsProductionMode true:使用生产版本的API false:使用测评版本API
///@return 创建出的UserApi
///modify for udp marketdata
static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false, bool bIsProductionMode=true);
///获取API的版本信息
///@retrun 获取到的版本号
static const char *GetApiVersion();
///删除接口对象本身
///@remark 不再使用本接口对象时,调用该函数删除接口对象
virtual void Release() = 0;
///初始化
///@remark 初始化运行环境,只有调用后,接口才开始工作
virtual void Init() = 0;
///等待接口线程结束运行
///@return 线程退出代码
virtual int Join() = 0;
///获取当前交易日
///@retrun 获取到的交易日
///@remark 只有登录成功后,才能得到正确的交易日
virtual const char *GetTradingDay() = 0;
///注册前置机网络地址
///@param pszFrontAddress:前置机网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”17001”代表服务器端口号。
virtual void RegisterFront(char *pszFrontAddress) = 0;
///注册名字服务器网络地址
///@param pszNsAddress:名字服务器网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:12001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”12001”代表服务器端口号。
///@remark RegisterNameServer优先于RegisterFront
virtual void RegisterNameServer(char *pszNsAddress) = 0;
///注册名字服务器用户信息
///@param pFensUserInfo:用户信息。
virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0;
///注册回调接口
///@param pSpi 派生自回调接口类的实例
virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0;
///订阅行情。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0;
///退订行情。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0;
///订阅询价。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0;
///退订询价。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0;
///用户登录请求
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
///登出请求
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
///请求查询组播合约
virtual int ReqQryMulticastInstrument(CThostFtdcQryMulticastInstrumentField *pQryMulticastInstrument, int nRequestID) = 0;
protected:
~CThostFtdcMdApi(){};
};
#endif
================================================
FILE: native/ctp_bridge/api/linux/ThostFtdcTraderApi.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcTraderApi.h
///@brief 定义了客户端接口
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCTRADERAPI_H)
#define THOST_FTDCTRADERAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_TRADER_API_EXPORT
#define TRADER_API_EXPORT __declspec(dllexport)
#else
#define TRADER_API_EXPORT __declspec(dllimport)
#endif
#else
#define TRADER_API_EXPORT
#endif
class CThostFtdcTraderSpi
{
public:
///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
virtual void OnFrontConnected(){};
///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。
///@param nReason 错误原因
/// 0x1001 网络读失败
/// 0x1002 网络写失败
/// 0x2001 接收心跳超时
/// 0x2002 发送心跳失败
/// 0x2003 收到错误报文
virtual void OnFrontDisconnected(int nReason){};
///心跳超时警告。当长时间未收到报文时,该方法被调用。
///@param nTimeLapse 距离上次接收报文的时间
virtual void OnHeartBeatWarning(int nTimeLapse){};
///客户端认证响应
virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登录请求响应
virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登出请求响应
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///用户口令更新请求响应
virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///资金账户口令更新请求响应
virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询用户当前支持的认证模式的回复
virtual void OnRspUserAuthMethod(CThostFtdcRspUserAuthMethodField *pRspUserAuthMethod, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///获取图形验证码请求的回复
virtual void OnRspGenUserCaptcha(CThostFtdcRspGenUserCaptchaField *pRspGenUserCaptcha, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///获取短信验证码请求的回复
virtual void OnRspGenUserText(CThostFtdcRspGenUserTextField *pRspGenUserText, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单录入请求响应
virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///预埋单录入请求响应
virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///预埋撤单录入请求响应
virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单操作请求响应
virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询最大报单数量响应
virtual void OnRspQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField *pQryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者结算结果确认响应
virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///删除预埋单响应
virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///删除预埋撤单响应
virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///执行宣告录入请求响应
virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///执行宣告操作请求响应
virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///询价录入请求响应
virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报价录入请求响应
virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报价操作请求响应
virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///批量报单操作请求响应
virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期权自对冲录入请求响应
virtual void OnRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期权自对冲操作请求响应
virtual void OnRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///申请组合录入请求响应
virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报单响应
virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询成交响应
virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓响应
virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询资金账户响应
virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者响应
virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易编码响应
virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约保证金率响应
virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约手续费率响应
virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询用户会话响应
virtual void OnRspQryUserSession(CThostFtdcUserSessionField *pUserSession, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所响应
virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品响应
virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约响应
virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询行情响应
virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易员报盘机响应
virtual void OnRspQryTraderOffer(CThostFtdcTraderOfferField *pTraderOffer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者结算结果响应
virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询转帐银行响应
virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓明细响应
virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询客户通知响应
virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询结算信息确认响应
virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓明细响应
virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询保证金监管系统经纪公司资金账户密钥响应
virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询仓单折抵信息响应
virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者品种/跨品种保证金响应
virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所保证金率响应
virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所调整保证金率响应
virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询汇率响应
virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理操作员银期权限响应
virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品报价汇率
virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品组
virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询做市商合约手续费率响应
virtual void OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询做市商期权合约手续费响应
virtual void OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报单手续费响应
virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询资金账户响应
virtual void OnRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理商资金校验模式响应
virtual void OnRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理商信息响应
virtual void OnRspQrySecAgentTradeInfo(CThostFtdcSecAgentTradeInfoField *pSecAgentTradeInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权交易成本响应
virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权合约手续费响应
virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询执行宣告响应
virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询询价响应
virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报价响应
virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权自对冲响应
virtual void OnRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资单元响应
virtual void OnRspQryInvestUnit(CThostFtdcInvestUnitField *pInvestUnit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询组合合约安全系数响应
virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询申请组合响应
virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询转帐流水响应
virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询银期签约关系响应
virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///错误应答
virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单通知
virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {};
///成交通知
virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {};
///报单录入错误回报
virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {};
///报单操作错误回报
virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///合约交易状态通知
virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {};
///交易所公告通知
virtual void OnRtnBulletin(CThostFtdcBulletinField *pBulletin) {};
///交易通知
virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {};
///提示条件单校验错误
virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {};
///执行宣告通知
virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {};
///执行宣告录入错误回报
virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {};
///执行宣告操作错误回报
virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///询价录入错误回报
virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {};
///报价通知
virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {};
///报价录入错误回报
virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {};
///报价操作错误回报
virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {};
///询价通知
virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {};
///保证金监控中心用户令牌
virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {};
///批量报单操作错误回报
virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///期权自对冲通知
virtual void OnRtnOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose) {};
///期权自对冲录入错误回报
virtual void OnErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo) {};
///期权自对冲操作错误回报
virtual void OnErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo) {};
///申请组合通知
virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {};
///申请组合录入错误回报
virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {};
///请求查询签约银行响应
virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询预埋单响应
virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询预埋撤单响应
virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易通知响应
virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询经纪公司交易参数响应
virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询经纪公司交易算法响应
virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询监控中心用户令牌
virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///银行发起银行资金转期货通知
virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {};
///银行发起期货资金转银行通知
virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {};
///银行发起冲正银行转期货通知
virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {};
///银行发起冲正期货转银行通知
virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起银行资金转期货通知
virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
///期货发起期货资金转银行通知
virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
///系统运行时期货端手工发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
///系统运行时期货端手工发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起查询银行余额通知
virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {};
///期货发起银行资金转期货错误回报
virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起期货资金转银行错误回报
virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
///系统运行时期货端手工发起冲正银行转期货错误回报
virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
///系统运行时期货端手工发起冲正期货转银行错误回报
virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起查询银行余额错误回报
virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起银行资金转期货应答
virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期货发起期货资金转银行应答
virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期货发起查询银行余额应答
virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///银行发起银期开户通知
virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {};
///银行发起银期销户通知
virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {};
///银行发起变更银行账号通知
virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {};
///请求查询分类合约响应
virtual void OnRspQryClassifiedInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求组合优惠比例响应
virtual void OnRspQryCombPromotionParam(CThostFtdcCombPromotionParamField *pCombPromotionParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者风险结算持仓查询响应
virtual void OnRspQryRiskSettleInvstPosition(CThostFtdcRiskSettleInvstPositionField *pRiskSettleInvstPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///风险结算产品查询响应
virtual void OnRspQryRiskSettleProductStatus(CThostFtdcRiskSettleProductStatusField *pRiskSettleProductStatus, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM期货合约参数查询响应
virtual void OnRspQrySPBMFutureParameter(CThostFtdcSPBMFutureParameterField *pSPBMFutureParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM期权合约参数查询响应
virtual void OnRspQrySPBMOptionParameter(CThostFtdcSPBMOptionParameterField *pSPBMOptionParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM品种内对锁仓折扣参数查询响应
virtual void OnRspQrySPBMIntraParameter(CThostFtdcSPBMIntraParameterField *pSPBMIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM跨品种抵扣参数查询响应
virtual void OnRspQrySPBMInterParameter(CThostFtdcSPBMInterParameterField *pSPBMInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM组合保证金套餐查询响应
virtual void OnRspQrySPBMPortfDefinition(CThostFtdcSPBMPortfDefinitionField *pSPBMPortfDefinition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者SPBM套餐选择查询响应
virtual void OnRspQrySPBMInvestorPortfDef(CThostFtdcSPBMInvestorPortfDefField *pSPBMInvestorPortfDef, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者新型组合保证金系数查询响应
virtual void OnRspQryInvestorPortfMarginRatio(CThostFtdcInvestorPortfMarginRatioField *pInvestorPortfMarginRatio, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者产品SPBM明细查询响应
virtual void OnRspQryInvestorProdSPBMDetail(CThostFtdcInvestorProdSPBMDetailField *pInvestorProdSPBMDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者商品组SPMM记录查询响应
virtual void OnRspQryInvestorCommoditySPMMMargin(CThostFtdcInvestorCommoditySPMMMarginField *pInvestorCommoditySPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者商品群SPMM记录查询响应
virtual void OnRspQryInvestorCommodityGroupSPMMMargin(CThostFtdcInvestorCommodityGroupSPMMMarginField *pInvestorCommodityGroupSPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPMM合约参数查询响应
virtual void OnRspQrySPMMInstParam(CThostFtdcSPMMInstParamField *pSPMMInstParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPMM产品参数查询响应
virtual void OnRspQrySPMMProductParam(CThostFtdcSPMMProductParamField *pSPMMProductParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM附加跨品种抵扣参数查询响应
virtual void OnRspQrySPBMAddOnInterParameter(CThostFtdcSPBMAddOnInterParameterField *pSPBMAddOnInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS产品组合信息查询响应
virtual void OnRspQryRCAMSCombProductInfo(CThostFtdcRCAMSCombProductInfoField *pRCAMSCombProductInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS同合约风险对冲参数查询响应
virtual void OnRspQryRCAMSInstrParameter(CThostFtdcRCAMSInstrParameterField *pRCAMSInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS品种内风险对冲参数查询响应
virtual void OnRspQryRCAMSIntraParameter(CThostFtdcRCAMSIntraParameterField *pRCAMSIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS跨品种风险折抵参数查询响应
virtual void OnRspQryRCAMSInterParameter(CThostFtdcRCAMSInterParameterField *pRCAMSInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS空头期权风险调整参数查询响应
virtual void OnRspQryRCAMSShortOptAdjustParam(CThostFtdcRCAMSShortOptAdjustParamField *pRCAMSShortOptAdjustParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS策略组合持仓查询响应
virtual void OnRspQryRCAMSInvestorCombPosition(CThostFtdcRCAMSInvestorCombPositionField *pRCAMSInvestorCombPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者品种RCAMS保证金查询响应
virtual void OnRspQryInvestorProdRCAMSMargin(CThostFtdcInvestorProdRCAMSMarginField *pInvestorProdRCAMSMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE合约保证金参数查询响应
virtual void OnRspQryRULEInstrParameter(CThostFtdcRULEInstrParameterField *pRULEInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE品种内对锁仓折扣参数查询响应
virtual void OnRspQryRULEIntraParameter(CThostFtdcRULEIntraParameterField *pRULEIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE跨品种抵扣参数查询响应
virtual void OnRspQryRULEInterParameter(CThostFtdcRULEInterParameterField *pRULEInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者产品RULE保证金查询响应
virtual void OnRspQryInvestorProdRULEMargin(CThostFtdcInvestorProdRULEMarginField *pInvestorProdRULEMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者新型组合保证金开关查询响应
virtual void OnRspQryInvestorPortfSetting(CThostFtdcInvestorPortfSettingField *pInvestorPortfSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者申报费阶梯收取记录查询响应
virtual void OnRspQryInvestorInfoCommRec(CThostFtdcInvestorInfoCommRecField *pInvestorInfoCommRec, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///组合腿信息查询响应
virtual void OnRspQryCombLeg(CThostFtdcCombLegField *pCombLeg, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置请求响应
virtual void OnRspOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置撤销请求响应
virtual void OnRspCancelOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置通知
virtual void OnRtnOffsetSetting(CThostFtdcOffsetSettingField *pOffsetSetting) {};
///对冲设置错误回报
virtual void OnErrRtnOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo) {};
///对冲设置撤销错误回报
virtual void OnErrRtnCancelOffsetSetting(CThostFtdcCancelOffsetSettingField *pCancelOffsetSetting, CThostFtdcRspInfoField *pRspInfo) {};
///投资者对冲设置查询响应
virtual void OnRspQryOffsetSetting(CThostFtdcOffsetSettingField *pOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
};
class TRADER_API_EXPORT CThostFtdcTraderApi
{
public:
///创建TraderApi
///@param pszFlowPath 存贮订阅信息文件的目录,默认为当前目录
///@param bIsProductionMode true:使用生产版本的API false:使用测评版本的API
///@return 创建出的UserApi
static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = "", bool bIsProductionMode = true);
///获取API的版本信息
///@retrun 获取到的版本号
static const char *GetApiVersion();
///删除接口对象本身
///@remark 不再使用本接口对象时,调用该函数删除接口对象
virtual void Release() = 0;
///初始化
///@remark 初始化运行环境,只有调用后,接口才开始工作
virtual void Init() = 0;
///等待接口线程结束运行
///@return 线程退出代码
virtual int Join() = 0;
///获取当前交易日
///@retrun 获取到的交易日
///@remark 只有登录成功后,才能得到正确的交易日
virtual const char *GetTradingDay() = 0;
///获取已连接的前置的信息
/// @param pFrontInfo:输入输出参数,用于存储获取到的前置信息,不能为空
/// @remark 连接成功后,可获取正确的前置地址信息
/// @remark 登录成功后,可获取正确的前置流控信息
virtual void GetFrontInfo(CThostFtdcFrontInfoField* pFrontInfo) =0;
///注册前置机网络地址
///@param pszFrontAddress:前置机网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”17001”代表服务器端口号。
virtual void RegisterFront(char *pszFrontAddress) = 0;
///注册名字服务器网络地址
///@param pszNsAddress:名字服务器网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:12001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”12001”代表服务器端口号。
///@remark RegisterNameServer优先于RegisterFront
virtual void RegisterNameServer(char *pszNsAddress) = 0;
///注册名字服务器用户信息
///@param pFensUserInfo:用户信息。
virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0;
///注册回调接口
///@param pSpi 派生自回调接口类的实例
virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0;
///订阅私有流。
///@param nResumeType 私有流重传方式
/// THOST_TERT_RESTART:从本交易日开始重传
/// THOST_TERT_RESUME:从上次收到的续传
/// THOST_TERT_QUICK:只传送登录后私有流的内容
///@remark 该方法要在Init方法前调用。若不调用则不会收到私有流的数据。
virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
///订阅公共流。
///@param nResumeType 公共流重传方式
/// THOST_TERT_RESTART:从本交易日开始重传
/// THOST_TERT_RESUME:从上次收到的续传
/// THOST_TERT_QUICK:只传送登录后公共流的内容
/// THOST_TERT_NONE:取消订阅公共流
///@remark 该方法要在Init方法前调用。若不调用则不会收到公共流的数据。
virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
///客户端认证请求
virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0;
///注册用户终端信息,用于中继服务器多连接模式
///需要在终端认证成功后,用户登录前调用该接口
virtual int RegisterUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;
///上报用户终端信息,用于中继服务器操作员登录模式
///操作员登录后,可以多次调用该接口上报客户信息
virtual int SubmitUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;
///注册用户终端信息,用于中继服务器多连接模式.用于微信小程序等应用上报信息.
virtual int RegisterWechatUserSystemInfo(CThostFtdcWechatUserSystemInfoField *pUserSystemInfo) = 0;
///上报用户终端信息,用于中继服务器操作员登录模式.用于微信小程序等应用上报信息.
virtual int SubmitWechatUserSystemInfo(CThostFtdcWechatUserSystemInfoField *pUserSystemInfo) = 0;
///用户登录请求
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
///登出请求
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
///用户口令更新请求
virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0;
///资金账户口令更新请求
virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0;
///查询用户当前支持的认证模式
virtual int ReqUserAuthMethod(CThostFtdcReqUserAuthMethodField *pReqUserAuthMethod, int nRequestID) = 0;
///用户发出获取图形验证码请求
virtual int ReqGenUserCaptcha(CThostFtdcReqGenUserCaptchaField *pReqGenUserCaptcha, int nRequestID) = 0;
///用户发出获取短信验证码请求
virtual int ReqGenUserText(CThostFtdcReqGenUserTextField *pReqGenUserText, int nRequestID) = 0;
///用户发出带有图片验证码的登陆请求
virtual int ReqUserLoginWithCaptcha(CThostFtdcReqUserLoginWithCaptchaField *pReqUserLoginWithCaptcha, int nRequestID) = 0;
///用户发出带有短信验证码的登陆请求
virtual int ReqUserLoginWithText(CThostFtdcReqUserLoginWithTextField *pReqUserLoginWithText, int nRequestID) = 0;
///用户发出带有动态口令的登陆请求
virtual int ReqUserLoginWithOTP(CThostFtdcReqUserLoginWithOTPField *pReqUserLoginWithOTP, int nRequestID) = 0;
///报单录入请求
virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0;
///预埋单录入请求
virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0;
///预埋撤单录入请求
virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0;
///报单操作请求
virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0;
///查询最大报单数量请求
virtual int ReqQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField *pQryMaxOrderVolume, int nRequestID) = 0;
///投资者结算结果确认
virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0;
///请求删除预埋单
virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0;
///请求删除预埋撤单
virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0;
///执行宣告录入请求
virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0;
///执行宣告操作请求
virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0;
///询价录入请求
virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0;
///报价录入请求
virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0;
///报价操作请求
virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0;
///批量报单操作请求
virtual int ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, int nRequestID) = 0;
///期权自对冲录入请求
virtual int ReqOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, int nRequestID) = 0;
///期权自对冲操作请求
virtual int ReqOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, int nRequestID) = 0;
///申请组合录入请求
virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0;
///请求查询报单
virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0;
///请求查询成交
virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0;
///请求查询投资者持仓
virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0;
///请求查询资金账户
virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
///请求查询投资者
virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0;
///请求查询交易编码
virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0;
///请求查询合约保证金率
virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0;
///请求查询合约手续费率
virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0;
///请求查询用户会话
virtual int ReqQryUserSession(CThostFtdcQryUserSessionField *pQryUserSession, int nRequestID) = 0;
///请求查询交易所
virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0;
///请求查询产品
virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0;
///请求查询合约
virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0;
///请求查询行情
virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0;
///请求查询交易员报盘机
virtual int ReqQryTraderOffer(CThostFtdcQryTraderOfferField *pQryTraderOffer, int nRequestID) = 0;
///请求查询投资者结算结果
virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0;
///请求查询转帐银行
virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0;
///请求查询投资者持仓明细
virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0;
///请求查询客户通知
virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0;
///请求查询结算信息确认
virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0;
///请求查询投资者持仓明细
virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0;
///请求查询保证金监管系统经纪公司资金账户密钥
virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0;
///请求查询仓单折抵信息
virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0;
///请求查询投资者品种/跨品种保证金
virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0;
///请求查询交易所保证金率
virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0;
///请求查询交易所调整保证金率
virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0;
///请求查询汇率
virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0;
///请求查询二级代理操作员银期权限
virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0;
///请求查询产品报价汇率
virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0;
///请求查询产品组
virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0;
///请求查询做市商合约手续费率
virtual int ReqQryMMInstrumentCommissionRate(CThostFtdcQryMMInstrumentCommissionRateField *pQryMMInstrumentCommissionRate, int nRequestID) = 0;
///请求查询做市商期权合约手续费
virtual int ReqQryMMOptionInstrCommRate(CThostFtdcQryMMOptionInstrCommRateField *pQryMMOptionInstrCommRate, int nRequestID) = 0;
///请求查询报单手续费
virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0;
///请求查询资金账户
virtual int ReqQrySecAgentTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
///请求查询二级代理商资金校验模式
virtual int ReqQrySecAgentCheckMode(CThostFtdcQrySecAgentCheckModeField *pQrySecAgentCheckMode, int nRequestID) = 0;
///请求查询二级代理商信息
virtual int ReqQrySecAgentTradeInfo(CThostFtdcQrySecAgentTradeInfoField *pQrySecAgentTradeInfo, int nRequestID) = 0;
///请求查询期权交易成本
virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0;
///请求查询期权合约手续费
virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0;
///请求查询执行宣告
virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0;
///请求查询询价
virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0;
///请求查询报价
virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0;
///请求查询期权自对冲
virtual int ReqQryOptionSelfClose(CThostFtdcQryOptionSelfCloseField *pQryOptionSelfClose, int nRequestID) = 0;
///请求查询投资单元
virtual int ReqQryInvestUnit(CThostFtdcQryInvestUnitField *pQryInvestUnit, int nRequestID) = 0;
///请求查询组合合约安全系数
virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0;
///请求查询申请组合
virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0;
///请求查询转帐流水
virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0;
///请求查询银期签约关系
virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0;
///请求查询签约银行
virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0;
///请求查询预埋单
virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0;
///请求查询预埋撤单
virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0;
///请求查询交易通知
virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0;
///请求查询经纪公司交易参数
virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0;
///请求查询经纪公司交易算法
virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0;
///请求查询监控中心用户令牌
virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0;
///期货发起银行资金转期货请求
virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
///期货发起期货资金转银行请求
virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
///期货发起查询银行余额请求
virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0;
///请求查询分类合约
virtual int ReqQryClassifiedInstrument(CThostFtdcQryClassifiedInstrumentField *pQryClassifiedInstrument, int nRequestID) = 0;
///请求组合优惠比例
virtual int ReqQryCombPromotionParam(CThostFtdcQryCombPromotionParamField *pQryCombPromotionParam, int nRequestID) = 0;
///投资者风险结算持仓查询
virtual int ReqQryRiskSettleInvstPosition(CThostFtdcQryRiskSettleInvstPositionField *pQryRiskSettleInvstPosition, int nRequestID) = 0;
///风险结算产品查询
virtual int ReqQryRiskSettleProductStatus(CThostFtdcQryRiskSettleProductStatusField *pQryRiskSettleProductStatus, int nRequestID) = 0;
///SPBM期货合约参数查询
virtual int ReqQrySPBMFutureParameter(CThostFtdcQrySPBMFutureParameterField *pQrySPBMFutureParameter, int nRequestID) = 0;
///SPBM期权合约参数查询
virtual int ReqQrySPBMOptionParameter(CThostFtdcQrySPBMOptionParameterField *pQrySPBMOptionParameter, int nRequestID) = 0;
///SPBM品种内对锁仓折扣参数查询
virtual int ReqQrySPBMIntraParameter(CThostFtdcQrySPBMIntraParameterField *pQrySPBMIntraParameter, int nRequestID) = 0;
///SPBM跨品种抵扣参数查询
virtual int ReqQrySPBMInterParameter(CThostFtdcQrySPBMInterParameterField *pQrySPBMInterParameter, int nRequestID) = 0;
///SPBM组合保证金套餐查询
virtual int ReqQrySPBMPortfDefinition(CThostFtdcQrySPBMPortfDefinitionField *pQrySPBMPortfDefinition, int nRequestID) = 0;
///投资者SPBM套餐选择查询
virtual int ReqQrySPBMInvestorPortfDef(CThostFtdcQrySPBMInvestorPortfDefField *pQrySPBMInvestorPortfDef, int nRequestID) = 0;
///投资者新型组合保证金系数查询
virtual int ReqQryInvestorPortfMarginRatio(CThostFtdcQryInvestorPortfMarginRatioField *pQryInvestorPortfMarginRatio, int nRequestID) = 0;
///投资者产品SPBM明细查询
virtual int ReqQryInvestorProdSPBMDetail(CThostFtdcQryInvestorProdSPBMDetailField *pQryInvestorProdSPBMDetail, int nRequestID) = 0;
///投资者商品组SPMM记录查询
virtual int ReqQryInvestorCommoditySPMMMargin(CThostFtdcQryInvestorCommoditySPMMMarginField *pQryInvestorCommoditySPMMMargin, int nRequestID) = 0;
///投资者商品群SPMM记录查询
virtual int ReqQryInvestorCommodityGroupSPMMMargin(CThostFtdcQryInvestorCommodityGroupSPMMMarginField *pQryInvestorCommodityGroupSPMMMargin, int nRequestID) = 0;
///SPMM合约参数查询
virtual int ReqQrySPMMInstParam(CThostFtdcQrySPMMInstParamField *pQrySPMMInstParam, int nRequestID) = 0;
///SPMM产品参数查询
virtual int ReqQrySPMMProductParam(CThostFtdcQrySPMMProductParamField *pQrySPMMProductParam, int nRequestID) = 0;
///SPBM附加跨品种抵扣参数查询
virtual int ReqQrySPBMAddOnInterParameter(CThostFtdcQrySPBMAddOnInterParameterField *pQrySPBMAddOnInterParameter, int nRequestID) = 0;
///RCAMS产品组合信息查询
virtual int ReqQryRCAMSCombProductInfo(CThostFtdcQryRCAMSCombProductInfoField *pQryRCAMSCombProductInfo, int nRequestID) = 0;
///RCAMS同合约风险对冲参数查询
virtual int ReqQryRCAMSInstrParameter(CThostFtdcQryRCAMSInstrParameterField *pQryRCAMSInstrParameter, int nRequestID) = 0;
///RCAMS品种内风险对冲参数查询
virtual int ReqQryRCAMSIntraParameter(CThostFtdcQryRCAMSIntraParameterField *pQryRCAMSIntraParameter, int nRequestID) = 0;
///RCAMS跨品种风险折抵参数查询
virtual int ReqQryRCAMSInterParameter(CThostFtdcQryRCAMSInterParameterField *pQryRCAMSInterParameter, int nRequestID) = 0;
///RCAMS空头期权风险调整参数查询
virtual int ReqQryRCAMSShortOptAdjustParam(CThostFtdcQryRCAMSShortOptAdjustParamField *pQryRCAMSShortOptAdjustParam, int nRequestID) = 0;
///RCAMS策略组合持仓查询
virtual int ReqQryRCAMSInvestorCombPosition(CThostFtdcQryRCAMSInvestorCombPositionField *pQryRCAMSInvestorCombPosition, int nRequestID) = 0;
///投资者品种RCAMS保证金查询
virtual int ReqQryInvestorProdRCAMSMargin(CThostFtdcQryInvestorProdRCAMSMarginField *pQryInvestorProdRCAMSMargin, int nRequestID) = 0;
///RULE合约保证金参数查询
virtual int ReqQryRULEInstrParameter(CThostFtdcQryRULEInstrParameterField *pQryRULEInstrParameter, int nRequestID) = 0;
///RULE品种内对锁仓折扣参数查询
virtual int ReqQryRULEIntraParameter(CThostFtdcQryRULEIntraParameterField *pQryRULEIntraParameter, int nRequestID) = 0;
///RULE跨品种抵扣参数查询
virtual int ReqQryRULEInterParameter(CThostFtdcQryRULEInterParameterField *pQryRULEInterParameter, int nRequestID) = 0;
///投资者产品RULE保证金查询
virtual int ReqQryInvestorProdRULEMargin(CThostFtdcQryInvestorProdRULEMarginField *pQryInvestorProdRULEMargin, int nRequestID) = 0;
///投资者新型组合保证金开关查询
virtual int ReqQryInvestorPortfSetting(CThostFtdcQryInvestorPortfSettingField *pQryInvestorPortfSetting, int nRequestID) = 0;
///投资者申报费阶梯收取记录查询
virtual int ReqQryInvestorInfoCommRec(CThostFtdcQryInvestorInfoCommRecField *pQryInvestorInfoCommRec, int nRequestID) = 0;
///组合腿信息查询
virtual int ReqQryCombLeg(CThostFtdcQryCombLegField *pQryCombLeg, int nRequestID) = 0;
///对冲设置请求
virtual int ReqOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, int nRequestID) = 0;
///对冲设置撤销请求
virtual int ReqCancelOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, int nRequestID) = 0;
///投资者对冲设置查询
virtual int ReqQryOffsetSetting(CThostFtdcQryOffsetSettingField *pQryOffsetSetting, int nRequestID) = 0;
protected:
~CThostFtdcTraderApi(){};
};
#endif
================================================
FILE: native/ctp_bridge/api/linux/ThostFtdcUserApiDataType.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcUserApiDataType.h
///@brief 定义了客户端接口使用的业务数据类型
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#ifndef THOST_FTDCDATATYPE_H
#define THOST_FTDCDATATYPE_H
enum THOST_TE_RESUME_TYPE
{
THOST_TERT_RESTART = 0,
THOST_TERT_RESUME,
THOST_TERT_QUICK,
THOST_TERT_NONE
};
/////////////////////////////////////////////////////////////////////////
///TFtdcTraderIDType是一个交易所交易员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTraderIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDType是一个投资者代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerIDType是一个经纪公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerAbbrType是一个经纪公司简称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerAbbrType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerNameType是一个经纪公司名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldExchangeInstIDType是一个合约在交易所的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldExchangeInstIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeInstIDType是一个合约在交易所的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeInstIDType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderRefType是一个报单引用类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderRefType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcParticipantIDType是一个会员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParticipantIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserIDType是一个用户代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserIDType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordType是一个密码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPasswordType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDType是一个交易编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldInstrumentIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldInstrumentIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentCodeType是一个合约标识码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentCodeType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcMarketIDType是一个市场代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMarketIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcProductNameType是一个产品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeIDType是一个交易所代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeNameType是一个交易所名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeAbbrType是一个交易所简称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeAbbrType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeFlagType是一个交易所标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcMacAddressType是一个Mac地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMacAddressType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemIDType是一个系统编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSystemIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientLoginRemarkType是一个客户登录备注2类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientLoginRemarkType[151];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangePropertyType是一个交易所属性类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_EXP_Normal '0'
///根据成交生成报单
#define THOST_FTDC_EXP_GenOrderByTrade '1'
typedef char TThostFtdcExchangePropertyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTimeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongTimeType是一个长时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongTimeType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentNameType是一个合约名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementGroupIDType是一个结算组代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettlementGroupIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSysIDType是一个报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderSysIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeIDType是一个成交编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommandTypeType是一个DB命令类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommandTypeType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldIPAddressType是一个IP地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldIPAddressType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcIPAddressType是一个IP地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIPAddressType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcIPPortType是一个IP端口类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcIPPortType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductInfoType是一个产品信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductInfoType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcProtocolInfoType是一个协议信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProtocolInfoType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessUnitType是一个业务单元类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessUnitType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcDepositSeqNoType是一个出入金流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDepositSeqNoType[15];
/////////////////////////////////////////////////////////////////////////
///TFtdcIdentifiedCardNoType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIdentifiedCardNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcIdCardTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
///组织机构代码
#define THOST_FTDC_ICT_EID '0'
///中国公民身份证
#define THOST_FTDC_ICT_IDCard '1'
///军官证
#define THOST_FTDC_ICT_OfficerIDCard '2'
///警官证
#define THOST_FTDC_ICT_PoliceIDCard '3'
///士兵证
#define THOST_FTDC_ICT_SoldierIDCard '4'
///户口簿
#define THOST_FTDC_ICT_HouseholdRegister '5'
///护照
#define THOST_FTDC_ICT_Passport '6'
///台胞证
#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7'
///回乡证
#define THOST_FTDC_ICT_HomeComingCard '8'
///营业执照号
#define THOST_FTDC_ICT_LicenseNo '9'
///税务登记号/当地纳税ID
#define THOST_FTDC_ICT_TaxNo 'A'
///港澳居民来往内地通行证
#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B'
///台湾居民来往大陆通行证
#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C'
///驾照
#define THOST_FTDC_ICT_DrivingLicense 'D'
///当地社保ID
#define THOST_FTDC_ICT_SocialID 'F'
///当地身份证
#define THOST_FTDC_ICT_LocalID 'G'
///商业登记证
#define THOST_FTDC_ICT_BusinessRegistration 'H'
///港澳永久性居民身份证
#define THOST_FTDC_ICT_HKMCIDCard 'I'
///人行开户许可证
#define THOST_FTDC_ICT_AccountsPermits 'J'
///外国人永久居留证
#define THOST_FTDC_ICT_FrgPrmtRdCard 'K'
///资管产品备案函
#define THOST_FTDC_ICT_CptMngPrdLetter 'L'
///港澳台居民居住证
#define THOST_FTDC_ICT_HKMCTwResidencePermit 'M'
///统一社会信用代码
#define THOST_FTDC_ICT_UniformSocialCreditCode 'N'
///机构成立证明文件
#define THOST_FTDC_ICT_CorporationCertNo 'O'
///其他证件
#define THOST_FTDC_ICT_OtherCard 'x'
typedef char TThostFtdcIdCardTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderLocalIDType是一个本地报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderLocalIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserNameType是一个用户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcPartyNameType是一个参与人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPartyNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcErrorMsgType是一个错误信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcErrorMsgType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcFieldNameType是一个字段名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFieldNameType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcFieldContentType是一个字段内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFieldContentType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemNameType是一个系统名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSystemNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcContentType是一个消息正文类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcContentType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_IR_All '1'
///投资者组
#define THOST_FTDC_IR_Group '2'
///单一投资者
#define THOST_FTDC_IR_Single '3'
typedef char TThostFtdcInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDepartmentRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_DR_All '1'
///组织架构
#define THOST_FTDC_DR_Group '2'
///单一投资者
#define THOST_FTDC_DR_Single '3'
typedef char TThostFtdcDepartmentRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataSyncStatusType是一个数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///未同步
#define THOST_FTDC_DS_Asynchronous '1'
///同步中
#define THOST_FTDC_DS_Synchronizing '2'
///已同步
#define THOST_FTDC_DS_Synchronized '3'
typedef char TThostFtdcDataSyncStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerDataSyncStatusType是一个经纪公司数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///已同步
#define THOST_FTDC_BDS_Synchronized '1'
///同步中
#define THOST_FTDC_BDS_Synchronizing '2'
typedef char TThostFtdcBrokerDataSyncStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeConnectStatusType是一个交易所连接状态类型
/////////////////////////////////////////////////////////////////////////
///没有任何连接
#define THOST_FTDC_ECS_NoConnection '1'
///已经发出合约查询请求
#define THOST_FTDC_ECS_QryInstrumentSent '2'
///已经获取信息
#define THOST_FTDC_ECS_GotInformation '9'
typedef char TThostFtdcExchangeConnectStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTraderConnectStatusType是一个交易所交易员连接状态类型
/////////////////////////////////////////////////////////////////////////
///没有任何连接
#define THOST_FTDC_TCS_NotConnected '1'
///已经连接
#define THOST_FTDC_TCS_Connected '2'
///已经发出合约查询请求
#define THOST_FTDC_TCS_QryInstrumentSent '3'
///订阅私有流
#define THOST_FTDC_TCS_SubPrivateFlow '4'
typedef char TThostFtdcTraderConnectStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionCodeType是一个功能代码类型
/////////////////////////////////////////////////////////////////////////
///数据异步化
#define THOST_FTDC_FC_DataAsync '1'
///强制用户登出
#define THOST_FTDC_FC_ForceUserLogout '2'
///变更管理用户口令
#define THOST_FTDC_FC_UserPasswordUpdate '3'
///变更经纪公司口令
#define THOST_FTDC_FC_BrokerPasswordUpdate '4'
///变更投资者口令
#define THOST_FTDC_FC_InvestorPasswordUpdate '5'
///报单插入
#define THOST_FTDC_FC_OrderInsert '6'
///报单操作
#define THOST_FTDC_FC_OrderAction '7'
///同步系统数据
#define THOST_FTDC_FC_SyncSystemData '8'
///同步经纪公司数据
#define THOST_FTDC_FC_SyncBrokerData '9'
///批量同步经纪公司数据
#define THOST_FTDC_FC_BachSyncBrokerData 'A'
///超级查询
#define THOST_FTDC_FC_SuperQuery 'B'
///预埋报单插入
#define THOST_FTDC_FC_ParkedOrderInsert 'C'
///预埋报单操作
#define THOST_FTDC_FC_ParkedOrderAction 'D'
///同步动态令牌
#define THOST_FTDC_FC_SyncOTP 'E'
///删除未知单
#define THOST_FTDC_FC_DeleteOrder 'F'
///退出紧急状态
#define THOST_FTDC_FC_ExitEmergency 'G'
typedef char TThostFtdcFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerFunctionCodeType是一个经纪公司功能代码类型
/////////////////////////////////////////////////////////////////////////
///强制用户登出
#define THOST_FTDC_BFC_ForceUserLogout '1'
///变更用户口令
#define THOST_FTDC_BFC_UserPasswordUpdate '2'
///同步经纪公司数据
#define THOST_FTDC_BFC_SyncBrokerData '3'
///批量同步经纪公司数据
#define THOST_FTDC_BFC_BachSyncBrokerData '4'
///报单插入
#define THOST_FTDC_BFC_OrderInsert '5'
///报单操作
#define THOST_FTDC_BFC_OrderAction '6'
///全部查询
#define THOST_FTDC_BFC_AllQuery '7'
///系统功能:登入/登出/修改密码等
#define THOST_FTDC_BFC_log 'a'
///基本查询:查询基础数据,如合约,交易所等常量
#define THOST_FTDC_BFC_BaseQry 'b'
///交易查询:如查成交,委托
#define THOST_FTDC_BFC_TradeQry 'c'
///交易功能:报单,撤单
#define THOST_FTDC_BFC_Trade 'd'
///银期转账
#define THOST_FTDC_BFC_Virement 'e'
///风险监控
#define THOST_FTDC_BFC_Risk 'f'
///查询/管理:查询会话,踢人等
#define THOST_FTDC_BFC_Session 'g'
///风控通知控制
#define THOST_FTDC_BFC_RiskNoticeCtl 'h'
///风控通知发送
#define THOST_FTDC_BFC_RiskNotice 'i'
///察看经纪公司资金权限
#define THOST_FTDC_BFC_BrokerDeposit 'j'
///资金查询
#define THOST_FTDC_BFC_QueryFund 'k'
///报单查询
#define THOST_FTDC_BFC_QueryOrder 'l'
///成交查询
#define THOST_FTDC_BFC_QueryTrade 'm'
///持仓查询
#define THOST_FTDC_BFC_QueryPosition 'n'
///行情查询
#define THOST_FTDC_BFC_QueryMarketData 'o'
///用户事件查询
#define THOST_FTDC_BFC_QueryUserEvent 'p'
///风险通知查询
#define THOST_FTDC_BFC_QueryRiskNotify 'q'
///出入金查询
#define THOST_FTDC_BFC_QueryFundChange 'r'
///投资者信息查询
#define THOST_FTDC_BFC_QueryInvestor 's'
///交易编码查询
#define THOST_FTDC_BFC_QueryTradingCode 't'
///强平
#define THOST_FTDC_BFC_ForceClose 'u'
///压力测试
#define THOST_FTDC_BFC_PressTest 'v'
///权益反算
#define THOST_FTDC_BFC_RemainCalc 'w'
///净持仓保证金指标
#define THOST_FTDC_BFC_NetPositionInd 'x'
///风险预算
#define THOST_FTDC_BFC_RiskPredict 'y'
///数据导出
#define THOST_FTDC_BFC_DataExport 'z'
///风控指标设置
#define THOST_FTDC_BFC_RiskTargetSetup 'A'
///行情预警
#define THOST_FTDC_BFC_MarketDataWarn 'B'
///业务通知查询
#define THOST_FTDC_BFC_QryBizNotice 'C'
///业务通知模板设置
#define THOST_FTDC_BFC_CfgBizNotice 'D'
///同步动态令牌
#define THOST_FTDC_BFC_SyncOTP 'E'
///发送业务通知
#define THOST_FTDC_BFC_SendBizNotice 'F'
///风险级别标准设置
#define THOST_FTDC_BFC_CfgRiskLevelStd 'G'
///交易终端应急功能
#define THOST_FTDC_BFC_TbCommand 'H'
///删除未知单
#define THOST_FTDC_BFC_DeleteOrder 'J'
///预埋报单插入
#define THOST_FTDC_BFC_ParkedOrderInsert 'K'
///预埋报单操作
#define THOST_FTDC_BFC_ParkedOrderAction 'L'
///资金不够仍允许行权
#define THOST_FTDC_BFC_ExecOrderNoCheck 'M'
///指定
#define THOST_FTDC_BFC_Designate 'N'
///证券处置
#define THOST_FTDC_BFC_StockDisposal 'O'
///席位资金预警
#define THOST_FTDC_BFC_BrokerDepositWarn 'Q'
///备兑不足预警
#define THOST_FTDC_BFC_CoverWarn 'S'
///行权试算
#define THOST_FTDC_BFC_PreExecOrder 'T'
///行权交收风险
#define THOST_FTDC_BFC_ExecOrderRisk 'P'
///持仓限额预警
#define THOST_FTDC_BFC_PosiLimitWarn 'U'
///持仓限额查询
#define THOST_FTDC_BFC_QryPosiLimit 'V'
///银期签到签退
#define THOST_FTDC_BFC_FBSign 'W'
///银期签约解约
#define THOST_FTDC_BFC_FBAccount 'X'
typedef char TThostFtdcBrokerFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderActionStatusType是一个报单操作状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_OAS_Submitted 'a'
///已经接受
#define THOST_FTDC_OAS_Accepted 'b'
///已经被拒绝
#define THOST_FTDC_OAS_Rejected 'c'
typedef char TThostFtdcOrderActionStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderStatusType是一个报单状态类型
/////////////////////////////////////////////////////////////////////////
///全部成交
#define THOST_FTDC_OST_AllTraded '0'
///部分成交还在队列中
#define THOST_FTDC_OST_PartTradedQueueing '1'
///部分成交不在队列中
#define THOST_FTDC_OST_PartTradedNotQueueing '2'
///未成交还在队列中
#define THOST_FTDC_OST_NoTradeQueueing '3'
///未成交不在队列中
#define THOST_FTDC_OST_NoTradeNotQueueing '4'
///撤单
#define THOST_FTDC_OST_Canceled '5'
///未知
#define THOST_FTDC_OST_Unknown 'a'
///尚未触发
#define THOST_FTDC_OST_NotTouched 'b'
///已触发
#define THOST_FTDC_OST_Touched 'c'
typedef char TThostFtdcOrderStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSubmitStatusType是一个报单提交状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_OSS_InsertSubmitted '0'
///撤单已经提交
#define THOST_FTDC_OSS_CancelSubmitted '1'
///修改已经提交
#define THOST_FTDC_OSS_ModifySubmitted '2'
///已经接受
#define THOST_FTDC_OSS_Accepted '3'
///报单已经被拒绝
#define THOST_FTDC_OSS_InsertRejected '4'
///撤单已经被拒绝
#define THOST_FTDC_OSS_CancelRejected '5'
///改单已经被拒绝
#define THOST_FTDC_OSS_ModifyRejected '6'
typedef char TThostFtdcOrderSubmitStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionDateType是一个持仓日期类型
/////////////////////////////////////////////////////////////////////////
///今日持仓
#define THOST_FTDC_PSD_Today '1'
///历史持仓
#define THOST_FTDC_PSD_History '2'
typedef char TThostFtdcPositionDateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionDateTypeType是一个持仓日期类型类型
/////////////////////////////////////////////////////////////////////////
///使用历史持仓
#define THOST_FTDC_PDT_UseHistory '1'
///不使用历史持仓
#define THOST_FTDC_PDT_NoUseHistory '2'
typedef char TThostFtdcPositionDateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingRoleType是一个交易角色类型
/////////////////////////////////////////////////////////////////////////
///代理
#define THOST_FTDC_ER_Broker '1'
///自营
#define THOST_FTDC_ER_Host '2'
///做市商
#define THOST_FTDC_ER_Maker '3'
typedef char TThostFtdcTradingRoleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_PC_Futures '1'
///期货期权
#define THOST_FTDC_PC_Options '2'
///组合
#define THOST_FTDC_PC_Combination '3'
///即期
#define THOST_FTDC_PC_Spot '4'
///期转现
#define THOST_FTDC_PC_EFP '5'
///现货期权
#define THOST_FTDC_PC_SpotOption '6'
///TAS合约
#define THOST_FTDC_PC_TAS '7'
///金属指数
#define THOST_FTDC_PC_MI 'I'
typedef char TThostFtdcProductClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAPIProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货单一合约
#define THOST_FTDC_APC_FutureSingle '1'
///期权单一合约
#define THOST_FTDC_APC_OptionSingle '2'
///可交易期货(含期货组合和期货单一合约)
#define THOST_FTDC_APC_Futures '3'
///可交易期权(含期权组合和期权单一合约)
#define THOST_FTDC_APC_Options '4'
///可下单套利组合
#define THOST_FTDC_APC_TradingComb '5'
///可申请的组合(可以申请的组合合约 包含可以交易的合约)
#define THOST_FTDC_APC_UnTradingComb '6'
///所有可以交易合约
#define THOST_FTDC_APC_AllTrading '7'
///所有合约(包含不能交易合约 慎用)
#define THOST_FTDC_APC_All '8'
typedef char TThostFtdcAPIProductClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstLifePhaseType是一个合约生命周期状态类型
/////////////////////////////////////////////////////////////////////////
///未上市
#define THOST_FTDC_IP_NotStart '0'
///上市
#define THOST_FTDC_IP_Started '1'
///停牌
#define THOST_FTDC_IP_Pause '2'
///到期
#define THOST_FTDC_IP_Expired '3'
typedef char TThostFtdcInstLifePhaseType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDirectionType是一个买卖方向类型
/////////////////////////////////////////////////////////////////////////
///买
#define THOST_FTDC_D_Buy '0'
///卖
#define THOST_FTDC_D_Sell '1'
typedef char TThostFtdcDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionTypeType是一个持仓类型类型
/////////////////////////////////////////////////////////////////////////
///净持仓
#define THOST_FTDC_PT_Net '1'
///综合持仓
#define THOST_FTDC_PT_Gross '2'
typedef char TThostFtdcPositionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPosiDirectionType是一个持仓多空方向类型
/////////////////////////////////////////////////////////////////////////
///净
#define THOST_FTDC_PD_Net '1'
///多头
#define THOST_FTDC_PD_Long '2'
///空头
#define THOST_FTDC_PD_Short '3'
typedef char TThostFtdcPosiDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysSettlementStatusType是一个系统结算状态类型
/////////////////////////////////////////////////////////////////////////
///不活跃
#define THOST_FTDC_SS_NonActive '1'
///启动
#define THOST_FTDC_SS_Startup '2'
///操作
#define THOST_FTDC_SS_Operating '3'
///结算
#define THOST_FTDC_SS_Settlement '4'
///结算完成
#define THOST_FTDC_SS_SettlementFinished '5'
typedef char TThostFtdcSysSettlementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRatioAttrType是一个费率属性类型
/////////////////////////////////////////////////////////////////////////
///交易费率
#define THOST_FTDC_RA_Trade '0'
///结算费率
#define THOST_FTDC_RA_Settlement '1'
typedef char TThostFtdcRatioAttrType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeFlagType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_HF_Speculation '1'
///套利
#define THOST_FTDC_HF_Arbitrage '2'
///套保
#define THOST_FTDC_HF_Hedge '3'
///做市商
#define THOST_FTDC_HF_MarketMaker '5'
///第一腿投机第二腿套保
#define THOST_FTDC_HF_SpecHedge '6'
///第一腿套保第二腿投机
#define THOST_FTDC_HF_HedgeSpec '7'
typedef char TThostFtdcHedgeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillHedgeFlagType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_BHF_Speculation '1'
///套利
#define THOST_FTDC_BHF_Arbitrage '2'
///套保
#define THOST_FTDC_BHF_Hedge '3'
typedef char TThostFtdcBillHedgeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDTypeType是一个交易编码类型类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_CIDT_Speculation '1'
///套利
#define THOST_FTDC_CIDT_Arbitrage '2'
///套保
#define THOST_FTDC_CIDT_Hedge '3'
///做市商
#define THOST_FTDC_CIDT_MarketMaker '5'
typedef char TThostFtdcClientIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderPriceTypeType是一个报单价格条件类型
/////////////////////////////////////////////////////////////////////////
///任意价
#define THOST_FTDC_OPT_AnyPrice '1'
///限价
#define THOST_FTDC_OPT_LimitPrice '2'
///最优价
#define THOST_FTDC_OPT_BestPrice '3'
///最新价
#define THOST_FTDC_OPT_LastPrice '4'
///最新价浮动上浮1个ticks
#define THOST_FTDC_OPT_LastPricePlusOneTicks '5'
///最新价浮动上浮2个ticks
#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6'
///最新价浮动上浮3个ticks
#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7'
///卖一价
#define THOST_FTDC_OPT_AskPrice1 '8'
///卖一价浮动上浮1个ticks
#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9'
///卖一价浮动上浮2个ticks
#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A'
///卖一价浮动上浮3个ticks
#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B'
///买一价
#define THOST_FTDC_OPT_BidPrice1 'C'
///买一价浮动上浮1个ticks
#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D'
///买一价浮动上浮2个ticks
#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E'
///买一价浮动上浮3个ticks
#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F'
///五档价
#define THOST_FTDC_OPT_FiveLevelPrice 'G'
typedef char TThostFtdcOrderPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetFlagType是一个开平标志类型
/////////////////////////////////////////////////////////////////////////
///开仓
#define THOST_FTDC_OF_Open '0'
///平仓
#define THOST_FTDC_OF_Close '1'
///强平
#define THOST_FTDC_OF_ForceClose '2'
///平今
#define THOST_FTDC_OF_CloseToday '3'
///平昨
#define THOST_FTDC_OF_CloseYesterday '4'
///强减
#define THOST_FTDC_OF_ForceOff '5'
///本地强平
#define THOST_FTDC_OF_LocalForceClose '6'
typedef char TThostFtdcOffsetFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseReasonType是一个强平原因类型
/////////////////////////////////////////////////////////////////////////
///非强平
#define THOST_FTDC_FCC_NotForceClose '0'
///资金不足
#define THOST_FTDC_FCC_LackDeposit '1'
///客户超仓
#define THOST_FTDC_FCC_ClientOverPositionLimit '2'
///会员超仓
#define THOST_FTDC_FCC_MemberOverPositionLimit '3'
///持仓非整数倍
#define THOST_FTDC_FCC_NotMultiple '4'
///违规
#define THOST_FTDC_FCC_Violation '5'
///其它
#define THOST_FTDC_FCC_Other '6'
///自然人临近交割
#define THOST_FTDC_FCC_PersonDeliv '7'
///本地强平资金不足忽略敞口
#define THOST_FTDC_FCC_Notverifycapital '8'
///本地强平资金不足
#define THOST_FTDC_FCC_LocalLackDeposit '9'
///本地强平违规持仓忽略敞口
#define THOST_FTDC_FCC_LocalViolationNocheck 'a'
///本地强平违规持仓
#define THOST_FTDC_FCC_LocalViolation 'b'
typedef char TThostFtdcForceCloseReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderTypeType是一个报单类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_ORDT_Normal '0'
///报价衍生
#define THOST_FTDC_ORDT_DeriveFromQuote '1'
///组合衍生
#define THOST_FTDC_ORDT_DeriveFromCombination '2'
///组合报单
#define THOST_FTDC_ORDT_Combination '3'
///条件单
#define THOST_FTDC_ORDT_ConditionalOrder '4'
///互换单
#define THOST_FTDC_ORDT_Swap '5'
///大宗交易成交衍生
#define THOST_FTDC_ORDT_DeriveFromBlockTrade '6'
///期转现成交衍生
#define THOST_FTDC_ORDT_DeriveFromEFPTrade '7'
typedef char TThostFtdcOrderTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeConditionType是一个有效期类型类型
/////////////////////////////////////////////////////////////////////////
///立即完成,否则撤销
#define THOST_FTDC_TC_IOC '1'
///本节有效
#define THOST_FTDC_TC_GFS '2'
///当日有效
#define THOST_FTDC_TC_GFD '3'
///指定日期前有效
#define THOST_FTDC_TC_GTD '4'
///撤销前有效
#define THOST_FTDC_TC_GTC '5'
///集合竞价有效
#define THOST_FTDC_TC_GFA '6'
typedef char TThostFtdcTimeConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeConditionType是一个成交量类型类型
/////////////////////////////////////////////////////////////////////////
///任何数量
#define THOST_FTDC_VC_AV '1'
///最小数量
#define THOST_FTDC_VC_MV '2'
///全部数量
#define THOST_FTDC_VC_CV '3'
typedef char TThostFtdcVolumeConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcContingentConditionType是一个触发条件类型
/////////////////////////////////////////////////////////////////////////
///立即
#define THOST_FTDC_CC_Immediately '1'
///止损
#define THOST_FTDC_CC_Touch '2'
///止赢
#define THOST_FTDC_CC_TouchProfit '3'
///预埋单
#define THOST_FTDC_CC_ParkedOrder '4'
///最新价大于条件价
#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5'
///最新价大于等于条件价
#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6'
///最新价小于条件价
#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7'
///最新价小于等于条件价
#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8'
///卖一价大于条件价
#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9'
///卖一价大于等于条件价
#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A'
///卖一价小于条件价
#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B'
///卖一价小于等于条件价
#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C'
///买一价大于条件价
#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D'
///买一价大于等于条件价
#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E'
///买一价小于条件价
#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F'
///买一价小于等于条件价
#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H'
typedef char TThostFtdcContingentConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionFlagType是一个操作标志类型
/////////////////////////////////////////////////////////////////////////
///删除
#define THOST_FTDC_AF_Delete '0'
///修改
#define THOST_FTDC_AF_Modify '3'
typedef char TThostFtdcActionFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingRightType是一个交易权限类型
/////////////////////////////////////////////////////////////////////////
///可以交易
#define THOST_FTDC_TR_Allow '0'
///只能平仓
#define THOST_FTDC_TR_CloseOnly '1'
///不能交易
#define THOST_FTDC_TR_Forbidden '2'
typedef char TThostFtdcTradingRightType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSourceType是一个报单来源类型
/////////////////////////////////////////////////////////////////////////
///来自参与者
#define THOST_FTDC_OSRC_Participant '0'
///来自管理员
#define THOST_FTDC_OSRC_Administrator '1'
typedef char TThostFtdcOrderSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeTypeType是一个成交类型类型
/////////////////////////////////////////////////////////////////////////
///组合持仓拆分为单一持仓,初始化不应包含该类型的持仓
#define THOST_FTDC_TRDT_SplitCombination '#'
///普通成交
#define THOST_FTDC_TRDT_Common '0'
///期权执行
#define THOST_FTDC_TRDT_OptionsExecution '1'
///OTC成交
#define THOST_FTDC_TRDT_OTC '2'
///期转现衍生成交
#define THOST_FTDC_TRDT_EFPDerived '3'
///组合衍生成交
#define THOST_FTDC_TRDT_CombinationDerived '4'
///大宗交易成交
#define THOST_FTDC_TRDT_BlockTrade '5'
typedef char TThostFtdcTradeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecPosiTypeType是一个特殊持仓明细标识类型
/////////////////////////////////////////////////////////////////////////
///普通持仓明细
#define THOST_FTDC_SPOST_Common '#'
///TAS合约成交产生的标的合约持仓明细
#define THOST_FTDC_SPOST_Tas '0'
typedef char TThostFtdcSpecPosiTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceSourceType是一个成交价来源类型
/////////////////////////////////////////////////////////////////////////
///前成交价
#define THOST_FTDC_PSRC_LastPrice '0'
///买委托价
#define THOST_FTDC_PSRC_Buy '1'
///卖委托价
#define THOST_FTDC_PSRC_Sell '2'
///场外成交价
#define THOST_FTDC_PSRC_OTC '3'
typedef char TThostFtdcPriceSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentStatusType是一个合约交易状态类型
/////////////////////////////////////////////////////////////////////////
///开盘前
#define THOST_FTDC_IS_BeforeTrading '0'
///非交易
#define THOST_FTDC_IS_NoTrading '1'
///连续交易
#define THOST_FTDC_IS_Continous '2'
///集合竞价报单
#define THOST_FTDC_IS_AuctionOrdering '3'
///集合竞价价格平衡
#define THOST_FTDC_IS_AuctionBalance '4'
///集合竞价撮合
#define THOST_FTDC_IS_AuctionMatch '5'
///收盘
#define THOST_FTDC_IS_Closed '6'
///交易业务处理
#define THOST_FTDC_IS_TransactionProcessing '7'
typedef char TThostFtdcInstrumentStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstStatusEnterReasonType是一个品种进入交易状态原因类型
/////////////////////////////////////////////////////////////////////////
///自动切换
#define THOST_FTDC_IER_Automatic '1'
///手动切换
#define THOST_FTDC_IER_Manual '2'
///熔断
#define THOST_FTDC_IER_Fuse '3'
typedef char TThostFtdcInstStatusEnterReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderActionRefType是一个报单操作引用类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcOrderActionRefType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstallCountType是一个安装数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcInstallCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstallIDType是一个安装编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcInstallIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcErrorIDType是一个错误代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcErrorIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementIDType是一个结算编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSettlementIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeType是一个数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcVolumeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFrontIDType是一个前置编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFrontIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSessionIDType是一个会话编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSessionIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceNoType是一个序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSequenceNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommandNoType是一个DB命令序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommandNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMillisecType是一个时间(毫秒)类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMillisecType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSecType是一个时间(秒)类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSecType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeMultipleType是一个合约数量乘数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcVolumeMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingSegmentSNType是一个交易阶段编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradingSegmentSNType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRequestIDType是一个请求编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRequestIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcYearType是一个年份类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcYearType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthType是一个月份类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMonthType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBoolType是一个布尔型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBoolType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceType是一个价格类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcPriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombOffsetFlagType是一个组合开平标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombOffsetFlagType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombHedgeFlagType是一个组合投机套保标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombHedgeFlagType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcRatioType是一个比率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLargeVolumeType是一个大额数量类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcLargeVolumeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceSeriesType是一个序列系列号类型
/////////////////////////////////////////////////////////////////////////
typedef short TThostFtdcSequenceSeriesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommPhaseNoType是一个通讯时段编号类型
/////////////////////////////////////////////////////////////////////////
typedef short TThostFtdcCommPhaseNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceLabelType是一个序列编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSequenceLabelType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcUnderlyingMultipleType是一个基础商品乘数类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcUnderlyingMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcContractCodeType是一个合同编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcContractCodeType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcCityType是一个市类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCityType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcIsStockType是一个是否股民类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIsStockType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcChannelType是一个渠道类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcChannelType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddressType是一个通讯地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddressType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcZipCodeType是一个邮政编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcZipCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcTelephoneType是一个联系电话类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTelephoneType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcFaxType是一个传真类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFaxType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcMobileType是一个手机类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMobileType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcEMailType是一个电子邮件类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEMailType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcMemoType是一个备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMemoType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcCompanyCodeType是一个企业代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCompanyCodeType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcWebsiteType是一个网站地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWebsiteType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcTaxNoType是一个税务登记号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTaxNoType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcBatchStatusType是一个处理状态类型
/////////////////////////////////////////////////////////////////////////
///未上传
#define THOST_FTDC_BS_NoUpload '1'
///已上传
#define THOST_FTDC_BS_Uploaded '2'
///审核失败
#define THOST_FTDC_BS_Failed '3'
typedef char TThostFtdcBatchStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyIDType是一个属性代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyNameType是一个属性名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcLicenseNoType是一个营业执照号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLicenseNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentIDType是一个经纪人代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentNameType是一个经纪人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentGroupIDType是一个经纪人组代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentGroupIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentGroupNameType是一个经纪人组名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentGroupNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnStyleType是一个按品种返还方式类型
/////////////////////////////////////////////////////////////////////////
///按所有品种
#define THOST_FTDC_RS_All '1'
///按品种
#define THOST_FTDC_RS_ByProduct '2'
typedef char TThostFtdcReturnStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnPatternType是一个返还模式类型
/////////////////////////////////////////////////////////////////////////
///按成交手数
#define THOST_FTDC_RP_ByVolume '1'
///按留存手续费
#define THOST_FTDC_RP_ByFeeOnHand '2'
typedef char TThostFtdcReturnPatternType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnLevelType是一个返还级别类型
/////////////////////////////////////////////////////////////////////////
///级别1
#define THOST_FTDC_RL_Level1 '1'
///级别2
#define THOST_FTDC_RL_Level2 '2'
///级别3
#define THOST_FTDC_RL_Level3 '3'
///级别4
#define THOST_FTDC_RL_Level4 '4'
///级别5
#define THOST_FTDC_RL_Level5 '5'
///级别6
#define THOST_FTDC_RL_Level6 '6'
///级别7
#define THOST_FTDC_RL_Level7 '7'
///级别8
#define THOST_FTDC_RL_Level8 '8'
///级别9
#define THOST_FTDC_RL_Level9 '9'
typedef char TThostFtdcReturnLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnStandardType是一个返还标准类型
/////////////////////////////////////////////////////////////////////////
///分阶段返还
#define THOST_FTDC_RSD_ByPeriod '1'
///按某一标准
#define THOST_FTDC_RSD_ByStandard '2'
typedef char TThostFtdcReturnStandardType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMortgageTypeType是一个质押类型类型
/////////////////////////////////////////////////////////////////////////
///质出
#define THOST_FTDC_MT_Out '0'
///质入
#define THOST_FTDC_MT_In '1'
typedef char TThostFtdcMortgageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorSettlementParamIDType是一个投资者结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///质押比例
#define THOST_FTDC_ISPI_MortgageRatio '4'
///保证金算法
#define THOST_FTDC_ISPI_MarginWay '5'
///结算单结存是否包含质押
#define THOST_FTDC_ISPI_BillDeposit '9'
typedef char TThostFtdcInvestorSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeSettlementParamIDType是一个交易所结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///质押比例
#define THOST_FTDC_ESPI_MortgageRatio '1'
///分项资金导入项
#define THOST_FTDC_ESPI_OtherFundItem '2'
///分项资金入交易所出入金
#define THOST_FTDC_ESPI_OtherFundImport '3'
///中金所开户最低可用金额
#define THOST_FTDC_ESPI_CFFEXMinPrepa '6'
///郑商所结算方式
#define THOST_FTDC_ESPI_CZCESettlementType '7'
///交易所交割手续费收取方式
#define THOST_FTDC_ESPI_ExchDelivFeeMode '9'
///投资者交割手续费收取方式
#define THOST_FTDC_ESPI_DelivFeeMode '0'
///郑商所组合持仓保证金收取方式
#define THOST_FTDC_ESPI_CZCEComMarginType 'A'
///大商所套利保证金是否优惠
#define THOST_FTDC_ESPI_DceComMarginType 'B'
///虚值期权保证金优惠比率
#define THOST_FTDC_ESPI_OptOutDisCountRate 'a'
///最低保障系数
#define THOST_FTDC_ESPI_OptMiniGuarantee 'b'
typedef char TThostFtdcExchangeSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemParamIDType是一个系统参数代码类型
/////////////////////////////////////////////////////////////////////////
///投资者代码最小长度
#define THOST_FTDC_SPI_InvestorIDMinLength '1'
///投资者帐号代码最小长度
#define THOST_FTDC_SPI_AccountIDMinLength '2'
///投资者开户默认登录权限
#define THOST_FTDC_SPI_UserRightLogon '3'
///投资者交易结算单成交汇总方式
#define THOST_FTDC_SPI_SettlementBillTrade '4'
///统一开户更新交易编码方式
#define THOST_FTDC_SPI_TradingCode '5'
///结算是否判断存在未复核的出入金和分项资金
#define THOST_FTDC_SPI_CheckFund '6'
///是否启用手续费模板数据权限
#define THOST_FTDC_SPI_CommModelRight '7'
///是否启用保证金率模板数据权限
#define THOST_FTDC_SPI_MarginModelRight '9'
///是否规范用户才能激活
#define THOST_FTDC_SPI_IsStandardActive '8'
///上传的交易所结算文件路径
#define THOST_FTDC_SPI_UploadSettlementFile 'U'
///上报保证金监控中心文件路径
#define THOST_FTDC_SPI_DownloadCSRCFile 'D'
///生成的结算单文件路径
#define THOST_FTDC_SPI_SettlementBillFile 'S'
///证监会文件标识
#define THOST_FTDC_SPI_CSRCOthersFile 'C'
///投资者照片路径
#define THOST_FTDC_SPI_InvestorPhoto 'P'
///全结经纪公司上传文件路径
#define THOST_FTDC_SPI_CSRCData 'R'
///开户密码录入方式
#define THOST_FTDC_SPI_InvestorPwdModel 'I'
///投资者中金所结算文件下载路径
#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F'
///投资者代码编码方式
#define THOST_FTDC_SPI_InvestorIDType 'a'
///休眠户最高权益
#define THOST_FTDC_SPI_FreezeMaxReMain 'r'
///手续费相关操作实时上场开关
#define THOST_FTDC_SPI_IsSync 'A'
///解除开仓权限限制
#define THOST_FTDC_SPI_RelieveOpenLimit 'O'
///是否规范用户才能休眠
#define THOST_FTDC_SPI_IsStandardFreeze 'X'
///郑商所是否开放所有品种套保交易
#define THOST_FTDC_SPI_CZCENormalProductHedge 'B'
typedef char TThostFtdcSystemParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeParamIDType是一个交易系统参数代码类型
/////////////////////////////////////////////////////////////////////////
///系统加密算法
#define THOST_FTDC_TPID_EncryptionStandard 'E'
///系统风险算法
#define THOST_FTDC_TPID_RiskMode 'R'
///系统风险算法是否全局 0-否 1-是
#define THOST_FTDC_TPID_RiskModeGlobal 'G'
///密码加密算法
#define THOST_FTDC_TPID_modeEncode 'P'
///价格小数位数参数
#define THOST_FTDC_TPID_tickMode 'T'
///用户最大会话数
#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S'
///最大连续登录失败数
#define THOST_FTDC_TPID_LoginFailMaxNum 'L'
///是否强制认证
#define THOST_FTDC_TPID_IsAuthForce 'A'
///是否冻结证券持仓
#define THOST_FTDC_TPID_IsPosiFreeze 'F'
///是否限仓
#define THOST_FTDC_TPID_IsPosiLimit 'M'
///郑商所询价时间间隔
#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q'
///是否期货限仓
#define THOST_FTDC_TPID_IsFuturePosiLimit 'B'
///是否期货下单频率限制
#define THOST_FTDC_TPID_IsFutureOrderFreq 'C'
///行权冻结是否计算盈利
#define THOST_FTDC_TPID_IsExecOrderProfit 'H'
///银期开户是否验证开户银行卡号是否是预留银行账户
#define THOST_FTDC_TPID_IsCheckBankAcc 'I'
///弱密码最后修改日期
#define THOST_FTDC_TPID_PasswordDeadLine 'J'
///强密码校验
#define THOST_FTDC_TPID_IsStrongPassword 'K'
///自有资金质押比
#define THOST_FTDC_TPID_BalanceMorgage 'a'
///最小密码长度
#define THOST_FTDC_TPID_MinPwdLen 'O'
///IP当日最大登陆失败次数
#define THOST_FTDC_TPID_LoginFailMaxNumForIP 'U'
///密码有效期
#define THOST_FTDC_TPID_PasswordPeriod 'V'
///历史密码重复限制次数
#define THOST_FTDC_TPID_PwdHistoryCmp 'X'
///转账是否验证预留银行账户
#define THOST_FTDC_TPID_TranferChkProperty 'i'
///非交易时间异常报单校验参数
#define THOST_FTDC_TPID_TradeChkPhase 'j'
///其他异常报单校验参数(价格和手数)
#define THOST_FTDC_TPID_TradeChkPriceVol 'k'
///卖出垂直价差组合新算法
#define THOST_FTDC_TPID_NewBESMarginAlgo 'l'
typedef char TThostFtdcTradeParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementParamValueType是一个参数代码值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettlementParamValueType[256];
/////////////////////////////////////////////////////////////////////////
///TFtdcCounterIDType是一个计数器代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCounterIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorGroupNameType是一个投资者分组名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorGroupNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrandCodeType是一个牌号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrandCodeType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcWarehouseType是一个仓库类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWarehouseType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcProductDateType是一个产期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductDateType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcGradeType是一个等级类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcGradeType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcClassifyType是一个类别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClassifyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionType是一个货位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPositionType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcYieldlyType是一个产地类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcYieldlyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcWeightType是一个公定重量类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWeightType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubEntryFundNoType是一个分项资金流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSubEntryFundNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileIDType是一个文件标识类型
/////////////////////////////////////////////////////////////////////////
///资金数据
#define THOST_FTDC_FI_SettlementFund 'F'
///成交数据
#define THOST_FTDC_FI_Trade 'T'
///投资者持仓数据
#define THOST_FTDC_FI_InvestorPosition 'P'
///投资者分项资金数据
#define THOST_FTDC_FI_SubEntryFund 'O'
///组合持仓数据
#define THOST_FTDC_FI_CZCECombinationPos 'C'
///上报保证金监控中心数据
#define THOST_FTDC_FI_CSRCData 'R'
///郑商所平仓了结数据
#define THOST_FTDC_FI_CZCEClose 'L'
///郑商所非平仓了结数据
#define THOST_FTDC_FI_CZCENoClose 'N'
///持仓明细数据
#define THOST_FTDC_FI_PositionDtl 'D'
///期权执行文件
#define THOST_FTDC_FI_OptionStrike 'S'
///结算价比对文件
#define THOST_FTDC_FI_SettlementPriceComparison 'M'
///上期所非持仓变动明细
#define THOST_FTDC_FI_NonTradePosChange 'B'
typedef char TThostFtdcFileIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileNameType是一个文件名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFileNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcFileTypeType是一个文件上传类型类型
/////////////////////////////////////////////////////////////////////////
///结算
#define THOST_FTDC_FUT_Settlement '0'
///核对
#define THOST_FTDC_FUT_Check '1'
typedef char TThostFtdcFileTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileFormatType是一个文件格式类型
/////////////////////////////////////////////////////////////////////////
///文本文件(.txt)
#define THOST_FTDC_FFT_Txt '0'
///压缩文件(.zip)
#define THOST_FTDC_FFT_Zip '1'
///DBF文件(.dbf)
#define THOST_FTDC_FFT_DBF '2'
typedef char TThostFtdcFileFormatType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileUploadStatusType是一个文件状态类型
/////////////////////////////////////////////////////////////////////////
///上传成功
#define THOST_FTDC_FUS_SucceedUpload '1'
///上传失败
#define THOST_FTDC_FUS_FailedUpload '2'
///导入成功
#define THOST_FTDC_FUS_SucceedLoad '3'
///导入部分成功
#define THOST_FTDC_FUS_PartSucceedLoad '4'
///导入失败
#define THOST_FTDC_FUS_FailedLoad '5'
typedef char TThostFtdcFileUploadStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferDirectionType是一个移仓方向类型
/////////////////////////////////////////////////////////////////////////
///移出
#define THOST_FTDC_TD_Out '0'
///移入
#define THOST_FTDC_TD_In '1'
typedef char TThostFtdcTransferDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUploadModeType是一个上传文件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUploadModeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountIDType是一个投资者帐号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAccountIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankFlagType是一个银行统一标识类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankFlagType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountType是一个银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenNameType是一个银行账户的开户人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOpenNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenBankType是一个银行账户的开户行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOpenBankType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankNameType是一个银行名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcPublishPathType是一个发布路径类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPublishPathType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperatorIDType是一个操作员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperatorIDType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthCountType是一个月份数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMonthCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdvanceMonthArrayType是一个月份提前数组类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAdvanceMonthArrayType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcDateExprType是一个日期表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateExprType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDExprType是一个合约代码表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDExprType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentNameExprType是一个合约名称表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentNameExprType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecialCreateRuleType是一个特殊的创建规则类型
/////////////////////////////////////////////////////////////////////////
///没有特殊创建规则
#define THOST_FTDC_SC_NoSpecialRule '0'
///不包含春节
#define THOST_FTDC_SC_NoSpringFestival '1'
typedef char TThostFtdcSpecialCreateRuleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBasisPriceTypeType是一个挂牌基准价类型类型
/////////////////////////////////////////////////////////////////////////
///上一合约结算价
#define THOST_FTDC_IPT_LastSettlement '1'
///上一合约收盘价
#define THOST_FTDC_IPT_LaseClose '2'
typedef char TThostFtdcBasisPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductLifePhaseType是一个产品生命周期状态类型
/////////////////////////////////////////////////////////////////////////
///活跃
#define THOST_FTDC_PLP_Active '1'
///不活跃
#define THOST_FTDC_PLP_NonActive '2'
///注销
#define THOST_FTDC_PLP_Canceled '3'
typedef char TThostFtdcProductLifePhaseType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeliveryModeType是一个交割方式类型
/////////////////////////////////////////////////////////////////////////
///现金交割
#define THOST_FTDC_DM_CashDeliv '1'
///实物交割
#define THOST_FTDC_DM_CommodityDeliv '2'
typedef char TThostFtdcDeliveryModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLogLevelType是一个日志级别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLogLevelType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessNameType是一个存储过程名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperationMemoType是一个操作摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperationMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcFundIOTypeType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///出入金
#define THOST_FTDC_FIOT_FundIO '1'
///银期转帐
#define THOST_FTDC_FIOT_Transfer '2'
///银期换汇
#define THOST_FTDC_FIOT_SwapCurrency '3'
typedef char TThostFtdcFundIOTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundTypeType是一个资金类型类型
/////////////////////////////////////////////////////////////////////////
///银行存款
#define THOST_FTDC_FT_Deposite '1'
///分项资金
#define THOST_FTDC_FT_ItemFund '2'
///公司调整
#define THOST_FTDC_FT_Company '3'
///资金内转
#define THOST_FTDC_FT_InnerTransfer '4'
typedef char TThostFtdcFundTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundDirectionType是一个出入金方向类型
/////////////////////////////////////////////////////////////////////////
///入金
#define THOST_FTDC_FD_In '1'
///出金
#define THOST_FTDC_FD_Out '2'
typedef char TThostFtdcFundDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundStatusType是一个资金状态类型
/////////////////////////////////////////////////////////////////////////
///已录入
#define THOST_FTDC_FS_Record '1'
///已复核
#define THOST_FTDC_FS_Check '2'
///已冲销
#define THOST_FTDC_FS_Charge '3'
typedef char TThostFtdcFundStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillNoType是一个票据号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBillNoType[15];
/////////////////////////////////////////////////////////////////////////
///TFtdcBillNameType是一个票据名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBillNameType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcPublishStatusType是一个发布状态类型
/////////////////////////////////////////////////////////////////////////
///未发布
#define THOST_FTDC_PS_None '1'
///正在发布
#define THOST_FTDC_PS_Publishing '2'
///已发布
#define THOST_FTDC_PS_Published '3'
typedef char TThostFtdcPublishStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueIDType是一个枚举值代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueIDType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueTypeType是一个枚举值类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueLabelType是一个枚举值名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueLabelType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueResultType是一个枚举值结果类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueResultType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemStatusType是一个系统状态类型
/////////////////////////////////////////////////////////////////////////
///不活跃
#define THOST_FTDC_ES_NonActive '1'
///启动
#define THOST_FTDC_ES_Startup '2'
///交易开始初始化
#define THOST_FTDC_ES_Initialize '3'
///交易完成初始化
#define THOST_FTDC_ES_Initialized '4'
///收市开始
#define THOST_FTDC_ES_Close '5'
///收市完成
#define THOST_FTDC_ES_Closed '6'
///结算
#define THOST_FTDC_ES_Settlement '7'
typedef char TThostFtdcSystemStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementStatusType是一个结算状态类型
/////////////////////////////////////////////////////////////////////////
///初始
#define THOST_FTDC_STS_Initialize '0'
///结算中
#define THOST_FTDC_STS_Settlementing '1'
///已结算
#define THOST_FTDC_STS_Settlemented '2'
///结算完成
#define THOST_FTDC_STS_Finished '3'
typedef char TThostFtdcSettlementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntTypeType是一个限定值类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntFromType是一个限定值下限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntFromType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntToType是一个限定值上限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntToType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionIDType是一个功能代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionIDType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionValueCodeType是一个功能编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionValueCodeType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionNameType是一个功能名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcRoleIDType是一个角色编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRoleIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcRoleNameType是一个角色名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRoleNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcDescriptionType是一个描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDescriptionType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombineIDType是一个组合编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombineIDType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombineTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombineTypeType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorTypeType是一个投资者类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CT_Person '0'
///法人
#define THOST_FTDC_CT_Company '1'
///投资基金
#define THOST_FTDC_CT_Fund '2'
///特殊法人
#define THOST_FTDC_CT_SpecialOrgan '3'
///资管户
#define THOST_FTDC_CT_Asset '4'
typedef char TThostFtdcInvestorTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerTypeType是一个经纪公司类型类型
/////////////////////////////////////////////////////////////////////////
///交易会员
#define THOST_FTDC_BT_Trade '0'
///交易结算会员
#define THOST_FTDC_BT_TradeSettle '1'
typedef char TThostFtdcBrokerTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskLevelType是一个风险等级类型
/////////////////////////////////////////////////////////////////////////
///低风险客户
#define THOST_FTDC_FAS_Low '1'
///普通客户
#define THOST_FTDC_FAS_Normal '2'
///关注客户
#define THOST_FTDC_FAS_Focus '3'
///风险客户
#define THOST_FTDC_FAS_Risk '4'
typedef char TThostFtdcRiskLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFeeAcceptStyleType是一个手续费收取方式类型
/////////////////////////////////////////////////////////////////////////
///按交易收取
#define THOST_FTDC_FAS_ByTrade '1'
///按交割收取
#define THOST_FTDC_FAS_ByDeliv '2'
///不收
#define THOST_FTDC_FAS_None '3'
///按指定手续费收取
#define THOST_FTDC_FAS_FixFee '4'
typedef char TThostFtdcFeeAcceptStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordTypeType是一个密码类型类型
/////////////////////////////////////////////////////////////////////////
///交易密码
#define THOST_FTDC_PWDT_Trade '1'
///资金密码
#define THOST_FTDC_PWDT_Account '2'
typedef char TThostFtdcPasswordTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAlgorithmType是一个盈亏算法类型
/////////////////////////////////////////////////////////////////////////
///浮盈浮亏都计算
#define THOST_FTDC_AG_All '1'
///浮盈不计,浮亏计
#define THOST_FTDC_AG_OnlyLost '2'
///浮盈计,浮亏不计
#define THOST_FTDC_AG_OnlyGain '3'
///浮盈浮亏都不计算
#define THOST_FTDC_AG_None '4'
typedef char TThostFtdcAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIncludeCloseProfitType是一个是否包含平仓盈利类型
/////////////////////////////////////////////////////////////////////////
///包含平仓盈利
#define THOST_FTDC_ICP_Include '0'
///不包含平仓盈利
#define THOST_FTDC_ICP_NotInclude '2'
typedef char TThostFtdcIncludeCloseProfitType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAllWithoutTradeType是一个是否受可提比例限制类型
/////////////////////////////////////////////////////////////////////////
///无仓无成交不受可提比例限制
#define THOST_FTDC_AWT_Enable '0'
///受可提比例限制
#define THOST_FTDC_AWT_Disable '2'
///无仓不受可提比例限制
#define THOST_FTDC_AWT_NoHoldEnable '3'
typedef char TThostFtdcAllWithoutTradeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommentType是一个盈亏算法说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommentType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcVersionType是一个版本号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcVersionType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeCodeType是一个交易代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeDateType是一个交易日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeDateType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeTimeType是一个交易时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeTimeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSerialType是一个发起方流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeSerialType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSerialNoType是一个发起方流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradeSerialNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureIDType是一个期货公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankIDType是一个银行代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankBrchIDType是一个银行分中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankBrchIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankBranchIDType是一个分中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankBranchIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperNoType是一个交易柜员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperNoType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcDeviceIDType是一个渠道标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDeviceIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcRecordNumType是一个记录数类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRecordNumType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccountType是一个期货资金账号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccountType[22];
/////////////////////////////////////////////////////////////////////////
///TFtdcFuturePwdFlagType是一个资金密码核对标志类型
/////////////////////////////////////////////////////////////////////////
///不核对
#define THOST_FTDC_FPWD_UnCheck '0'
///核对
#define THOST_FTDC_FPWD_Check '1'
typedef char TThostFtdcFuturePwdFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferTypeType是一个银期转账类型类型
/////////////////////////////////////////////////////////////////////////
///银行转期货
#define THOST_FTDC_TT_BankToFuture '0'
///期货转银行
#define THOST_FTDC_TT_FutureToBank '1'
typedef char TThostFtdcTransferTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccPwdType是一个期货资金密码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccPwdType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyCodeType是一个币种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyCodeType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcRetCodeType是一个响应代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRetCodeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcRetInfoType是一个响应信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRetInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeAmtType是一个银行总余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcUseAmtType是一个银行可用余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUseAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcFetchAmtType是一个银行可取余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFetchAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferValidFlagType是一个转账有效标志类型
/////////////////////////////////////////////////////////////////////////
///无效或失败
#define THOST_FTDC_TVF_Invalid '0'
///有效
#define THOST_FTDC_TVF_Valid '1'
///冲正
#define THOST_FTDC_TVF_Reverse '2'
typedef char TThostFtdcTransferValidFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCertCodeType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCertCodeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcReasonType是一个事由类型
/////////////////////////////////////////////////////////////////////////
///错单
#define THOST_FTDC_RN_CD '0'
///资金在途
#define THOST_FTDC_RN_ZT '1'
///其它
#define THOST_FTDC_RN_QT '2'
typedef char TThostFtdcReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundProjectIDType是一个资金项目编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFundProjectIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcSexType是一个性别类型
/////////////////////////////////////////////////////////////////////////
///未知
#define THOST_FTDC_SEX_None '0'
///男
#define THOST_FTDC_SEX_Man '1'
///女
#define THOST_FTDC_SEX_Woman '2'
typedef char TThostFtdcSexType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProfessionType是一个职业类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProfessionType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcNationalType是一个国籍类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNationalType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcProvinceType是一个省类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProvinceType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcRegionType是一个区类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRegionType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcCountryType是一个国家类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCountryType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcLicenseNOType是一个营业执照类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLicenseNOType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcCompanyTypeType是一个企业性质类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCompanyTypeType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessScopeType是一个经营范围类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessScopeType[1001];
/////////////////////////////////////////////////////////////////////////
///TFtdcCapitalCurrencyType是一个注册资本币种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCapitalCurrencyType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserTypeType是一个用户类型类型
/////////////////////////////////////////////////////////////////////////
///投资者
#define THOST_FTDC_UT_Investor '0'
///操作员
#define THOST_FTDC_UT_Operator '1'
///管理员
#define THOST_FTDC_UT_SuperUser '2'
typedef char TThostFtdcUserTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchIDType是一个营业部编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTypeType是一个费率类型类型
/////////////////////////////////////////////////////////////////////////
///保证金率
#define THOST_FTDC_RATETYPE_MarginRate '2'
typedef char TThostFtdcRateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNoteTypeType是一个通知类型类型
/////////////////////////////////////////////////////////////////////////
///交易结算单
#define THOST_FTDC_NOTETYPE_TradeSettleBill '1'
///交易结算月报
#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2'
///追加保证金通知书
#define THOST_FTDC_NOTETYPE_CallMarginNotes '3'
///强行平仓通知书
#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4'
///成交通知书
#define THOST_FTDC_NOTETYPE_TradeNotes '5'
///交割通知书
#define THOST_FTDC_NOTETYPE_DelivNotes '6'
typedef char TThostFtdcNoteTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementStyleType是一个结算单方式类型
/////////////////////////////////////////////////////////////////////////
///逐日盯市
#define THOST_FTDC_SBS_Day '1'
///逐笔对冲
#define THOST_FTDC_SBS_Volume '2'
typedef char TThostFtdcSettlementStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerDNSType是一个域名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerDNSType[256];
/////////////////////////////////////////////////////////////////////////
///TFtdcSentenceType是一个语句类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSentenceType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementBillTypeType是一个结算单类型类型
/////////////////////////////////////////////////////////////////////////
///日报
#define THOST_FTDC_ST_Day '0'
///月报
#define THOST_FTDC_ST_Month '1'
typedef char TThostFtdcSettlementBillTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserRightTypeType是一个客户权限类型类型
/////////////////////////////////////////////////////////////////////////
///登录
#define THOST_FTDC_URT_Logon '1'
///银期转帐
#define THOST_FTDC_URT_Transfer '2'
///邮寄结算单
#define THOST_FTDC_URT_EMail '3'
///传真结算单
#define THOST_FTDC_URT_Fax '4'
///条件单
#define THOST_FTDC_URT_ConditionOrder '5'
typedef char TThostFtdcUserRightTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginPriceTypeType是一个保证金价格类型类型
/////////////////////////////////////////////////////////////////////////
///昨结算价
#define THOST_FTDC_MPT_PreSettlementPrice '1'
///最新价
#define THOST_FTDC_MPT_SettlementPrice '2'
///成交均价
#define THOST_FTDC_MPT_AveragePrice '3'
///开仓价
#define THOST_FTDC_MPT_OpenPrice '4'
typedef char TThostFtdcMarginPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillGenStatusType是一个结算单生成状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_BGS_None '0'
///生成中
#define THOST_FTDC_BGS_NoGenerated '1'
///已生成
#define THOST_FTDC_BGS_Generated '2'
typedef char TThostFtdcBillGenStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAlgoTypeType是一个算法类型类型
/////////////////////////////////////////////////////////////////////////
///持仓处理算法
#define THOST_FTDC_AT_HandlePositionAlgo '1'
///寻找保证金率算法
#define THOST_FTDC_AT_FindMarginRateAlgo '2'
typedef char TThostFtdcAlgoTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandlePositionAlgoIDType是一个持仓处理算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_HPA_Base '1'
///大连商品交易所
#define THOST_FTDC_HPA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_HPA_CZCE '3'
typedef char TThostFtdcHandlePositionAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFindMarginRateAlgoIDType是一个寻找保证金率算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_FMRA_Base '1'
///大连商品交易所
#define THOST_FTDC_FMRA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_FMRA_CZCE '3'
typedef char TThostFtdcFindMarginRateAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandleTradingAccountAlgoIDType是一个资金处理算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_HTAA_Base '1'
///大连商品交易所
#define THOST_FTDC_HTAA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_HTAA_CZCE '3'
typedef char TThostFtdcHandleTradingAccountAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPersonTypeType是一个联系人类型类型
/////////////////////////////////////////////////////////////////////////
///指定下单人
#define THOST_FTDC_PST_Order '1'
///开户授权人
#define THOST_FTDC_PST_Open '2'
///资金调拨人
#define THOST_FTDC_PST_Fund '3'
///结算单确认人
#define THOST_FTDC_PST_Settlement '4'
///法人
#define THOST_FTDC_PST_Company '5'
///法人代表
#define THOST_FTDC_PST_Corporation '6'
///投资者联系人
#define THOST_FTDC_PST_LinkMan '7'
///分户管理资产负责人
#define THOST_FTDC_PST_Ledger '8'
///托(保)管人
#define THOST_FTDC_PST_Trustee '9'
///托(保)管机构法人代表
#define THOST_FTDC_PST_TrusteeCorporation 'A'
///托(保)管机构开户授权人
#define THOST_FTDC_PST_TrusteeOpen 'B'
///托(保)管机构联系人
#define THOST_FTDC_PST_TrusteeContact 'C'
///境外自然人参考证件
#define THOST_FTDC_PST_ForeignerRefer 'D'
///法人代表参考证件
#define THOST_FTDC_PST_CorporationRefer 'E'
typedef char TThostFtdcPersonTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryInvestorRangeType是一个查询范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_QIR_All '1'
///查询分类
#define THOST_FTDC_QIR_Group '2'
///单一投资者
#define THOST_FTDC_QIR_Single '3'
typedef char TThostFtdcQueryInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorRiskStatusType是一个投资者风险状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_IRS_Normal '1'
///警告
#define THOST_FTDC_IRS_Warn '2'
///追保
#define THOST_FTDC_IRS_Call '3'
///强平
#define THOST_FTDC_IRS_Force '4'
///异常
#define THOST_FTDC_IRS_Exception '5'
typedef char TThostFtdcInvestorRiskStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLegIDType是一个单腿编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLegIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLegMultipleType是一个单腿乘数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLegMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcImplyLevelType是一个派生层数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcImplyLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClearAccountType是一个结算账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearAccountType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganNOType是一个结算账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganNOType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearbarchIDType是一个结算账户联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearbarchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserEventTypeType是一个用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///登录
#define THOST_FTDC_UET_Login '1'
///登出
#define THOST_FTDC_UET_Logout '2'
///CTP校验通过
#define THOST_FTDC_UET_Trading '3'
///CTP校验失败
#define THOST_FTDC_UET_TradingError '4'
///修改密码
#define THOST_FTDC_UET_UpdatePassword '5'
///客户端认证
#define THOST_FTDC_UET_Authenticate '6'
///终端信息上报
#define THOST_FTDC_UET_SubmitSysInfo '7'
///转账
#define THOST_FTDC_UET_Transfer '8'
///其他
#define THOST_FTDC_UET_Other '9'
///修改资金密码
#define THOST_FTDC_UET_UpdateTradingAccountPassword 'a'
typedef char TThostFtdcUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserEventInfoType是一个用户事件信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserEventInfoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcCloseStyleType是一个平仓方式类型
/////////////////////////////////////////////////////////////////////////
///先开先平
#define THOST_FTDC_ICS_Close '0'
///先平今再平昨
#define THOST_FTDC_ICS_CloseToday '1'
typedef char TThostFtdcCloseStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStatModeType是一个统计方式类型
/////////////////////////////////////////////////////////////////////////
///----
#define THOST_FTDC_SM_Non '0'
///按合约统计
#define THOST_FTDC_SM_Instrument '1'
///按产品统计
#define THOST_FTDC_SM_Product '2'
///按投资者统计
#define THOST_FTDC_SM_Investor '3'
typedef char TThostFtdcStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderStatusType是一个预埋单状态类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_PAOS_NotSend '1'
///已发送
#define THOST_FTDC_PAOS_Send '2'
///已删除
#define THOST_FTDC_PAOS_Deleted '3'
typedef char TThostFtdcParkedOrderStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderIDType是一个预埋报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParkedOrderIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderActionIDType是一个预埋撤单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParkedOrderActionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcVirDealStatusType是一个处理状态类型
/////////////////////////////////////////////////////////////////////////
///正在处理
#define THOST_FTDC_VDS_Dealing '1'
///处理成功
#define THOST_FTDC_VDS_DeaclSucceed '2'
typedef char TThostFtdcVirDealStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrgSystemIDType是一个原有系统代码类型
/////////////////////////////////////////////////////////////////////////
///综合交易平台
#define THOST_FTDC_ORGS_Standard '0'
///易盛系统
#define THOST_FTDC_ORGS_ESunny '1'
///金仕达V6系统
#define THOST_FTDC_ORGS_KingStarV6 '2'
typedef char TThostFtdcOrgSystemIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirTradeStatusType是一个交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常处理中
#define THOST_FTDC_VTS_NaturalDeal '0'
///成功结束
#define THOST_FTDC_VTS_SucceedEnd '1'
///失败结束
#define THOST_FTDC_VTS_FailedEND '2'
///异常中
#define THOST_FTDC_VTS_Exception '3'
///已人工异常处理
#define THOST_FTDC_VTS_ManualDeal '4'
///通讯异常 ,请人工处理
#define THOST_FTDC_VTS_MesException '5'
///系统出错,请人工处理
#define THOST_FTDC_VTS_SysException '6'
typedef char TThostFtdcVirTradeStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirBankAccTypeType是一个银行帐户类型类型
/////////////////////////////////////////////////////////////////////////
///存折
#define THOST_FTDC_VBAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_VBAT_BankCard '2'
///信用卡
#define THOST_FTDC_VBAT_CreditCard '3'
typedef char TThostFtdcVirBankAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementStatusType是一个银行帐户类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_VMS_Natural '0'
///销户
#define THOST_FTDC_VMS_Canceled '9'
typedef char TThostFtdcVirementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementAvailAbilityType是一个有效标志类型
/////////////////////////////////////////////////////////////////////////
///未确认
#define THOST_FTDC_VAA_NoAvailAbility '0'
///有效
#define THOST_FTDC_VAA_AvailAbility '1'
///冲正
#define THOST_FTDC_VAA_Repeal '2'
typedef char TThostFtdcVirementAvailAbilityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementTradeCodeType是一个交易代码类型
/////////////////////////////////////////////////////////////////////////
///银行发起银行资金转期货
#define THOST_FTDC_VTC_BankBankToFuture '102001'
///银行发起期货资金转银行
#define THOST_FTDC_VTC_BankFutureToBank '102002'
///期货发起银行资金转期货
#define THOST_FTDC_VTC_FutureBankToFuture '202001'
///期货发起期货资金转银行
#define THOST_FTDC_VTC_FutureFutureToBank '202002'
typedef char TThostFtdcVirementTradeCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoTypeNameType是一个影像类型名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoTypeNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoTypeIDType是一个影像类型代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoTypeIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoNameType是一个影像名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcTopicIDType是一个主题代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTopicIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReportTypeIDType是一个交易报告类型标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReportTypeIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCharacterIDType是一个交易特征代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCharacterIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLParamIDType是一个参数代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLParamIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInvestorTypeType是一个投资者类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInvestorTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLIdCardTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLIdCardTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradeDirectType是一个资金进出方向类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradeDirectType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradeModelType是一个资金进出方式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradeModelType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLOpParamValueType是一个业务参数代码值类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAMLOpParamValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCustomerCardTypeType是一个客户身份证件/证明文件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCustomerCardTypeType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionNameType是一个金融机构网点名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLDistrictIDType是一个金融机构网点所在地区行政区划代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLDistrictIDType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLRelationShipType是一个金融机构网点与大额交易的关系类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLRelationShipType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionTypeType是一个金融机构网点代码类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionIDType是一个金融机构网点代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLAccountTypeType是一个账户类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLAccountTypeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradingTypeType是一个交易方式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradingTypeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTransactClassType是一个涉外收支交易分类与代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTransactClassType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCapitalIOType是一个资金收付标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCapitalIOType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSiteType是一个交易地点类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSiteType[10];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCapitalPurposeType是一个资金用途类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCapitalPurposeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLReportTypeType是一个报文类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLReportTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSerialNoType是一个编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSerialNoType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLStatusType是一个状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLStatusType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLGenStatusType是一个Aml生成方式类型
/////////////////////////////////////////////////////////////////////////
///程序生成
#define THOST_FTDC_GEN_Program '0'
///人工生成
#define THOST_FTDC_GEN_HandWork '1'
typedef char TThostFtdcAMLGenStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSeqCodeType是一个业务标识号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSeqCodeType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLFileNameType是一个AML文件名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLFileNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLMoneyType是一个反洗钱资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAMLMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLFileAmountType是一个反洗钱资金类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcAMLFileAmountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCKeyType是一个密钥类型(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCFMMCKeyType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCTokenType是一个令牌类型(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCFMMCTokenType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCKeyKindType是一个动态密钥类别(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
///主动请求更新
#define THOST_FTDC_CFMMCKK_REQUEST 'R'
///CFMMC自动更新
#define THOST_FTDC_CFMMCKK_AUTO 'A'
///CFMMC手动更新
#define THOST_FTDC_CFMMCKK_MANUAL 'M'
typedef char TThostFtdcCFMMCKeyKindType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLReportNameType是一个报文名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLReportNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcIndividualNameType是一个个人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIndividualNameType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyIDType是一个币种代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcCustNumberType是一个客户编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCustNumberType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganCodeType是一个机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganCodeType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganNameType是一个机构名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcSuperOrganCodeType是一个上级机构编码,即期货公司总部、银行总行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSuperOrganCodeType[12];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubBranchIDType是一个分支机构类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSubBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubBranchNameType是一个分支机构名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSubBranchNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchNetCodeType是一个机构网点号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchNetCodeType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchNetNameType是一个机构网点名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchNetNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganFlagType是一个机构标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankCodingForFutureType是一个银行对期货公司的编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankCodingForFutureType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankReturnCodeType是一个银行对返回码的定义类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankReturnCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcPlateReturnCodeType是一个银期转帐平台对返回码的定义类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPlateReturnCodeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankSubBranchIDType是一个银行分支机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankSubBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureBranchIDType是一个期货分支机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnCodeType是一个返回代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReturnCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperatorCodeType是一个操作员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperatorCodeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearDepIDType是一个机构结算帐户机构号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearDepIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearBrchIDType是一个机构结算帐户联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearBrchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearNameType是一个机构结算帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountNameType是一个银行帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvDepIDType是一个机构投资人账号机构号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvDepIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvBrchIDType是一个机构投资人联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvBrchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcMessageFormatVersionType是一个信息格式版本类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMessageFormatVersionType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcDigestType是一个摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDigestType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthenticDataType是一个认证数据类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthenticDataType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordKeyType是一个密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPasswordKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccountNameType是一个期货帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccountNameType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcMobilePhoneType是一个手机类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMobilePhoneType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureMainKeyType是一个期货公司主密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureMainKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureWorkKeyType是一个期货公司工作密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureWorkKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureTransKeyType是一个期货公司传输密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureTransKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankMainKeyType是一个银行主密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankMainKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankWorkKeyType是一个银行工作密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankWorkKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankTransKeyType是一个银行传输密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankTransKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankServerDescriptionType是一个银行服务器描述信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankServerDescriptionType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddInfoType是一个附加信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcDescrInfoForReturnCodeType是一个返回码描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDescrInfoForReturnCodeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcCountryCodeType是一个国家代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCountryCodeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSerialType是一个流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPlateSerialType是一个平台流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPlateSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankSerialType是一个银行流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankSerialType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCorrectSerialType是一个被冲正交易流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCorrectSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureSerialType是一个期货公司流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFutureSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplicationIDType是一个应用标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcApplicationIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankProxyIDType是一个银行代理标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBankProxyIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTCoreIDType是一个银期转帐核心系统标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBTCoreIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServerPortType是一个服务端口号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServerPortType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRepealedTimesType是一个已经冲正次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRepealedTimesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRepealTimeIntervalType是一个冲正时间间隔类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRepealTimeIntervalType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTotalTimesType是一个每日累计转帐次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTotalTimesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTRequestIDType是一个请求ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBTRequestIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTIDType是一个交易ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeAmountType是一个交易金额(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcTradeAmountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCustFeeType是一个应收客户费用(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCustFeeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureFeeType是一个应收期货公司费用(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcFutureFeeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSingleMaxAmtType是一个单笔最高限额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSingleMaxAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSingleMinAmtType是一个单笔最低限额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSingleMinAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTotalAmtType是一个每日累计转帐额度类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcTotalAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCertificationTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
///身份证
#define THOST_FTDC_CFT_IDCard '0'
///护照
#define THOST_FTDC_CFT_Passport '1'
///军官证
#define THOST_FTDC_CFT_OfficerIDCard '2'
///士兵证
#define THOST_FTDC_CFT_SoldierIDCard '3'
///回乡证
#define THOST_FTDC_CFT_HomeComingCard '4'
///户口簿
#define THOST_FTDC_CFT_HouseholdRegister '5'
///营业执照号
#define THOST_FTDC_CFT_LicenseNo '6'
///组织机构代码证
#define THOST_FTDC_CFT_InstitutionCodeCard '7'
///临时营业执照号
#define THOST_FTDC_CFT_TempLicenseNo '8'
///民办非企业登记证书
#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9'
///其他证件
#define THOST_FTDC_CFT_OtherCard 'x'
///主管部门批文
#define THOST_FTDC_CFT_SuperDepAgree 'a'
typedef char TThostFtdcCertificationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileBusinessCodeType是一个文件业务功能类型
/////////////////////////////////////////////////////////////////////////
///其他
#define THOST_FTDC_FBC_Others '0'
///转账交易明细对账
#define THOST_FTDC_FBC_TransferDetails '1'
///客户账户状态对账
#define THOST_FTDC_FBC_CustAccStatus '2'
///账户类交易明细对账
#define THOST_FTDC_FBC_AccountTradeDetails '3'
///期货账户信息变更明细对账
#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4'
///客户资金台账余额明细对账
#define THOST_FTDC_FBC_CustMoneyDetail '5'
///客户销户结息明细对账
#define THOST_FTDC_FBC_CustCancelAccountInfo '6'
///客户资金余额对账结果
#define THOST_FTDC_FBC_CustMoneyResult '7'
///其它对账异常结果文件
#define THOST_FTDC_FBC_OthersExceptionResult '8'
///客户结息净额明细
#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9'
///客户资金交收明细
#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a'
///法人存管银行资金交收汇总
#define THOST_FTDC_FBC_CorporationMoneyTotal 'b'
///主体间资金交收汇总
#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c'
///总分平衡监管数据
#define THOST_FTDC_FBC_MainPartMonitorData 'd'
///存管银行备付金余额
#define THOST_FTDC_FBC_PreparationMoney 'e'
///协办存管银行资金监管数据
#define THOST_FTDC_FBC_BankMoneyMonitorData 'f'
typedef char TThostFtdcFileBusinessCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCashExchangeCodeType是一个汇钞标志类型
/////////////////////////////////////////////////////////////////////////
///汇
#define THOST_FTDC_CEC_Exchange '1'
///钞
#define THOST_FTDC_CEC_Cash '2'
typedef char TThostFtdcCashExchangeCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcYesNoIndicatorType是一个是或否标识类型
/////////////////////////////////////////////////////////////////////////
///是
#define THOST_FTDC_YNI_Yes '0'
///否
#define THOST_FTDC_YNI_No '1'
typedef char TThostFtdcYesNoIndicatorType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBanlanceTypeType是一个余额类型类型
/////////////////////////////////////////////////////////////////////////
///当前余额
#define THOST_FTDC_BLT_CurrentMoney '0'
///可用余额
#define THOST_FTDC_BLT_UsableMoney '1'
///可取余额
#define THOST_FTDC_BLT_FetchableMoney '2'
///冻结余额
#define THOST_FTDC_BLT_FreezeMoney '3'
typedef char TThostFtdcBanlanceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcGenderType是一个性别类型
/////////////////////////////////////////////////////////////////////////
///未知状态
#define THOST_FTDC_GD_Unknown '0'
///男
#define THOST_FTDC_GD_Male '1'
///女
#define THOST_FTDC_GD_Female '2'
typedef char TThostFtdcGenderType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFeePayFlagType是一个费用支付标志类型
/////////////////////////////////////////////////////////////////////////
///由受益方支付费用
#define THOST_FTDC_FPF_BEN '0'
///由发送方支付费用
#define THOST_FTDC_FPF_OUR '1'
///由发送方支付发起的费用,受益方支付接受的费用
#define THOST_FTDC_FPF_SHA '2'
typedef char TThostFtdcFeePayFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPassWordKeyTypeType是一个密钥类型类型
/////////////////////////////////////////////////////////////////////////
///交换密钥
#define THOST_FTDC_PWKT_ExchangeKey '0'
///密码密钥
#define THOST_FTDC_PWKT_PassWordKey '1'
///MAC密钥
#define THOST_FTDC_PWKT_MACKey '2'
///报文密钥
#define THOST_FTDC_PWKT_MessageKey '3'
typedef char TThostFtdcPassWordKeyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTPassWordTypeType是一个密码类型类型
/////////////////////////////////////////////////////////////////////////
///查询
#define THOST_FTDC_PWT_Query '0'
///取款
#define THOST_FTDC_PWT_Fetch '1'
///转帐
#define THOST_FTDC_PWT_Transfer '2'
///交易
#define THOST_FTDC_PWT_Trade '3'
typedef char TThostFtdcFBTPassWordTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTEncryModeType是一个加密方式类型
/////////////////////////////////////////////////////////////////////////
///不加密
#define THOST_FTDC_EM_NoEncry '0'
///DES
#define THOST_FTDC_EM_DES '1'
///3DES
#define THOST_FTDC_EM_3DES '2'
typedef char TThostFtdcFBTEncryModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankRepealFlagType是一个银行冲正标志类型
/////////////////////////////////////////////////////////////////////////
///银行无需自动冲正
#define THOST_FTDC_BRF_BankNotNeedRepeal '0'
///银行待自动冲正
#define THOST_FTDC_BRF_BankWaitingRepeal '1'
///银行已自动冲正
#define THOST_FTDC_BRF_BankBeenRepealed '2'
typedef char TThostFtdcBankRepealFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerRepealFlagType是一个期商冲正标志类型
/////////////////////////////////////////////////////////////////////////
///期商无需自动冲正
#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0'
///期商待自动冲正
#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1'
///期商已自动冲正
#define THOST_FTDC_BRORF_BrokerBeenRepealed '2'
typedef char TThostFtdcBrokerRepealFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstitutionTypeType是一个机构类别类型
/////////////////////////////////////////////////////////////////////////
///银行
#define THOST_FTDC_TS_Bank '0'
///期商
#define THOST_FTDC_TS_Future '1'
///券商
#define THOST_FTDC_TS_Store '2'
typedef char TThostFtdcInstitutionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLastFragmentType是一个最后分片标志类型
/////////////////////////////////////////////////////////////////////////
///是最后分片
#define THOST_FTDC_LF_Yes '0'
///不是最后分片
#define THOST_FTDC_LF_No '1'
typedef char TThostFtdcLastFragmentType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccStatusType是一个银行账户状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_BAS_Normal '0'
///冻结
#define THOST_FTDC_BAS_Freeze '1'
///挂失
#define THOST_FTDC_BAS_ReportLoss '2'
typedef char TThostFtdcBankAccStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMoneyAccountStatusType是一个资金账户状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_MAS_Normal '0'
///销户
#define THOST_FTDC_MAS_Cancel '1'
typedef char TThostFtdcMoneyAccountStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcManageStatusType是一个存管状态类型
/////////////////////////////////////////////////////////////////////////
///指定存管
#define THOST_FTDC_MSS_Point '0'
///预指定
#define THOST_FTDC_MSS_PrePoint '1'
///撤销指定
#define THOST_FTDC_MSS_CancelPoint '2'
typedef char TThostFtdcManageStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemTypeType是一个应用系统类型类型
/////////////////////////////////////////////////////////////////////////
///银期转帐
#define THOST_FTDC_SYT_FutureBankTransfer '0'
///银证转帐
#define THOST_FTDC_SYT_StockBankTransfer '1'
///第三方存管
#define THOST_FTDC_SYT_TheThirdPartStore '2'
typedef char TThostFtdcSystemTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTxnEndFlagType是一个银期转帐划转结果标志类型
/////////////////////////////////////////////////////////////////////////
///正常处理中
#define THOST_FTDC_TEF_NormalProcessing '0'
///成功结束
#define THOST_FTDC_TEF_Success '1'
///失败结束
#define THOST_FTDC_TEF_Failed '2'
///异常中
#define THOST_FTDC_TEF_Abnormal '3'
///已人工异常处理
#define THOST_FTDC_TEF_ManualProcessedForException '4'
///通讯异常 ,请人工处理
#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5'
///系统出错,请人工处理
#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6'
typedef char TThostFtdcTxnEndFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessStatusType是一个银期转帐服务处理状态类型
/////////////////////////////////////////////////////////////////////////
///未处理
#define THOST_FTDC_PSS_NotProcess '0'
///开始处理
#define THOST_FTDC_PSS_StartProcess '1'
///处理完成
#define THOST_FTDC_PSS_Finished '2'
typedef char TThostFtdcProcessStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCustTypeType是一个客户类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CUSTT_Person '0'
///机构户
#define THOST_FTDC_CUSTT_Institution '1'
typedef char TThostFtdcCustTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTTransferDirectionType是一个银期转帐方向类型
/////////////////////////////////////////////////////////////////////////
///入金,银行转期货
#define THOST_FTDC_FBTTD_FromBankToFuture '1'
///出金,期货转银行
#define THOST_FTDC_FBTTD_FromFutureToBank '2'
typedef char TThostFtdcFBTTransferDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenOrDestroyType是一个开销户类别类型
/////////////////////////////////////////////////////////////////////////
///开户
#define THOST_FTDC_OOD_Open '1'
///销户
#define THOST_FTDC_OOD_Destroy '0'
typedef char TThostFtdcOpenOrDestroyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAvailabilityFlagType是一个有效标志类型
/////////////////////////////////////////////////////////////////////////
///未确认
#define THOST_FTDC_AVAF_Invalid '0'
///有效
#define THOST_FTDC_AVAF_Valid '1'
///冲正
#define THOST_FTDC_AVAF_Repeal '2'
typedef char TThostFtdcAvailabilityFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
///银行代理
#define THOST_FTDC_OT_Bank '1'
///交易前置
#define THOST_FTDC_OT_Future '2'
///银期转帐平台管理
#define THOST_FTDC_OT_PlateForm '9'
typedef char TThostFtdcOrganTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganLevelType是一个机构级别类型
/////////////////////////////////////////////////////////////////////////
///银行总行或期商总部
#define THOST_FTDC_OL_HeadQuarters '1'
///银行分中心或期货公司营业部
#define THOST_FTDC_OL_Branch '2'
typedef char TThostFtdcOrganLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProtocalIDType是一个协议类型类型
/////////////////////////////////////////////////////////////////////////
///期商协议
#define THOST_FTDC_PID_FutureProtocal '0'
///工行协议
#define THOST_FTDC_PID_ICBCProtocal '1'
///农行协议
#define THOST_FTDC_PID_ABCProtocal '2'
///中国银行协议
#define THOST_FTDC_PID_CBCProtocal '3'
///建行协议
#define THOST_FTDC_PID_CCBProtocal '4'
///交行协议
#define THOST_FTDC_PID_BOCOMProtocal '5'
///银期转帐平台协议
#define THOST_FTDC_PID_FBTPlateFormProtocal 'X'
typedef char TThostFtdcProtocalIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcConnectModeType是一个套接字连接方式类型
/////////////////////////////////////////////////////////////////////////
///短连接
#define THOST_FTDC_CM_ShortConnect '0'
///长连接
#define THOST_FTDC_CM_LongConnect '1'
typedef char TThostFtdcConnectModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncModeType是一个套接字通信方式类型
/////////////////////////////////////////////////////////////////////////
///异步
#define THOST_FTDC_SRM_ASync '0'
///同步
#define THOST_FTDC_SRM_Sync '1'
typedef char TThostFtdcSyncModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccTypeType是一个银行帐号类型类型
/////////////////////////////////////////////////////////////////////////
///银行存折
#define THOST_FTDC_BAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_BAT_SavingCard '2'
///信用卡
#define THOST_FTDC_BAT_CreditCard '3'
typedef char TThostFtdcBankAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccTypeType是一个期货公司帐号类型类型
/////////////////////////////////////////////////////////////////////////
///银行存折
#define THOST_FTDC_FAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_FAT_SavingCard '2'
///信用卡
#define THOST_FTDC_FAT_CreditCard '3'
typedef char TThostFtdcFutureAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganStatusType是一个接入机构状态类型
/////////////////////////////////////////////////////////////////////////
///启用
#define THOST_FTDC_OS_Ready '0'
///签到
#define THOST_FTDC_OS_CheckIn '1'
///签退
#define THOST_FTDC_OS_CheckOut '2'
///对帐文件到达
#define THOST_FTDC_OS_CheckFileArrived '3'
///对帐
#define THOST_FTDC_OS_CheckDetail '4'
///日终清理
#define THOST_FTDC_OS_DayEndClean '5'
///注销
#define THOST_FTDC_OS_Invalid '9'
typedef char TThostFtdcOrganStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCCBFeeModeType是一个建行收费模式类型
/////////////////////////////////////////////////////////////////////////
///按金额扣收
#define THOST_FTDC_CCBFM_ByAmount '1'
///按月扣收
#define THOST_FTDC_CCBFM_ByMonth '2'
typedef char TThostFtdcCCBFeeModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommApiTypeType是一个通讯API类型类型
/////////////////////////////////////////////////////////////////////////
///客户端
#define THOST_FTDC_CAPIT_Client '1'
///服务端
#define THOST_FTDC_CAPIT_Server '2'
///交易系统的UserApi
#define THOST_FTDC_CAPIT_UserApi '3'
typedef char TThostFtdcCommApiTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceIDType是一个服务编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServiceIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceLineNoType是一个服务线路编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServiceLineNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceNameType是一个服务名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcServiceNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcLinkStatusType是一个连接状态类型
/////////////////////////////////////////////////////////////////////////
///已经连接
#define THOST_FTDC_LS_Connected '1'
///没有连接
#define THOST_FTDC_LS_Disconnected '2'
typedef char TThostFtdcLinkStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommApiPointerType是一个通讯API指针类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommApiPointerType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPwdFlagType是一个密码核对标志类型
/////////////////////////////////////////////////////////////////////////
///不核对
#define THOST_FTDC_BPWDF_NoCheck '0'
///明文核对
#define THOST_FTDC_BPWDF_BlankCheck '1'
///密文核对
#define THOST_FTDC_BPWDF_EncryptCheck '2'
typedef char TThostFtdcPwdFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSecuAccTypeType是一个期货帐号类型类型
/////////////////////////////////////////////////////////////////////////
///资金帐号
#define THOST_FTDC_SAT_AccountID '1'
///资金卡号
#define THOST_FTDC_SAT_CardID '2'
///上海股东帐号
#define THOST_FTDC_SAT_SHStockholderID '3'
///深圳股东帐号
#define THOST_FTDC_SAT_SZStockholderID '4'
typedef char TThostFtdcSecuAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferStatusType是一个转账交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_TRFS_Normal '0'
///被冲正
#define THOST_FTDC_TRFS_Repealed '1'
typedef char TThostFtdcTransferStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSponsorTypeType是一个发起方类型
/////////////////////////////////////////////////////////////////////////
///期商
#define THOST_FTDC_SPTYPE_Broker '0'
///银行
#define THOST_FTDC_SPTYPE_Bank '1'
typedef char TThostFtdcSponsorTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReqRspTypeType是一个请求响应类别类型
/////////////////////////////////////////////////////////////////////////
///请求
#define THOST_FTDC_REQRSP_Request '0'
///响应
#define THOST_FTDC_REQRSP_Response '1'
typedef char TThostFtdcReqRspTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTUserEventTypeType是一个银期转帐用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///签到
#define THOST_FTDC_FBTUET_SignIn '0'
///银行转期货
#define THOST_FTDC_FBTUET_FromBankToFuture '1'
///期货转银行
#define THOST_FTDC_FBTUET_FromFutureToBank '2'
///开户
#define THOST_FTDC_FBTUET_OpenAccount '3'
///销户
#define THOST_FTDC_FBTUET_CancelAccount '4'
///变更银行账户
#define THOST_FTDC_FBTUET_ChangeAccount '5'
///冲正银行转期货
#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6'
///冲正期货转银行
#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7'
///查询银行账户
#define THOST_FTDC_FBTUET_QueryBankAccount '8'
///查询期货账户
#define THOST_FTDC_FBTUET_QueryFutureAccount '9'
///签退
#define THOST_FTDC_FBTUET_SignOut 'A'
///密钥同步
#define THOST_FTDC_FBTUET_SyncKey 'B'
///预约开户
#define THOST_FTDC_FBTUET_ReserveOpenAccount 'C'
///撤销预约开户
#define THOST_FTDC_FBTUET_CancelReserveOpenAccount 'D'
///预约开户确认
#define THOST_FTDC_FBTUET_ReserveOpenAccountConfirm 'E'
///其他
#define THOST_FTDC_FBTUET_Other 'Z'
typedef char TThostFtdcFBTUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankIDByBankType是一个银行自己的编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankIDByBankType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankOperNoType是一个银行操作员号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankOperNoType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankCustNoType是一个银行客户号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankCustNoType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBOPSeqNoType是一个递增的序列号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDBOPSeqNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTableNameType是一个FBT表名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTableNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcPKNameType是一个FBT表操作主键名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPKNameType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcPKValueType是一个FBT表操作主键值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPKValueType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBOperationType是一个记录操作类型类型
/////////////////////////////////////////////////////////////////////////
///插入
#define THOST_FTDC_DBOP_Insert '0'
///更新
#define THOST_FTDC_DBOP_Update '1'
///删除
#define THOST_FTDC_DBOP_Delete '2'
typedef char TThostFtdcDBOperationType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncFlagType是一个同步标记类型
/////////////////////////////////////////////////////////////////////////
///已同步
#define THOST_FTDC_SYNF_Yes '0'
///未同步
#define THOST_FTDC_SYNF_No '1'
typedef char TThostFtdcSyncFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTargetIDType是一个同步目标编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTargetIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncTypeType是一个同步类型类型
/////////////////////////////////////////////////////////////////////////
///一次同步
#define THOST_FTDC_SYNT_OneOffSync '0'
///定时同步
#define THOST_FTDC_SYNT_TimerSync '1'
///定时完全同步
#define THOST_FTDC_SYNT_TimerFullSync '2'
typedef char TThostFtdcSyncTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBETimeType是一个各种换汇时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBETimeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankNoType是一个换汇银行行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBECertNoType是一个换汇凭证号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBECertNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcExDirectionType是一个换汇方向类型
/////////////////////////////////////////////////////////////////////////
///结汇
#define THOST_FTDC_FBEDIR_Settlement '0'
///售汇
#define THOST_FTDC_FBEDIR_Sale '1'
typedef char TThostFtdcExDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankAccountType是一个换汇银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankAccountType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankAccountNameType是一个换汇银行账户名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankAccountNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEAmtType是一个各种换汇金额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcFBEAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBusinessTypeType是一个换汇业务类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBusinessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEPostScriptType是一个换汇附言类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEPostScriptType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBERemarkType是一个换汇备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBERemarkType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcExRateType是一个换汇汇率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcExRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEResultFlagType是一个换汇成功标志类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_FBERES_Success '0'
///账户余额不足
#define THOST_FTDC_FBERES_InsufficientBalance '1'
///交易结果未知
#define THOST_FTDC_FBERES_UnknownTrading '8'
///失败
#define THOST_FTDC_FBERES_Fail 'x'
typedef char TThostFtdcFBEResultFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBERtnMsgType是一个换汇返回信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBERtnMsgType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEExtendMsgType是一个换汇扩展信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEExtendMsgType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBusinessSerialType是一个换汇记账流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBusinessSerialType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBESystemSerialType是一个换汇流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBESystemSerialType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBETotalExCntType是一个换汇交易总笔数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBETotalExCntType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEExchStatusType是一个换汇交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_FBEES_Normal '0'
///交易重发
#define THOST_FTDC_FBEES_ReExchange '1'
typedef char TThostFtdcFBEExchStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEFileFlagType是一个换汇文件标志类型
/////////////////////////////////////////////////////////////////////////
///数据包
#define THOST_FTDC_FBEFG_DataPackage '0'
///文件
#define THOST_FTDC_FBEFG_File '1'
typedef char TThostFtdcFBEFileFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEAlreadyTradeType是一个换汇已交易标志类型
/////////////////////////////////////////////////////////////////////////
///未交易
#define THOST_FTDC_FBEAT_NotTrade '0'
///已交易
#define THOST_FTDC_FBEAT_Trade '1'
typedef char TThostFtdcFBEAlreadyTradeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEOpenBankType是一个换汇账户开户行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEOpenBankType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEUserEventTypeType是一个银期换汇用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///签到
#define THOST_FTDC_FBEUET_SignIn '0'
///换汇
#define THOST_FTDC_FBEUET_Exchange '1'
///换汇重发
#define THOST_FTDC_FBEUET_ReExchange '2'
///银行账户查询
#define THOST_FTDC_FBEUET_QueryBankAccount '3'
///换汇明细查询
#define THOST_FTDC_FBEUET_QueryExchDetial '4'
///换汇汇总查询
#define THOST_FTDC_FBEUET_QueryExchSummary '5'
///换汇汇率查询
#define THOST_FTDC_FBEUET_QueryExchRate '6'
///对账文件通知
#define THOST_FTDC_FBEUET_CheckBankAccount '7'
///签退
#define THOST_FTDC_FBEUET_SignOut '8'
///其他
#define THOST_FTDC_FBEUET_Other 'Z'
typedef char TThostFtdcFBEUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEFileNameType是一个换汇相关文件名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEFileNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBatchSerialType是一个换汇批次号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBatchSerialType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEReqFlagType是一个换汇发送标志类型
/////////////////////////////////////////////////////////////////////////
///未处理
#define THOST_FTDC_FBERF_UnProcessed '0'
///等待发送
#define THOST_FTDC_FBERF_WaitSend '1'
///发送成功
#define THOST_FTDC_FBERF_SendSuccess '2'
///发送失败
#define THOST_FTDC_FBERF_SendFailed '3'
///等待重发
#define THOST_FTDC_FBERF_WaitReSend '4'
typedef char TThostFtdcFBEReqFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNotifyClassType是一个风险通知类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_NC_NOERROR '0'
///警示
#define THOST_FTDC_NC_Warn '1'
///追保
#define THOST_FTDC_NC_Call '2'
///强平
#define THOST_FTDC_NC_Force '3'
///穿仓
#define THOST_FTDC_NC_CHUANCANG '4'
///异常
#define THOST_FTDC_NC_Exception '5'
typedef char TThostFtdcNotifyClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNofityInfoType是一个客户风险通知消息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRiskNofityInfoType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseSceneIdType是一个强平场景编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcForceCloseSceneIdType[24];
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseTypeType是一个强平单类型类型
/////////////////////////////////////////////////////////////////////////
///手工强平
#define THOST_FTDC_FCT_Manual '0'
///单一投资者辅助强平
#define THOST_FTDC_FCT_Single '1'
///批量投资者辅助强平
#define THOST_FTDC_FCT_Group '2'
typedef char TThostFtdcForceCloseTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDsType是一个多个产品代码,用+分隔,如cu+zn类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDsType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNotifyMethodType是一个风险通知途径类型
/////////////////////////////////////////////////////////////////////////
///系统通知
#define THOST_FTDC_RNM_System '0'
///短信通知
#define THOST_FTDC_RNM_SMS '1'
///邮件通知
#define THOST_FTDC_RNM_EMail '2'
///人工通知
#define THOST_FTDC_RNM_Manual '3'
typedef char TThostFtdcRiskNotifyMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNotifyStatusType是一个风险通知状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_RNS_NotGen '0'
///已生成未发送
#define THOST_FTDC_RNS_Generated '1'
///发送失败
#define THOST_FTDC_RNS_SendError '2'
///已发送未接收
#define THOST_FTDC_RNS_SendOk '3'
///已接收未确认
#define THOST_FTDC_RNS_Received '4'
///已确认
#define THOST_FTDC_RNS_Confirmed '5'
typedef char TThostFtdcRiskNotifyStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskUserEventType是一个风控用户操作事件类型
/////////////////////////////////////////////////////////////////////////
///导出数据
#define THOST_FTDC_RUE_ExportData '0'
typedef char TThostFtdcRiskUserEventType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParamIDType是一个参数代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParamNameType是一个参数名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParamNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcParamValueType是一个参数值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParamValueType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcConditionalOrderSortTypeType是一个条件单索引条件类型
/////////////////////////////////////////////////////////////////////////
///使用最新价升序
#define THOST_FTDC_COST_LastPriceAsc '0'
///使用最新价降序
#define THOST_FTDC_COST_LastPriceDesc '1'
///使用卖价升序
#define THOST_FTDC_COST_AskPriceAsc '2'
///使用卖价降序
#define THOST_FTDC_COST_AskPriceDesc '3'
///使用买价升序
#define THOST_FTDC_COST_BidPriceAsc '4'
///使用买价降序
#define THOST_FTDC_COST_BidPriceDesc '5'
typedef char TThostFtdcConditionalOrderSortTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSendTypeType是一个报送状态类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_UOAST_NoSend '0'
///已发送
#define THOST_FTDC_UOAST_Sended '1'
///已生成
#define THOST_FTDC_UOAST_Generated '2'
///报送失败
#define THOST_FTDC_UOAST_SendFail '3'
///接收成功
#define THOST_FTDC_UOAST_Success '4'
///接收失败
#define THOST_FTDC_UOAST_Fail '5'
///取消报送
#define THOST_FTDC_UOAST_Cancel '6'
typedef char TThostFtdcSendTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDStatusType是一个交易编码状态类型
/////////////////////////////////////////////////////////////////////////
///未申请
#define THOST_FTDC_UOACS_NoApply '1'
///已提交申请
#define THOST_FTDC_UOACS_Submited '2'
///已发送申请
#define THOST_FTDC_UOACS_Sended '3'
///完成
#define THOST_FTDC_UOACS_Success '4'
///拒绝
#define THOST_FTDC_UOACS_Refuse '5'
///已撤销编码
#define THOST_FTDC_UOACS_Cancel '6'
typedef char TThostFtdcClientIDStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIndustryIDType是一个行业编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIndustryIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionIDType是一个特有信息编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcQuestionIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionContentType是一个特有信息说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcQuestionContentType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionIDType是一个选项编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOptionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionContentType是一个选项说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOptionContentType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionTypeType是一个特有信息类型类型
/////////////////////////////////////////////////////////////////////////
///单选
#define THOST_FTDC_QT_Radio '1'
///多选
#define THOST_FTDC_QT_Option '2'
///填空
#define THOST_FTDC_QT_Blank '3'
typedef char TThostFtdcQuestionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessIDType是一个业务流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSeqNoType是一个流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSeqNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAProcessStatusType是一个流程状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAProcessStatusType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessTypeType是一个流程功能类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessTypeType是一个业务类型类型
/////////////////////////////////////////////////////////////////////////
///请求
#define THOST_FTDC_BT_Request '1'
///应答
#define THOST_FTDC_BT_Response '2'
///通知
#define THOST_FTDC_BT_Notice '3'
typedef char TThostFtdcBusinessTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCfmmcReturnCodeType是一个监控中心返回码类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_CRC_Success '0'
///该客户已经有流程在处理中
#define THOST_FTDC_CRC_Working '1'
///监控中客户资料检查失败
#define THOST_FTDC_CRC_InfoFail '2'
///监控中实名制检查失败
#define THOST_FTDC_CRC_IDCardFail '3'
///其他错误
#define THOST_FTDC_CRC_OtherFail '4'
typedef char TThostFtdcCfmmcReturnCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExReturnCodeType是一个交易所返回码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcExReturnCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientTypeType是一个客户类型类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_CfMMCCT_All '0'
///个人
#define THOST_FTDC_CfMMCCT_Person '1'
///单位
#define THOST_FTDC_CfMMCCT_Company '2'
///其他
#define THOST_FTDC_CfMMCCT_Other '3'
///特殊法人
#define THOST_FTDC_CfMMCCT_SpecialOrgan '4'
///资管户
#define THOST_FTDC_CfMMCCT_Asset '5'
typedef char TThostFtdcClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeIDTypeType是一个交易所编号类型
/////////////////////////////////////////////////////////////////////////
///上海期货交易所
#define THOST_FTDC_EIDT_SHFE 'S'
///郑州商品交易所
#define THOST_FTDC_EIDT_CZCE 'Z'
///大连商品交易所
#define THOST_FTDC_EIDT_DCE 'D'
///中国金融期货交易所
#define THOST_FTDC_EIDT_CFFEX 'J'
///上海国际能源交易中心股份有限公司
#define THOST_FTDC_EIDT_INE 'N'
typedef char TThostFtdcExchangeIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExClientIDTypeType是一个交易编码类型类型
/////////////////////////////////////////////////////////////////////////
///套保
#define THOST_FTDC_ECIDT_Hedge '1'
///套利
#define THOST_FTDC_ECIDT_Arbitrage '2'
///投机
#define THOST_FTDC_ECIDT_Speculation '3'
typedef char TThostFtdcExClientIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientClassifyType是一个客户分类码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientClassifyType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAOrganTypeType是一个单位性质类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAOrganTypeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOACountryCodeType是一个国家代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOACountryCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcAreaCodeType是一个区号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAreaCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcFuturesIDType是一个监控中心为客户分配的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFuturesIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffmcDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffmcDateType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffmcTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffmcTimeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcNocIDType是一个组织机构代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNocIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcUpdateFlagType是一个更新状态类型
/////////////////////////////////////////////////////////////////////////
///未更新
#define THOST_FTDC_UF_NoUpdate '0'
///更新全部信息成功
#define THOST_FTDC_UF_Success '1'
///更新全部信息失败
#define THOST_FTDC_UF_Fail '2'
///更新交易编码成功
#define THOST_FTDC_UF_TCSuccess '3'
///更新交易编码失败
#define THOST_FTDC_UF_TCFail '4'
///已丢弃
#define THOST_FTDC_UF_Cancel '5'
typedef char TThostFtdcUpdateFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyOperateIDType是一个申请动作类型
/////////////////////////////////////////////////////////////////////////
///开户
#define THOST_FTDC_AOID_OpenInvestor '1'
///修改身份信息
#define THOST_FTDC_AOID_ModifyIDCard '2'
///修改一般信息
#define THOST_FTDC_AOID_ModifyNoIDCard '3'
///申请交易编码
#define THOST_FTDC_AOID_ApplyTradingCode '4'
///撤销交易编码
#define THOST_FTDC_AOID_CancelTradingCode '5'
///销户
#define THOST_FTDC_AOID_CancelInvestor '6'
///账户休眠
#define THOST_FTDC_AOID_FreezeAccount '8'
///激活休眠账户
#define THOST_FTDC_AOID_ActiveFreezeAccount '9'
typedef char TThostFtdcApplyOperateIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyStatusIDType是一个申请状态类型
/////////////////////////////////////////////////////////////////////////
///未补全
#define THOST_FTDC_ASID_NoComplete '1'
///已提交
#define THOST_FTDC_ASID_Submited '2'
///已审核
#define THOST_FTDC_ASID_Checked '3'
///已拒绝
#define THOST_FTDC_ASID_Refused '4'
///已删除
#define THOST_FTDC_ASID_Deleted '5'
typedef char TThostFtdcApplyStatusIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSendMethodType是一个发送方式类型
/////////////////////////////////////////////////////////////////////////
///文件发送
#define THOST_FTDC_UOASM_ByAPI '1'
///电子发送
#define THOST_FTDC_UOASM_ByFile '2'
typedef char TThostFtdcSendMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEventTypeType是一个业务操作类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEventTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcEventModeType是一个操作方法类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_EvM_ADD '1'
///修改
#define THOST_FTDC_EvM_UPDATE '2'
///删除
#define THOST_FTDC_EvM_DELETE '3'
///复核
#define THOST_FTDC_EvM_CHECK '4'
///复制
#define THOST_FTDC_EvM_COPY '5'
///注销
#define THOST_FTDC_EvM_CANCEL '6'
///冲销
#define THOST_FTDC_EvM_Reverse '7'
typedef char TThostFtdcEventModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAAutoSendType是一个统一开户申请自动发送类型
/////////////////////////////////////////////////////////////////////////
///自动发送并接收
#define THOST_FTDC_UOAA_ASR '1'
///自动发送,不自动接收
#define THOST_FTDC_UOAA_ASNR '2'
///不自动发送,自动接收
#define THOST_FTDC_UOAA_NSAR '3'
///不自动发送,也不自动接收
#define THOST_FTDC_UOAA_NSR '4'
typedef char TThostFtdcUOAAutoSendType;
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryDepthType是一个查询深度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcQueryDepthType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataCenterIDType是一个数据中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDataCenterIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFlowIDType是一个流程ID类型
/////////////////////////////////////////////////////////////////////////
///投资者对应投资者组设置
#define THOST_FTDC_EvM_InvestorGroupFlow '1'
///投资者手续费率设置
#define THOST_FTDC_EvM_InvestorRate '2'
///投资者手续费率模板关系设置
#define THOST_FTDC_EvM_InvestorCommRateModel '3'
typedef char TThostFtdcFlowIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckLevelType是一个复核级别类型
/////////////////////////////////////////////////////////////////////////
///零级复核
#define THOST_FTDC_CL_Zero '0'
///一级复核
#define THOST_FTDC_CL_One '1'
///二级复核
#define THOST_FTDC_CL_Two '2'
typedef char TThostFtdcCheckLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckNoType是一个操作次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCheckNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckStatusType是一个复核级别类型
/////////////////////////////////////////////////////////////////////////
///未复核
#define THOST_FTDC_CHS_Init '0'
///复核中
#define THOST_FTDC_CHS_Checking '1'
///已复核
#define THOST_FTDC_CHS_Checked '2'
///拒绝
#define THOST_FTDC_CHS_Refuse '3'
///作废
#define THOST_FTDC_CHS_Cancel '4'
typedef char TThostFtdcCheckStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUsedStatusType是一个生效状态类型
/////////////////////////////////////////////////////////////////////////
///未生效
#define THOST_FTDC_CHU_Unused '0'
///已生效
#define THOST_FTDC_CHU_Used '1'
///生效失败
#define THOST_FTDC_CHU_Fail '2'
typedef char TThostFtdcUsedStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTemplateNameType是一个模型名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRateTemplateNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyStringType是一个用于查询的投资属性字段类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyStringType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAcountOriginType是一个账户来源类型
/////////////////////////////////////////////////////////////////////////
///手工录入
#define THOST_FTDC_BAO_ByAccProperty '0'
///银期转账
#define THOST_FTDC_BAO_ByFBTransfer '1'
typedef char TThostFtdcBankAcountOriginType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthBillTradeSumType是一个结算单月报成交汇总方式类型
/////////////////////////////////////////////////////////////////////////
///同日同合约
#define THOST_FTDC_MBTS_ByInstrument '0'
///同日同合约同价格
#define THOST_FTDC_MBTS_ByDayInsPrc '1'
///同合约
#define THOST_FTDC_MBTS_ByDayIns '2'
typedef char TThostFtdcMonthBillTradeSumType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTTradeCodeEnumType是一个银期交易代码枚举类型
/////////////////////////////////////////////////////////////////////////
///银行发起银行转期货
#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001'
///期货发起银行转期货
#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001'
///银行发起期货转银行
#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002'
///期货发起期货转银行
#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002'
typedef char TThostFtdcFBTTradeCodeEnumType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTemplateIDType是一个模型代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRateTemplateIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskRateType是一个风险度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRiskRateType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcTimestampType是一个时间戳类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTimestampType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDRuleNameType是一个号段规则名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDRuleNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDRuleExprType是一个号段规则表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDRuleExprType[513];
/////////////////////////////////////////////////////////////////////////
///TFtdcLastDriftType是一个上次OTP漂移值类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLastDriftType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLastSuccessType是一个上次OTP成功值类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLastSuccessType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthKeyType是一个令牌密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthKeyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSerialNumberType是一个序列号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSerialNumberType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPTypeType是一个动态令牌类型类型
/////////////////////////////////////////////////////////////////////////
///无动态令牌
#define THOST_FTDC_OTP_NONE '0'
///时间令牌
#define THOST_FTDC_OTP_TOTP '1'
typedef char TThostFtdcOTPTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPVendorsIDType是一个动态令牌提供商类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTPVendorsIDType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPVendorsNameType是一个动态令牌提供商名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTPVendorsNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPStatusType是一个动态令牌状态类型
/////////////////////////////////////////////////////////////////////////
///未使用
#define THOST_FTDC_OTPS_Unused '0'
///已使用
#define THOST_FTDC_OTPS_Used '1'
///注销
#define THOST_FTDC_OTPS_Disuse '2'
typedef char TThostFtdcOTPStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerUserTypeType是一个经济公司用户类型类型
/////////////////////////////////////////////////////////////////////////
///投资者
#define THOST_FTDC_BUT_Investor '1'
///操作员
#define THOST_FTDC_BUT_BrokerUser '2'
typedef char TThostFtdcBrokerUserTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureTypeType是一个期货类型类型
/////////////////////////////////////////////////////////////////////////
///商品期货
#define THOST_FTDC_FUTT_Commodity '1'
///金融期货
#define THOST_FTDC_FUTT_Financial '2'
typedef char TThostFtdcFutureTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundEventTypeType是一个资金管理操作类型类型
/////////////////////////////////////////////////////////////////////////
///转账限额
#define THOST_FTDC_FET_Restriction '0'
///当日转账限额
#define THOST_FTDC_FET_TodayRestriction '1'
///期商流水
#define THOST_FTDC_FET_Transfer '2'
///资金冻结
#define THOST_FTDC_FET_Credit '3'
///投资者可提资金比例
#define THOST_FTDC_FET_InvestorWithdrawAlm '4'
///单个银行帐户转账限额
#define THOST_FTDC_FET_BankRestriction '5'
///银期签约账户
#define THOST_FTDC_FET_Accountregister '6'
///交易所出入金
#define THOST_FTDC_FET_ExchangeFundIO '7'
///投资者出入金
#define THOST_FTDC_FET_InvestorFundIO '8'
typedef char TThostFtdcFundEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountSourceTypeType是一个资金账户来源类型
/////////////////////////////////////////////////////////////////////////
///银期同步
#define THOST_FTDC_AST_FBTransfer '0'
///手工录入
#define THOST_FTDC_AST_ManualEntry '1'
typedef char TThostFtdcAccountSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCodeSourceTypeType是一个交易编码来源类型
/////////////////////////////////////////////////////////////////////////
///统一开户(已规范)
#define THOST_FTDC_CST_UnifyAccount '0'
///手工录入(未规范)
#define THOST_FTDC_CST_ManualEntry '1'
typedef char TThostFtdcCodeSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserRangeType是一个操作员范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_UR_All '0'
///单一操作员
#define THOST_FTDC_UR_Single '1'
typedef char TThostFtdcUserRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeSpanType是一个时间跨度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTimeSpanType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcImportSequenceIDType是一个动态令牌导入批次编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcImportSequenceIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcByGroupType是一个交易统计表按客户统计方式类型
/////////////////////////////////////////////////////////////////////////
///按投资者统计
#define THOST_FTDC_BG_Investor '2'
///按类统计
#define THOST_FTDC_BG_Group '1'
typedef char TThostFtdcByGroupType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSumStatModeType是一个交易统计表按范围统计方式类型
/////////////////////////////////////////////////////////////////////////
///按合约统计
#define THOST_FTDC_TSSM_Instrument '1'
///按产品统计
#define THOST_FTDC_TSSM_Product '2'
///按交易所统计
#define THOST_FTDC_TSSM_Exchange '3'
typedef char TThostFtdcTradeSumStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcComTypeType是一个组合成交类型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcComTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductIDType是一个产品标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductNameType是一个产品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductMemoType是一个产品说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductMemoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCCancelFlagType是一个新增或变更标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCCancelFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCDateType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCInvestorNameType是一个客户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCInvestorNameType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOpenInvestorNameType是一个客户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOpenInvestorNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCInvestorIDType是一个客户代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCInvestorIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCIdentifiedCardNoType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCIdentifiedCardNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCClientIDType是一个交易编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCClientIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCBankFlagType是一个银行标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCBankFlagType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCBankAccountType是一个银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCBankAccountType[23];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOpenNameType是一个开户人类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOpenNameType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMemoType是一个说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMemoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTimeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTradeIDType是一个成交流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTradeIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCExchangeInstIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCExchangeInstIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMortgageNameType是一个质押品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMortgageNameType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCReasonType是一个事由类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCReasonType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcIsSettlementType是一个是否为非结算会员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIsSettlementType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCPriceType是一个价格类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCPriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOptionsTypeType是一个期权类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOptionsTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCStrikePriceType是一个执行价类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCStrikePriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTargetProductIDType是一个标的品种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTargetProductIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTargetInstrIDType是一个标的合约类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTargetInstrIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommModelNameType是一个手续费率模板名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommModelNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommModelMemoType是一个手续费率模板备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommModelMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcExprSetModeType是一个日期表达式设置类型类型
/////////////////////////////////////////////////////////////////////////
///相对已有规则设置
#define THOST_FTDC_ESM_Relative '1'
///典型设置
#define THOST_FTDC_ESM_Typical '2'
typedef char TThostFtdcExprSetModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///公司标准
#define THOST_FTDC_RIR_All '1'
///模板
#define THOST_FTDC_RIR_Model '2'
///单一投资者
#define THOST_FTDC_RIR_Single '3'
typedef char TThostFtdcRateInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentBrokerIDType是一个代理经纪公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentBrokerIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcDRIdentityIDType是一个交易中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDRIdentityIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDRIdentityNameType是一个交易中心名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDRIdentityNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBLinkIDType是一个DBLink标识号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDBLinkIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDataStatusType是一个主次用系统数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///未同步
#define THOST_FTDC_SDS_Initialize '0'
///同步中
#define THOST_FTDC_SDS_Settlementing '1'
///已同步
#define THOST_FTDC_SDS_Settlemented '2'
typedef char TThostFtdcSyncDataStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSourceType是一个成交来源类型
/////////////////////////////////////////////////////////////////////////
///来自交易所普通回报
#define THOST_FTDC_TSRC_NORMAL '0'
///来自查询
#define THOST_FTDC_TSRC_QUERY '1'
typedef char TThostFtdcTradeSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFlexStatModeType是一个产品合约统计方式类型
/////////////////////////////////////////////////////////////////////////
///产品统计
#define THOST_FTDC_FSM_Product '1'
///交易所统计
#define THOST_FTDC_FSM_Exchange '2'
///统计所有
#define THOST_FTDC_FSM_All '3'
typedef char TThostFtdcFlexStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcByInvestorRangeType是一个投资者范围统计方式类型
/////////////////////////////////////////////////////////////////////////
///属性统计
#define THOST_FTDC_BIR_Property '1'
///统计所有
#define THOST_FTDC_BIR_All '2'
typedef char TThostFtdcByInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSRiskRateType是一个风险度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSRiskRateType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceNo12Type是一个序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSequenceNo12Type;
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_PIR_All '1'
///投资者属性
#define THOST_FTDC_PIR_Property '2'
///单一投资者
#define THOST_FTDC_PIR_Single '3'
typedef char TThostFtdcPropertyInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileStatusType是一个文件状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_FIS_NoCreate '0'
///已生成
#define THOST_FTDC_FIS_Created '1'
///生成失败
#define THOST_FTDC_FIS_Failed '2'
typedef char TThostFtdcFileStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileGenStyleType是一个文件生成方式类型
/////////////////////////////////////////////////////////////////////////
///下发
#define THOST_FTDC_FGS_FileTransmit '0'
///生成
#define THOST_FTDC_FGS_FileGen '1'
typedef char TThostFtdcFileGenStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysOperModeType是一个系统日志操作方法类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_SoM_Add '1'
///修改
#define THOST_FTDC_SoM_Update '2'
///删除
#define THOST_FTDC_SoM_Delete '3'
///复制
#define THOST_FTDC_SoM_Copy '4'
///激活
#define THOST_FTDC_SoM_AcTive '5'
///注销
#define THOST_FTDC_SoM_CanCel '6'
///重置
#define THOST_FTDC_SoM_ReSet '7'
typedef char TThostFtdcSysOperModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysOperTypeType是一个系统日志操作类型类型
/////////////////////////////////////////////////////////////////////////
///修改操作员密码
#define THOST_FTDC_SoT_UpdatePassword '0'
///操作员组织架构关系
#define THOST_FTDC_SoT_UserDepartment '1'
///角色管理
#define THOST_FTDC_SoT_RoleManager '2'
///角色功能设置
#define THOST_FTDC_SoT_RoleFunction '3'
///基础参数设置
#define THOST_FTDC_SoT_BaseParam '4'
///设置操作员
#define THOST_FTDC_SoT_SetUserID '5'
///用户角色设置
#define THOST_FTDC_SoT_SetUserRole '6'
///用户IP限制
#define THOST_FTDC_SoT_UserIpRestriction '7'
///组织架构管理
#define THOST_FTDC_SoT_DepartmentManager '8'
///组织架构向查询分类复制
#define THOST_FTDC_SoT_DepartmentCopy '9'
///交易编码管理
#define THOST_FTDC_SoT_Tradingcode 'A'
///投资者状态维护
#define THOST_FTDC_SoT_InvestorStatus 'B'
///投资者权限管理
#define THOST_FTDC_SoT_InvestorAuthority 'C'
///属性设置
#define THOST_FTDC_SoT_PropertySet 'D'
///重置投资者密码
#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E'
///投资者个性信息维护
#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F'
typedef char TThostFtdcSysOperTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCDataQueyTypeType是一个上报数据查询类型类型
/////////////////////////////////////////////////////////////////////////
///查询当前交易日报送的数据
#define THOST_FTDC_CSRCQ_Current '0'
///查询历史报送的代理经纪公司的数据
#define THOST_FTDC_CSRCQ_History '1'
typedef char TThostFtdcCSRCDataQueyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFreezeStatusType是一个休眠状态类型
/////////////////////////////////////////////////////////////////////////
///活跃
#define THOST_FTDC_FRS_Normal '1'
///休眠
#define THOST_FTDC_FRS_Freeze '0'
typedef char TThostFtdcFreezeStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStandardStatusType是一个规范状态类型
/////////////////////////////////////////////////////////////////////////
///已规范
#define THOST_FTDC_STST_Standard '0'
///未规范
#define THOST_FTDC_STST_NonStandard '1'
typedef char TThostFtdcStandardStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCFreezeStatusType是一个休眠状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCFreezeStatusType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcRightParamTypeType是一个配置类型类型
/////////////////////////////////////////////////////////////////////////
///休眠户
#define THOST_FTDC_RPT_Freeze '1'
///激活休眠户
#define THOST_FTDC_RPT_FreezeActive '2'
///开仓权限限制
#define THOST_FTDC_RPT_OpenLimit '3'
///解除开仓权限限制
#define THOST_FTDC_RPT_RelieveOpenLimit '4'
typedef char TThostFtdcRightParamTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRightTemplateIDType是一个模板代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRightTemplateIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRightTemplateNameType是一个模板名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRightTemplateNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcDataStatusType是一个反洗钱审核表数据状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_AMLDS_Normal '0'
///已删除
#define THOST_FTDC_AMLDS_Deleted '1'
typedef char TThostFtdcDataStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCheckStatusType是一个审核状态类型
/////////////////////////////////////////////////////////////////////////
///未复核
#define THOST_FTDC_AMLCHS_Init '0'
///复核中
#define THOST_FTDC_AMLCHS_Checking '1'
///已复核
#define THOST_FTDC_AMLCHS_Checked '2'
///拒绝上报
#define THOST_FTDC_AMLCHS_RefuseReport '3'
typedef char TThostFtdcAMLCheckStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlDateTypeType是一个日期类型类型
/////////////////////////////////////////////////////////////////////////
///检查日期
#define THOST_FTDC_AMLDT_DrawDay '0'
///发生日期
#define THOST_FTDC_AMLDT_TouchDay '1'
typedef char TThostFtdcAmlDateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlCheckLevelType是一个审核级别类型
/////////////////////////////////////////////////////////////////////////
///零级审核
#define THOST_FTDC_AMLCL_CheckLevel0 '0'
///一级审核
#define THOST_FTDC_AMLCL_CheckLevel1 '1'
///二级审核
#define THOST_FTDC_AMLCL_CheckLevel2 '2'
///三级审核
#define THOST_FTDC_AMLCL_CheckLevel3 '3'
typedef char TThostFtdcAmlCheckLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlCheckFlowType是一个反洗钱数据抽取审核流程类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAmlCheckFlowType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcDataTypeType是一个数据类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDataTypeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcExportFileTypeType是一个导出文件类型类型
/////////////////////////////////////////////////////////////////////////
///CSV
#define THOST_FTDC_EFT_CSV '0'
///Excel
#define THOST_FTDC_EFT_EXCEL '1'
///DBF
#define THOST_FTDC_EFT_DBF '2'
typedef char TThostFtdcExportFileTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerTypeType是一个结算配置类型类型
/////////////////////////////////////////////////////////////////////////
///结算前准备
#define THOST_FTDC_SMT_Before '1'
///结算
#define THOST_FTDC_SMT_Settlement '2'
///结算后核对
#define THOST_FTDC_SMT_After '3'
///结算后处理
#define THOST_FTDC_SMT_Settlemented '4'
typedef char TThostFtdcSettleManagerTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerIDType是一个结算配置代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettleManagerIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerNameType是一个结算配置名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettleManagerNameType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerLevelType是一个结算配置等级类型
/////////////////////////////////////////////////////////////////////////
///必要
#define THOST_FTDC_SML_Must '1'
///警告
#define THOST_FTDC_SML_Alarm '2'
///提示
#define THOST_FTDC_SML_Prompt '3'
///不检查
#define THOST_FTDC_SML_Ignore '4'
typedef char TThostFtdcSettleManagerLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerGroupType是一个模块分组类型
/////////////////////////////////////////////////////////////////////////
///交易所核对
#define THOST_FTDC_SMG_Exhcange '1'
///内部核对
#define THOST_FTDC_SMG_ASP '2'
///上报数据核对
#define THOST_FTDC_SMG_CSRC '3'
typedef char TThostFtdcSettleManagerGroupType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckResultMemoType是一个核对结果说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCheckResultMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionUrlType是一个功能链接类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionUrlType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthInfoType是一个客户端认证信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthCodeType是一个客户端认证码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthCodeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcLimitUseTypeType是一个保值额度使用类型类型
/////////////////////////////////////////////////////////////////////////
///可重复使用
#define THOST_FTDC_LUT_Repeatable '1'
///不可重复使用
#define THOST_FTDC_LUT_Unrepeatable '2'
typedef char TThostFtdcLimitUseTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataResourceType是一个数据来源类型
/////////////////////////////////////////////////////////////////////////
///本系统
#define THOST_FTDC_DAR_Settle '1'
///交易所
#define THOST_FTDC_DAR_Exchange '2'
///报送数据
#define THOST_FTDC_DAR_CSRC '3'
typedef char TThostFtdcDataResourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginTypeType是一个保证金类型类型
/////////////////////////////////////////////////////////////////////////
///交易所保证金率
#define THOST_FTDC_MGT_ExchMarginRate '0'
///投资者保证金率
#define THOST_FTDC_MGT_InstrMarginRate '1'
///投资者交易保证金率
#define THOST_FTDC_MGT_InstrMarginRateTrade '2'
typedef char TThostFtdcMarginTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActiveTypeType是一个生效类型类型
/////////////////////////////////////////////////////////////////////////
///仅当日生效
#define THOST_FTDC_ACT_Intraday '1'
///长期生效
#define THOST_FTDC_ACT_Long '2'
typedef char TThostFtdcActiveTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginRateTypeType是一个冲突保证金率类型类型
/////////////////////////////////////////////////////////////////////////
///交易所保证金率
#define THOST_FTDC_MRT_Exchange '1'
///投资者保证金率
#define THOST_FTDC_MRT_Investor '2'
///投资者交易保证金率
#define THOST_FTDC_MRT_InvestorTrade '3'
typedef char TThostFtdcMarginRateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBackUpStatusType是一个备份数据状态类型
/////////////////////////////////////////////////////////////////////////
///未生成备份数据
#define THOST_FTDC_BUS_UnBak '0'
///备份数据生成中
#define THOST_FTDC_BUS_BakUp '1'
///已生成备份数据
#define THOST_FTDC_BUS_BakUped '2'
///备份数据失败
#define THOST_FTDC_BUS_BakFail '3'
typedef char TThostFtdcBackUpStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInitSettlementType是一个结算初始化状态类型
/////////////////////////////////////////////////////////////////////////
///结算初始化未开始
#define THOST_FTDC_SIS_UnInitialize '0'
///结算初始化中
#define THOST_FTDC_SIS_Initialize '1'
///结算初始化完成
#define THOST_FTDC_SIS_Initialized '2'
typedef char TThostFtdcInitSettlementType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReportStatusType是一个报表数据生成状态类型
/////////////////////////////////////////////////////////////////////////
///未生成报表数据
#define THOST_FTDC_SRS_NoCreate '0'
///报表数据生成中
#define THOST_FTDC_SRS_Create '1'
///已生成报表数据
#define THOST_FTDC_SRS_Created '2'
///生成报表数据失败
#define THOST_FTDC_SRS_CreateFail '3'
typedef char TThostFtdcReportStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSaveStatusType是一个数据归档状态类型
/////////////////////////////////////////////////////////////////////////
///归档未完成
#define THOST_FTDC_SSS_UnSaveData '0'
///归档完成
#define THOST_FTDC_SSS_SaveDatad '1'
typedef char TThostFtdcSaveStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettArchiveStatusType是一个结算确认数据归档状态类型
/////////////////////////////////////////////////////////////////////////
///未归档数据
#define THOST_FTDC_SAS_UnArchived '0'
///数据归档中
#define THOST_FTDC_SAS_Archiving '1'
///已归档数据
#define THOST_FTDC_SAS_Archived '2'
///归档数据失败
#define THOST_FTDC_SAS_ArchiveFail '3'
typedef char TThostFtdcSettArchiveStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCTPTypeType是一个CTP交易系统类型类型
/////////////////////////////////////////////////////////////////////////
///未知类型
#define THOST_FTDC_CTPT_Unkown '0'
///主中心
#define THOST_FTDC_CTPT_MainCenter '1'
///备中心
#define THOST_FTDC_CTPT_BackUp '2'
typedef char TThostFtdcCTPTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcToolIDType是一个工具代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcToolIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcToolNameType是一个工具名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcToolNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcCloseDealTypeType是一个平仓处理类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_CDT_Normal '0'
///投机平仓优先
#define THOST_FTDC_CDT_SpecFirst '1'
typedef char TThostFtdcCloseDealTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMortgageFundUseRangeType是一个货币质押资金可用范围类型
/////////////////////////////////////////////////////////////////////////
///不能使用
#define THOST_FTDC_MFUR_None '0'
///用于保证金
#define THOST_FTDC_MFUR_Margin '1'
///用于手续费、盈亏、保证金
#define THOST_FTDC_MFUR_All '2'
///人民币方案3
#define THOST_FTDC_MFUR_CNY3 '3'
typedef char TThostFtdcMortgageFundUseRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyUnitType是一个币种单位数量类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCurrencyUnitType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeRateType是一个汇率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcExchangeRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecProductTypeType是一个特殊产品类型类型
/////////////////////////////////////////////////////////////////////////
///郑商所套保产品
#define THOST_FTDC_SPT_CzceHedge '1'
///货币质押产品
#define THOST_FTDC_SPT_IneForeignCurrency '2'
///大连短线开平仓产品
#define THOST_FTDC_SPT_DceOpenClose '3'
typedef char TThostFtdcSpecProductTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortgageTypeType是一个货币质押类型类型
/////////////////////////////////////////////////////////////////////////
///质押
#define THOST_FTDC_FMT_Mortgage '1'
///解质
#define THOST_FTDC_FMT_Redemption '2'
typedef char TThostFtdcFundMortgageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountSettlementParamIDType是一个投资者账户结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///基础保证金
#define THOST_FTDC_ASPI_BaseMargin '1'
///最低权益标准
#define THOST_FTDC_ASPI_LowestInterest '2'
typedef char TThostFtdcAccountSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyNameType是一个币种名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyNameType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySignType是一个币种符号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencySignType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortDirectionType是一个货币质押方向类型
/////////////////////////////////////////////////////////////////////////
///货币质入
#define THOST_FTDC_FMD_In '1'
///货币质出
#define THOST_FTDC_FMD_Out '2'
typedef char TThostFtdcFundMortDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessClassType是一个换汇类别类型
/////////////////////////////////////////////////////////////////////////
///盈利
#define THOST_FTDC_BT_Profit '0'
///亏损
#define THOST_FTDC_BT_Loss '1'
///其他
#define THOST_FTDC_BT_Other 'Z'
typedef char TThostFtdcBusinessClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSwapSourceTypeType是一个换汇数据来源类型
/////////////////////////////////////////////////////////////////////////
///手工
#define THOST_FTDC_SST_Manual '0'
///自动生成
#define THOST_FTDC_SST_Automatic '1'
typedef char TThostFtdcSwapSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrExDirectionType是一个换汇类型类型
/////////////////////////////////////////////////////////////////////////
///结汇
#define THOST_FTDC_CED_Settlement '0'
///售汇
#define THOST_FTDC_CED_Sale '1'
typedef char TThostFtdcCurrExDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySwapStatusType是一个申请状态类型
/////////////////////////////////////////////////////////////////////////
///已录入
#define THOST_FTDC_CSS_Entry '1'
///已审核
#define THOST_FTDC_CSS_Approve '2'
///已拒绝
#define THOST_FTDC_CSS_Refuse '3'
///已撤销
#define THOST_FTDC_CSS_Revoke '4'
///已发送
#define THOST_FTDC_CSS_Send '5'
///换汇成功
#define THOST_FTDC_CSS_Success '6'
///换汇失败
#define THOST_FTDC_CSS_Failure '7'
typedef char TThostFtdcCurrencySwapStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrExchCertNoType是一个凭证号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrExchCertNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBatchSerialNoType是一个批次号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBatchSerialNoType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcReqFlagType是一个换汇发送标志类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_REQF_NoSend '0'
///发送成功
#define THOST_FTDC_REQF_SendSuccess '1'
///发送失败
#define THOST_FTDC_REQF_SendFailed '2'
///等待重发
#define THOST_FTDC_REQF_WaitReSend '3'
typedef char TThostFtdcReqFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcResFlagType是一个换汇返回成功标志类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_RESF_Success '0'
///账户余额不足
#define THOST_FTDC_RESF_InsuffiCient '1'
///交易结果未知
#define THOST_FTDC_RESF_UnKnown '8'
typedef char TThostFtdcResFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPageControlType是一个换汇页面控制类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPageControlType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcRecordCountType是一个记录数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRecordCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySwapMemoType是一个换汇需确认信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencySwapMemoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcExStatusType是一个修改状态类型
/////////////////////////////////////////////////////////////////////////
///修改前
#define THOST_FTDC_EXS_Before '0'
///修改后
#define THOST_FTDC_EXS_After '1'
typedef char TThostFtdcExStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientRegionType是一个开户客户地域类型
/////////////////////////////////////////////////////////////////////////
///国内客户
#define THOST_FTDC_CR_Domestic '1'
///港澳台客户
#define THOST_FTDC_CR_GMT '2'
///国外客户
#define THOST_FTDC_CR_Foreign '3'
typedef char TThostFtdcClientRegionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWorkPlaceType是一个工作单位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWorkPlaceType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessPeriodType是一个经营期限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessPeriodType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcWebSiteType是一个网址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWebSiteType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAIdCardTypeType是一个统一开户证件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAIdCardTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientModeType是一个开户模式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientModeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorFullNameType是一个投资者全称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorFullNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOABrokerIDType是一个境外中介机构ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOABrokerIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAZipCodeType是一个邮政编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAZipCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAEMailType是一个电子邮箱类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAEMailType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldCityType是一个城市类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldCityType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcCorporateIdentifiedCardNoType是一个法人代表证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCorporateIdentifiedCardNoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcHasBoardType是一个是否有董事会类型
/////////////////////////////////////////////////////////////////////////
///没有
#define THOST_FTDC_HB_No '0'
///有
#define THOST_FTDC_HB_Yes '1'
typedef char TThostFtdcHasBoardType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStartModeType是一个启动模式类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_SM_Normal '1'
///应急
#define THOST_FTDC_SM_Emerge '2'
///恢复
#define THOST_FTDC_SM_Restore '3'
typedef char TThostFtdcStartModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTemplateTypeType是一个模型类型类型
/////////////////////////////////////////////////////////////////////////
///全量
#define THOST_FTDC_TPT_Full '1'
///增量
#define THOST_FTDC_TPT_Increment '2'
///备份
#define THOST_FTDC_TPT_BackUp '3'
typedef char TThostFtdcTemplateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLoginModeType是一个登录模式类型
/////////////////////////////////////////////////////////////////////////
///交易
#define THOST_FTDC_LM_Trade '0'
///转账
#define THOST_FTDC_LM_Transfer '1'
typedef char TThostFtdcLoginModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPromptTypeType是一个日历提示类型类型
/////////////////////////////////////////////////////////////////////////
///合约上下市
#define THOST_FTDC_CPT_Instrument '1'
///保证金分段生效
#define THOST_FTDC_CPT_Margin '2'
typedef char TThostFtdcPromptTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLedgerManageIDType是一个分户管理资产编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLedgerManageIDType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestVarietyType是一个投资品种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestVarietyType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountTypeType是一个账户类别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcLedgerManageBankType是一个开户银行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLedgerManageBankType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffexDepartmentNameType是一个开户营业部类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffexDepartmentNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffexDepartmentCodeType是一个营业部代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffexDepartmentCodeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcHasTrusteeType是一个是否有托管人类型
/////////////////////////////////////////////////////////////////////////
///有
#define THOST_FTDC_HT_Yes '1'
///没有
#define THOST_FTDC_HT_No '0'
typedef char TThostFtdcHasTrusteeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMemo1Type是一个说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMemo1Type[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrCFullNameType是一个代理资产管理业务的期货公司全称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrCFullNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrApprovalNOType是一个资产管理业务批文号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrApprovalNOType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrMgrNameType是一个资产管理业务负责人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrMgrNameType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcAmTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
///银行
#define THOST_FTDC_AMT_Bank '1'
///证券公司
#define THOST_FTDC_AMT_Securities '2'
///基金公司
#define THOST_FTDC_AMT_Fund '3'
///保险公司
#define THOST_FTDC_AMT_Insurance '4'
///信托公司
#define THOST_FTDC_AMT_Trust '5'
///其他
#define THOST_FTDC_AMT_Other '9'
typedef char TThostFtdcAmTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCAmTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCAmTypeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCFundIOTypeType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///出入金
#define THOST_FTDC_CFIOT_FundIO '0'
///银期换汇
#define THOST_FTDC_CFIOT_SwapCurrency '1'
typedef char TThostFtdcCSRCFundIOTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCusAccountTypeType是一个结算账户类型类型
/////////////////////////////////////////////////////////////////////////
///期货结算账户
#define THOST_FTDC_CAT_Futures '1'
///纯期货资管业务下的资管结算账户
#define THOST_FTDC_CAT_AssetmgrFuture '2'
///综合类资管业务下的期货资管托管账户
#define THOST_FTDC_CAT_AssetmgrTrustee '3'
///综合类资管业务下的资金中转账户
#define THOST_FTDC_CAT_AssetmgrTransfer '4'
typedef char TThostFtdcCusAccountTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCNationalType是一个国籍类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCNationalType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCSecAgentIDType是一个二级代理ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCSecAgentIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcLanguageTypeType是一个通知语言类型类型
/////////////////////////////////////////////////////////////////////////
///中文
#define THOST_FTDC_LT_Chinese '1'
///英文
#define THOST_FTDC_LT_English '2'
typedef char TThostFtdcLanguageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmAccountType是一个投资账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAmAccountType[23];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrClientTypeType是一个资产管理客户类型类型
/////////////////////////////////////////////////////////////////////////
///个人资管客户
#define THOST_FTDC_AMCT_Person '1'
///单位资管客户
#define THOST_FTDC_AMCT_Organ '2'
///特殊单位资管客户
#define THOST_FTDC_AMCT_SpecialOrgan '4'
typedef char TThostFtdcAssetmgrClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrTypeType是一个投资类型类型
/////////////////////////////////////////////////////////////////////////
///期货类
#define THOST_FTDC_ASST_Futures '3'
///综合类
#define THOST_FTDC_ASST_SpecialOrgan '4'
typedef char TThostFtdcAssetmgrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOMType是一个计量单位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOMType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEInstLifePhaseType是一个上期所合约生命周期状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSHFEInstLifePhaseType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSHFEProductClassType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceDecimalType是一个价格小数位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPriceDecimalType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcInTheMoneyFlagType是一个平值期权标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInTheMoneyFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckInstrTypeType是一个合约比较类型类型
/////////////////////////////////////////////////////////////////////////
///合约交易所不存在
#define THOST_FTDC_CIT_HasExch '0'
///合约本系统不存在
#define THOST_FTDC_CIT_HasATP '1'
///合约比较不一致
#define THOST_FTDC_CIT_HasDiff '2'
typedef char TThostFtdcCheckInstrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeliveryTypeType是一个交割类型类型
/////////////////////////////////////////////////////////////////////////
///手工交割
#define THOST_FTDC_DT_HandDeliv '1'
///到期交割
#define THOST_FTDC_DT_PersonDeliv '2'
typedef char TThostFtdcDeliveryTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBigMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcBigMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMaxMarginSideAlgorithmType是一个大额单边保证金算法类型
/////////////////////////////////////////////////////////////////////////
///不使用大额单边保证金算法
#define THOST_FTDC_MMSA_NO '0'
///使用大额单边保证金算法
#define THOST_FTDC_MMSA_YES '1'
typedef char TThostFtdcMaxMarginSideAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDAClientTypeType是一个资产管理客户类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CACT_Person '0'
///法人
#define THOST_FTDC_CACT_Company '1'
///其他
#define THOST_FTDC_CACT_Other '2'
typedef char TThostFtdcDAClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinInstrIDType是一个套利合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombinInstrIDType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinSettlePriceType是一个各腿结算价类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombinSettlePriceType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcDCEPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDCEPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeGroupIDType是一个成交组号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradeGroupIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIsCheckPrepaType是一个是否校验开户可用资金类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcIsCheckPrepaType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAAssetmgrTypeType是一个投资类型类型
/////////////////////////////////////////////////////////////////////////
///期货类
#define THOST_FTDC_UOAAT_Futures '1'
///综合类
#define THOST_FTDC_UOAAT_SpecialOrgan '2'
typedef char TThostFtdcUOAAssetmgrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDirectionEnType是一个买卖方向类型
/////////////////////////////////////////////////////////////////////////
///Buy
#define THOST_FTDC_DEN_Buy '0'
///Sell
#define THOST_FTDC_DEN_Sell '1'
typedef char TThostFtdcDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetFlagEnType是一个开平标志类型
/////////////////////////////////////////////////////////////////////////
///Position Opening
#define THOST_FTDC_OFEN_Open '0'
///Position Close
#define THOST_FTDC_OFEN_Close '1'
///Forced Liquidation
#define THOST_FTDC_OFEN_ForceClose '2'
///Close Today
#define THOST_FTDC_OFEN_CloseToday '3'
///Close Prev.
#define THOST_FTDC_OFEN_CloseYesterday '4'
///Forced Reduction
#define THOST_FTDC_OFEN_ForceOff '5'
///Local Forced Liquidation
#define THOST_FTDC_OFEN_LocalForceClose '6'
typedef char TThostFtdcOffsetFlagEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeFlagEnType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///Speculation
#define THOST_FTDC_HFEN_Speculation '1'
///Arbitrage
#define THOST_FTDC_HFEN_Arbitrage '2'
///Hedge
#define THOST_FTDC_HFEN_Hedge '3'
typedef char TThostFtdcHedgeFlagEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundIOTypeEnType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///Deposit/Withdrawal
#define THOST_FTDC_FIOTEN_FundIO '1'
///Bank-Futures Transfer
#define THOST_FTDC_FIOTEN_Transfer '2'
///Bank-Futures FX Exchange
#define THOST_FTDC_FIOTEN_SwapCurrency '3'
typedef char TThostFtdcFundIOTypeEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundTypeEnType是一个资金类型类型
/////////////////////////////////////////////////////////////////////////
///Bank Deposit
#define THOST_FTDC_FTEN_Deposite '1'
///Payment/Fee
#define THOST_FTDC_FTEN_ItemFund '2'
///Brokerage Adj
#define THOST_FTDC_FTEN_Company '3'
///Internal Transfer
#define THOST_FTDC_FTEN_InnerTransfer '4'
typedef char TThostFtdcFundTypeEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundDirectionEnType是一个出入金方向类型
/////////////////////////////////////////////////////////////////////////
///Deposit
#define THOST_FTDC_FDEN_In '1'
///Withdrawal
#define THOST_FTDC_FDEN_Out '2'
typedef char TThostFtdcFundDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortDirectionEnType是一个货币质押方向类型
/////////////////////////////////////////////////////////////////////////
///Pledge
#define THOST_FTDC_FMDEN_In '1'
///Redemption
#define THOST_FTDC_FMDEN_Out '2'
typedef char TThostFtdcFundMortDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSwapBusinessTypeType是一个换汇业务种类类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSwapBusinessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionsTypeType是一个期权类型类型
/////////////////////////////////////////////////////////////////////////
///看涨
#define THOST_FTDC_CP_CallOptions '1'
///看跌
#define THOST_FTDC_CP_PutOptions '2'
typedef char TThostFtdcOptionsTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeModeType是一个执行方式类型
/////////////////////////////////////////////////////////////////////////
///欧式
#define THOST_FTDC_STM_Continental '0'
///美式
#define THOST_FTDC_STM_American '1'
///百慕大
#define THOST_FTDC_STM_Bermuda '2'
typedef char TThostFtdcStrikeModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeTypeType是一个执行类型类型
/////////////////////////////////////////////////////////////////////////
///自身对冲
#define THOST_FTDC_STT_Hedge '0'
///匹配执行
#define THOST_FTDC_STT_Match '1'
typedef char TThostFtdcStrikeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyTypeType是一个中金所期权放弃执行申请类型类型
/////////////////////////////////////////////////////////////////////////
///不执行数量
#define THOST_FTDC_APPT_NotStrikeNum '4'
typedef char TThostFtdcApplyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcGiveUpDataSourceType是一个放弃执行申请数据来源类型
/////////////////////////////////////////////////////////////////////////
///系统生成
#define THOST_FTDC_GUDS_Gen '0'
///手工添加
#define THOST_FTDC_GUDS_Hand '1'
typedef char TThostFtdcGiveUpDataSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderSysIDType是一个执行宣告系统编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExecOrderSysIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcExecResultType是一个执行结果类型
/////////////////////////////////////////////////////////////////////////
///没有执行
#define THOST_FTDC_OER_NoExec 'n'
///已经取消
#define THOST_FTDC_OER_Canceled 'c'
///执行成功
#define THOST_FTDC_OER_OK '0'
///期权持仓不够
#define THOST_FTDC_OER_NoPosition '1'
///资金不够
#define THOST_FTDC_OER_NoDeposit '2'
///会员不存在
#define THOST_FTDC_OER_NoParticipant '3'
///客户不存在
#define THOST_FTDC_OER_NoClient '4'
///合约不存在
#define THOST_FTDC_OER_NoInstrument '6'
///没有执行权限
#define THOST_FTDC_OER_NoRight '7'
///不合理的数量
#define THOST_FTDC_OER_InvalidVolume '8'
///没有足够的历史成交
#define THOST_FTDC_OER_NoEnoughHistoryTrade '9'
///未知
#define THOST_FTDC_OER_Unknown 'a'
typedef char TThostFtdcExecResultType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeSequenceType是一个执行序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcStrikeSequenceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeTimeType是一个执行时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcStrikeTimeType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinationTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
///期货组合
#define THOST_FTDC_COMBT_Future '0'
///垂直价差BUL
#define THOST_FTDC_COMBT_BUL '1'
///垂直价差BER
#define THOST_FTDC_COMBT_BER '2'
///跨式组合
#define THOST_FTDC_COMBT_STD '3'
///宽跨式组合
#define THOST_FTDC_COMBT_STG '4'
///备兑组合
#define THOST_FTDC_COMBT_PRT '5'
///时间价差组合
#define THOST_FTDC_COMBT_CAS '6'
///期权对锁组合
#define THOST_FTDC_COMBT_OPL '7'
///买备兑组合
#define THOST_FTDC_COMBT_BFO '8'
///买入期权垂直价差组合
#define THOST_FTDC_COMBT_BLS '9'
///卖出期权垂直价差组合
#define THOST_FTDC_COMBT_BES 'a'
typedef char TThostFtdcCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDceCombinationTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
///期货对锁组合
#define THOST_FTDC_DCECOMBT_SPL '0'
///期权对锁组合
#define THOST_FTDC_DCECOMBT_OPL '1'
///期货跨期组合
#define THOST_FTDC_DCECOMBT_SP '2'
///期货跨品种组合
#define THOST_FTDC_DCECOMBT_SPC '3'
///买入期权垂直价差组合
#define THOST_FTDC_DCECOMBT_BLS '4'
///卖出期权垂直价差组合
#define THOST_FTDC_DCECOMBT_BES '5'
///期权日历价差组合
#define THOST_FTDC_DCECOMBT_CAS '6'
///期权跨式组合
#define THOST_FTDC_DCECOMBT_STD '7'
///期权宽跨式组合
#define THOST_FTDC_DCECOMBT_STG '8'
///买入期货期权组合
#define THOST_FTDC_DCECOMBT_BFO '9'
///卖出期货期权组合
#define THOST_FTDC_DCECOMBT_SFO 'a'
typedef char TThostFtdcDceCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionRoyaltyPriceTypeType是一个期权权利金价格类型类型
/////////////////////////////////////////////////////////////////////////
///昨结算价
#define THOST_FTDC_ORPT_PreSettlementPrice '1'
///开仓价
#define THOST_FTDC_ORPT_OpenPrice '4'
///最新价与昨结算价较大值
#define THOST_FTDC_ORPT_MaxPreSettlementPrice '5'
typedef char TThostFtdcOptionRoyaltyPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBalanceAlgorithmType是一个权益算法类型
/////////////////////////////////////////////////////////////////////////
///不计算期权市值盈亏
#define THOST_FTDC_BLAG_Default '1'
///计算期权市值亏损
#define THOST_FTDC_BLAG_IncludeOptValLost '2'
typedef char TThostFtdcBalanceAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionTypeType是一个执行类型类型
/////////////////////////////////////////////////////////////////////////
///执行
#define THOST_FTDC_ACTP_Exec '1'
///放弃
#define THOST_FTDC_ACTP_Abandon '2'
typedef char TThostFtdcActionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcForQuoteStatusType是一个询价状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_FQST_Submitted 'a'
///已经接受
#define THOST_FTDC_FQST_Accepted 'b'
///已经被拒绝
#define THOST_FTDC_FQST_Rejected 'c'
typedef char TThostFtdcForQuoteStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcValueMethodType是一个取值方式类型
/////////////////////////////////////////////////////////////////////////
///按绝对值
#define THOST_FTDC_VM_Absolute '0'
///按比率
#define THOST_FTDC_VM_Ratio '1'
typedef char TThostFtdcValueMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderPositionFlagType是一个期权行权后是否保留期货头寸的标记类型
/////////////////////////////////////////////////////////////////////////
///保留
#define THOST_FTDC_EOPF_Reserve '0'
///不保留
#define THOST_FTDC_EOPF_UnReserve '1'
typedef char TThostFtdcExecOrderPositionFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderCloseFlagType是一个期权行权后生成的头寸是否自动平仓类型
/////////////////////////////////////////////////////////////////////////
///自动平仓
#define THOST_FTDC_EOCF_AutoClose '0'
///免于自动平仓
#define THOST_FTDC_EOCF_NotToClose '1'
typedef char TThostFtdcExecOrderCloseFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductTypeType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_PTE_Futures '1'
///期权
#define THOST_FTDC_PTE_Options '2'
typedef char TThostFtdcProductTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCZCEUploadFileNameType是一个郑商所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{8}_zz_\d{4}
#define THOST_FTDC_CUFN_CUFN_O 'O'
///^\d{8}成交表
#define THOST_FTDC_CUFN_CUFN_T 'T'
///^\d{8}单腿持仓表new
#define THOST_FTDC_CUFN_CUFN_P 'P'
///^\d{8}非平仓了结表
#define THOST_FTDC_CUFN_CUFN_N 'N'
///^\d{8}平仓表
#define THOST_FTDC_CUFN_CUFN_L 'L'
///^\d{8}资金表
#define THOST_FTDC_CUFN_CUFN_F 'F'
///^\d{8}组合持仓表
#define THOST_FTDC_CUFN_CUFN_C 'C'
///^\d{8}保证金参数表
#define THOST_FTDC_CUFN_CUFN_M 'M'
typedef char TThostFtdcCZCEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDCEUploadFileNameType是一个大商所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{8}_dl_\d{3}
#define THOST_FTDC_DUFN_DUFN_O 'O'
///^\d{8}_成交表
#define THOST_FTDC_DUFN_DUFN_T 'T'
///^\d{8}_持仓表
#define THOST_FTDC_DUFN_DUFN_P 'P'
///^\d{8}_资金结算表
#define THOST_FTDC_DUFN_DUFN_F 'F'
///^\d{8}_优惠组合持仓明细表
#define THOST_FTDC_DUFN_DUFN_C 'C'
///^\d{8}_持仓明细表
#define THOST_FTDC_DUFN_DUFN_D 'D'
///^\d{8}_保证金参数表
#define THOST_FTDC_DUFN_DUFN_M 'M'
///^\d{8}_期权执行表
#define THOST_FTDC_DUFN_DUFN_S 'S'
typedef char TThostFtdcDCEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEUploadFileNameType是一个上期所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{4}_\d{8}_\d{8}_DailyFundChg
#define THOST_FTDC_SUFN_SUFN_O 'O'
///^\d{4}_\d{8}_\d{8}_Trade
#define THOST_FTDC_SUFN_SUFN_T 'T'
///^\d{4}_\d{8}_\d{8}_SettlementDetail
#define THOST_FTDC_SUFN_SUFN_P 'P'
///^\d{4}_\d{8}_\d{8}_Capital
#define THOST_FTDC_SUFN_SUFN_F 'F'
typedef char TThostFtdcSHFEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCFFEXUploadFileNameType是一个中金所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade
#define THOST_FTDC_CFUFN_SUFN_T 'T'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail
#define THOST_FTDC_CFUFN_SUFN_P 'P'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital
#define THOST_FTDC_CFUFN_SUFN_F 'F'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec
#define THOST_FTDC_CFUFN_SUFN_S 'S'
typedef char TThostFtdcCFFEXUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombDirectionType是一个组合指令方向类型
/////////////////////////////////////////////////////////////////////////
///申请组合
#define THOST_FTDC_CMDR_Comb '0'
///申请拆分
#define THOST_FTDC_CMDR_UnComb '1'
///操作员删组合单
#define THOST_FTDC_CMDR_DelComb '2'
typedef char TThostFtdcCombDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeOffsetTypeType是一个行权偏移类型类型
/////////////////////////////////////////////////////////////////////////
///实值额
#define THOST_FTDC_STOV_RealValue '1'
///盈利额
#define THOST_FTDC_STOV_ProfitValue '2'
///实值比例
#define THOST_FTDC_STOV_RealRatio '3'
///盈利比例
#define THOST_FTDC_STOV_ProfitRatio '4'
typedef char TThostFtdcStrikeOffsetTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReserveOpenAccStasType是一个预约开户状态类型
/////////////////////////////////////////////////////////////////////////
///等待处理中
#define THOST_FTDC_ROAST_Processing '0'
///已撤销
#define THOST_FTDC_ROAST_Cancelled '1'
///已开户
#define THOST_FTDC_ROAST_Opened '2'
///无效请求
#define THOST_FTDC_ROAST_Invalid '3'
typedef char TThostFtdcReserveOpenAccStasType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLoginRemarkType是一个登录备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLoginRemarkType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestUnitIDType是一个投资单元代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestUnitIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcBulletinIDType是一个公告编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBulletinIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNewsTypeType是一个公告类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNewsTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcNewsUrgencyType是一个紧急程度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNewsUrgencyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAbstractType是一个消息摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAbstractType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcComeFromType是一个消息来源类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcComeFromType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcURLLinkType是一个WEB地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcURLLinkType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongIndividualNameType是一个长个人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongIndividualNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongFBEBankAccountNameType是一个长换汇银行账户名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongFBEBankAccountNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcDateTimeType是一个日期时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateTimeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcWeakPasswordSourceType是一个弱密码来源类型
/////////////////////////////////////////////////////////////////////////
///弱密码库
#define THOST_FTDC_WPSR_Lib '1'
///手工录入
#define THOST_FTDC_WPSR_Manual '2'
typedef char TThostFtdcWeakPasswordSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRandomStringType是一个随机串类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRandomStringType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderMemoType是一个报单回显字段类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderMemoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptSelfCloseFlagType是一个期权行权的头寸是否自对冲类型
/////////////////////////////////////////////////////////////////////////
///自对冲期权仓位
#define THOST_FTDC_OSCF_CloseSelfOptionPosition '1'
///保留期权仓位
#define THOST_FTDC_OSCF_ReserveOptionPosition '2'
///自对冲卖方履约后的期货仓位
#define THOST_FTDC_OSCF_SellCloseSelfFuturePosition '3'
///保留卖方履约后的期货仓位
#define THOST_FTDC_OSCF_ReserveFuturePosition '4'
typedef char TThostFtdcOptSelfCloseFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBizTypeType是一个业务类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_BZTP_Future '1'
///证券
#define THOST_FTDC_BZTP_Stock '2'
typedef char TThostFtdcBizTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAppTypeType是一个用户App类型类型
/////////////////////////////////////////////////////////////////////////
///直连的投资者
#define THOST_FTDC_APP_TYPE_Investor '1'
///为每个投资者都创建连接的中继
#define THOST_FTDC_APP_TYPE_InvestorRelay '2'
///所有投资者共享一个操作员连接的中继
#define THOST_FTDC_APP_TYPE_OperatorRelay '3'
///未知
#define THOST_FTDC_APP_TYPE_UnKnown '4'
typedef char TThostFtdcAppTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAppIDType是一个App代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAppIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemInfoLenType是一个系统信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSystemInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdditionalInfoLenType是一个补充信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcAdditionalInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientSystemInfoType是一个交易终端系统信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientSystemInfoType[273];
/////////////////////////////////////////////////////////////////////////
///TFtdcAdditionalInfoType是一个系统外部信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAdditionalInfoType[261];
/////////////////////////////////////////////////////////////////////////
///TFtdcBase64ClientSystemInfoType是一个base64交易终端系统信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBase64ClientSystemInfoType[365];
/////////////////////////////////////////////////////////////////////////
///TFtdcBase64AdditionalInfoType是一个base64系统外部信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBase64AdditionalInfoType[349];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrentAuthMethodType是一个当前可用的认证模式,0代表无需认证模式 A从低位开始最后一位代表图片验证码,倒数第二位代表动态口令,倒数第三位代表短信验证码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCurrentAuthMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCaptchaInfoLenType是一个图片验证信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCaptchaInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCaptchaInfoType是一个图片验证信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCaptchaInfoType[2561];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserTextSeqType是一个用户短信验证码的编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcUserTextSeqType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandshakeDataType是一个握手数据内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcHandshakeDataType[301];
/////////////////////////////////////////////////////////////////////////
///TFtdcHandshakeDataLenType是一个握手数据内容长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcHandshakeDataLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCryptoKeyVersionType是一个api与front通信密钥版本号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCryptoKeyVersionType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcRsaKeyVersionType是一个公钥版本号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRsaKeyVersionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSoftwareProviderIDType是一个交易软件商ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSoftwareProviderIDType[22];
/////////////////////////////////////////////////////////////////////////
///TFtdcCollectTimeType是一个信息采集时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCollectTimeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryFreqType是一个查询频率类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcQueryFreqType;
/////////////////////////////////////////////////////////////////////////
///TFtdcResponseValueType是一个应答类型类型
/////////////////////////////////////////////////////////////////////////
///检查成功
#define THOST_FTDC_RV_Right '0'
///检查失败
#define THOST_FTDC_RV_Refuse '1'
typedef char TThostFtdcResponseValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTCTradeTypeType是一个OTC成交类型类型
/////////////////////////////////////////////////////////////////////////
///大宗交易
#define THOST_FTDC_OTC_TRDT_Block '0'
///期转现
#define THOST_FTDC_OTC_TRDT_EFP '1'
typedef char TThostFtdcOTCTradeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMatchTypeType是一个期现风险匹配方式类型
/////////////////////////////////////////////////////////////////////////
///基点价值
#define THOST_FTDC_OTC_MT_DV01 '1'
///面值
#define THOST_FTDC_OTC_MT_ParValue '2'
typedef char TThostFtdcMatchTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTCTraderIDType是一个OTC交易员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTCTraderIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskValueType是一个期货风险值类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcRiskValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIDBNameType是一个握手数据内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIDBNameType[100];
/////////////////////////////////////////////////////////////////////////
///TFtdcDiscountRatioType是一个折扣率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcDiscountRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthTypeType是一个用户终端认证方式类型
/////////////////////////////////////////////////////////////////////////
///白名单校验
#define THOST_FTDC_AU_WHITE '0'
///黑名单校验
#define THOST_FTDC_AU_BLACK '1'
typedef char TThostFtdcAuthTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClassTypeType是一个合约分类方式类型
/////////////////////////////////////////////////////////////////////////
///所有合约
#define THOST_FTDC_INS_ALL '0'
///期货、即期、期转现、Tas、金属指数合约
#define THOST_FTDC_INS_FUTURE '1'
///期货、现货期权合约
#define THOST_FTDC_INS_OPTION '2'
///组合合约
#define THOST_FTDC_INS_COMB '3'
typedef char TThostFtdcClassTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingTypeType是一个合约交易状态分类方式类型
/////////////////////////////////////////////////////////////////////////
///所有状态
#define THOST_FTDC_TD_ALL '0'
///交易
#define THOST_FTDC_TD_TRADE '1'
///非交易
#define THOST_FTDC_TD_UNTRADE '2'
typedef char TThostFtdcTradingTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductStatusType是一个产品状态类型
/////////////////////////////////////////////////////////////////////////
///可交易
#define THOST_FTDC_PS_tradeable '1'
///不可交易
#define THOST_FTDC_PS_untradeable '2'
typedef char TThostFtdcProductStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDeltaStatusType是一个追平状态类型
/////////////////////////////////////////////////////////////////////////
///交易可读
#define THOST_FTDC_SDS_Readable '1'
///交易在读
#define THOST_FTDC_SDS_Reading '2'
///交易读取完成
#define THOST_FTDC_SDS_Readend '3'
///追平失败 交易本地状态结算不存在
#define THOST_FTDC_SDS_OptErr 'e'
typedef char TThostFtdcSyncDeltaStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionDirectionType是一个操作标志类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_ACD_Add '1'
///删除
#define THOST_FTDC_ACD_Del '2'
///更新
#define THOST_FTDC_ACD_Upd '3'
typedef char TThostFtdcActionDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderCancelAlgType是一个撤单时选择席位算法类型
/////////////////////////////////////////////////////////////////////////
///轮询席位撤单
#define THOST_FTDC_OAC_Balance '1'
///优先原报单席位撤单
#define THOST_FTDC_OAC_OrigFirst '2'
typedef char TThostFtdcOrderCancelAlgType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDescriptionType是一个追平描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSyncDescriptionType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommonIntType是一个通用int类型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommonIntType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysVersionType是一个系统版本类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSysVersionType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenLimitControlLevelType是一个开仓量限制粒度类型
/////////////////////////////////////////////////////////////////////////
///不控制
#define THOST_FTDC_PLCL_None '0'
///产品级别
#define THOST_FTDC_PLCL_Product '1'
///合约级别
#define THOST_FTDC_PLCL_Inst '2'
typedef char TThostFtdcOpenLimitControlLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderFreqControlLevelType是一个报单频率控制粒度类型
/////////////////////////////////////////////////////////////////////////
///不控制
#define THOST_FTDC_OFCL_None '0'
///产品级别
#define THOST_FTDC_OFCL_Product '1'
///合约级别
#define THOST_FTDC_OFCL_Inst '2'
typedef char TThostFtdcOrderFreqControlLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumBoolType是一个枚举bool类型类型
/////////////////////////////////////////////////////////////////////////
///false
#define THOST_FTDC_EBL_False '0'
///true
#define THOST_FTDC_EBL_True '1'
typedef char TThostFtdcEnumBoolType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeRangeType是一个期货合约阶段标识类型
/////////////////////////////////////////////////////////////////////////
///一般月份
#define THOST_FTDC_ETR_USUAL '1'
///交割月前一个月上半月
#define THOST_FTDC_ETR_FNSP '2'
///交割月前一个月下半月
#define THOST_FTDC_ETR_BNSP '3'
///交割月份
#define THOST_FTDC_ETR_SPOT '4'
typedef char TThostFtdcTimeRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeltaType是一个Delta类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcDeltaType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpreadIdType是一个抵扣组优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSpreadIdType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfolioType是一个新型组保算法类型
/////////////////////////////////////////////////////////////////////////
///不使用新型组保算法
#define THOST_FTDC_EPF_None '0'
///SPBM算法
#define THOST_FTDC_EPF_SPBM '1'
///RULE算法
#define THOST_FTDC_EPF_RULE '2'
///SPMM算法
#define THOST_FTDC_EPF_SPMM '3'
///RCAMS算法
#define THOST_FTDC_EPF_RCAMS '4'
typedef char TThostFtdcPortfolioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfolioDefIDType是一个SPBM组合套餐ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPortfolioDefIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamIDType是一个可提参数代码类型
/////////////////////////////////////////////////////////////////////////
///权利金收支是否可提 1 代表可提 0 不可提
#define THOST_FTDC_WDPID_CashIn 'C'
typedef char TThostFtdcWithDrawParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamValueType是一个可提控制参数内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWithDrawParamValueType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvstTradingRightType是一个投资者交易权限类型
/////////////////////////////////////////////////////////////////////////
///只能平仓
#define THOST_FTDC_ITR_CloseOnly '1'
///不能交易
#define THOST_FTDC_ITR_Forbidden '2'
typedef char TThostFtdcInvstTradingRightType;
/////////////////////////////////////////////////////////////////////////
///TFtdcThostFunctionCodeType是一个Thost终端功能代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcThostFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMDiscountRatioType是一个SPMM折扣率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSPMMDiscountRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelDescType是一个SPMM模板描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelDescType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelIDType是一个SPMM模板ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMProductIDType是一个SPMM商品群商品组ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMProductIDType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstMarginCalIDType是一个SPMM合约保证金算法类型
/////////////////////////////////////////////////////////////////////////
///标准算法收取双边
#define THOST_FTDC_IMID_BothSide '1'
///单向大边
#define THOST_FTDC_IMID_MMSA '2'
///新组保SPMM
#define THOST_FTDC_IMID_SPMM '3'
typedef char TThostFtdcInstMarginCalIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductIDType是一个产品ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductIDType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeRateType是一个HedgeRate类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcHedgeRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRCAMSPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdjustValueType是一个空头期权风险调整标准类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAdjustValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSCombinationTypeType是一个RCAMS组合类型类型
/////////////////////////////////////////////////////////////////////////
///牛市看涨价差组合
#define THOST_FTDC_ERComb_BUC '0'
///熊市看涨价差组合
#define THOST_FTDC_ERComb_BEC '1'
///熊市看跌价差组合
#define THOST_FTDC_ERComb_BEP '2'
///牛市看跌价差组合
#define THOST_FTDC_ERComb_BUP '3'
///日历价差组合
#define THOST_FTDC_ERComb_CAS '4'
typedef char TThostFtdcRCAMSCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRuleIdType是一个策略id类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRuleIdType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfTypeType是一个新组保算法启用类型类型
/////////////////////////////////////////////////////////////////////////
///使用初版交易所算法
#define THOST_FTDC_EET_None '0'
///SPBM算法V1.1.0_附加保证金调整
#define THOST_FTDC_EET_SPBM_AddOnHedge '1'
typedef char TThostFtdcPortfTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentClassType是一个合约类型类型
/////////////////////////////////////////////////////////////////////////
///一般月份合约
#define THOST_FTDC_EIC_Usual '1'
///临近交割合约
#define THOST_FTDC_EIC_Delivery '2'
///非组合合约
#define THOST_FTDC_EIC_NonComb '3'
typedef char TThostFtdcInstrumentClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommodityGroupIDType是一个商品群号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommodityGroupIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStdPositionType是一个标准持仓类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcStdPositionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProdChangeFlagType是一个品种记录改变状态类型
/////////////////////////////////////////////////////////////////////////
///持仓量和冻结量均无变化
#define THOST_FTDC_PCF_None '0'
///持仓量无变化,冻结量有变化
#define THOST_FTDC_PCF_OnlyFrozen '1'
///持仓量有变化
#define THOST_FTDC_PCF_PositionChange '2'
typedef char TThostFtdcProdChangeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPwdRcdSrcType是一个历史密码来源类型
/////////////////////////////////////////////////////////////////////////
///来源于Sync初始化数据
#define THOST_FTDC_PRS_Init '0'
///来源于实时上场数据
#define THOST_FTDC_PRS_Sync '1'
///来源于用户修改
#define THOST_FTDC_PRS_UserUpd '2'
///来源于超户修改,很可能来自主席同步数据
#define THOST_FTDC_PRS_SuperUserUpd '3'
///来源于次席同步的修改
#define THOST_FTDC_PRS_SecUpd '4'
typedef char TThostFtdcPwdRcdSrcType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrSrvModeType是一个地址服务类型类型
/////////////////////////////////////////////////////////////////////////
///交易地址
#define THOST_FTDC_ASM_Trade '0'
///行情地址
#define THOST_FTDC_ASM_MarketData '1'
///其他
#define THOST_FTDC_ASM_Other '2'
typedef char TThostFtdcAddrSrvModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrVerType是一个地址版本类型
/////////////////////////////////////////////////////////////////////////
///IPV4
#define THOST_FTDC_ADV_V4 '0'
///IPV6
#define THOST_FTDC_ADV_V6 '1'
typedef char TThostFtdcAddrVerType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrRemarkType是一个地址备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddrRemarkType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrNameType是一个地址名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddrNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcIpAddrType是一个服务地址IP类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIpAddrType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcTGSessionQryStatusType是一个TGATE会话查询状态类型
/////////////////////////////////////////////////////////////////////////
///查询状态空闲
#define THOST_FTDC_TGQS_QryIdle '1'
///查询状态频繁
#define THOST_FTDC_TGQS_QryBusy '2'
typedef char TThostFtdcTGSessionQryStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetTypeType是一个对冲类型类型
/////////////////////////////////////////////////////////////////////////
///期权对冲
#define THOST_FTDC_OT_OPT_OFFSET '0'
///期货对冲
#define THOST_FTDC_OT_FUT_OFFSET '1'
///行权后期货对冲
#define THOST_FTDC_OT_EXEC_OFFSET '2'
///履约后期货对冲
#define THOST_FTDC_OT_PERFORM_OFFSET '3'
typedef char TThostFtdcOffsetTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSiteType是一个站点类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSiteType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcNetOperatorType是一个网络运营商类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNetOperatorType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcApplySrcType是一个申请来源类型
/////////////////////////////////////////////////////////////////////////
///交易
#define THOST_FTDC_AS_Trade '0'
///会服
#define THOST_FTDC_AS_Member '1'
typedef char TThostFtdcApplySrcType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReserveInfoType是一个预留信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReserveInfoType[65];
#endif
================================================
FILE: native/ctp_bridge/api/linux/ThostFtdcUserApiStruct.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcUserApiStruct.h
///@brief 定义了客户端接口使用的业务数据结构
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCSTRUCT_H)
#define THOST_FTDCSTRUCT_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiDataType.h"
///信息分发
struct CThostFtdcDisseminationField
{
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///序列号
TThostFtdcSequenceNoType SequenceNo;
};
///用户登录请求
struct CThostFtdcReqUserLoginField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户登录应答
struct CThostFtdcRspUserLoginField
{
///交易日
TThostFtdcDateType TradingDay;
///登录成功时间
TThostFtdcTimeType LoginTime;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易系统名称
TThostFtdcSystemNameType SystemName;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///能源中心时间
TThostFtdcTimeType INETime;
///后台版本信息
TThostFtdcSysVersionType SysVersion;
///广期所时间
TThostFtdcTimeType GFEXTime;
///当前登录中心号
TThostFtdcDRIdentityIDType LoginDRIdentityID;
///用户所属中心号
TThostFtdcDRIdentityIDType UserDRIdentityID;
///上次登陆时间
TThostFtdcDateTimeType LastLoginTime;
///预留信息
TThostFtdcReserveInfoType ReserveInfo;
};
///用户登出请求
struct CThostFtdcUserLogoutField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///强制交易员退出
struct CThostFtdcForceUserLogoutField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///客户端认证请求
struct CThostFtdcReqAuthenticateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///认证码
TThostFtdcAuthCodeType AuthCode;
///App代码
TThostFtdcAppIDType AppID;
};
///客户端认证响应
struct CThostFtdcRspAuthenticateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///App代码
TThostFtdcAppIDType AppID;
///App类型
TThostFtdcAppTypeType AppType;
};
///客户端认证信息
struct CThostFtdcAuthenticationInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///认证信息
TThostFtdcAuthInfoType AuthInfo;
///是否为认证结果
TThostFtdcBoolType IsResult;
///App代码
TThostFtdcAppIDType AppID;
///App类型
TThostFtdcAppTypeType AppType;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户登录应答2
struct CThostFtdcRspUserLogin2Field
{
///交易日
TThostFtdcDateType TradingDay;
///登录成功时间
TThostFtdcTimeType LoginTime;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易系统名称
TThostFtdcSystemNameType SystemName;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///能源中心时间
TThostFtdcTimeType INETime;
///随机串
TThostFtdcRandomStringType RandomString;
};
///银期转帐报文头
struct CThostFtdcTransferHeaderField
{
///版本号,常量,1.0
TThostFtdcVersionType Version;
///交易代码,必填
TThostFtdcTradeCodeType TradeCode;
///交易日期,必填,格式:yyyymmdd
TThostFtdcTradeDateType TradeDate;
///交易时间,必填,格式:hhmmss
TThostFtdcTradeTimeType TradeTime;
///发起方流水号,N/A
TThostFtdcTradeSerialType TradeSerial;
///期货公司代码,必填
TThostFtdcFutureIDType FutureID;
///银行代码,根据查询银行得到,必填
TThostFtdcBankIDType BankID;
///银行分中心代码,根据查询银行得到,必填
TThostFtdcBankBrchIDType BankBrchID;
///操作员,N/A
TThostFtdcOperNoType OperNo;
///交易设备类型,N/A
TThostFtdcDeviceIDType DeviceID;
///记录数,N/A
TThostFtdcRecordNumType RecordNum;
///会话编号,N/A
TThostFtdcSessionIDType SessionID;
///请求编号,N/A
TThostFtdcRequestIDType RequestID;
};
///银行资金转期货请求,TradeCode=202001
struct CThostFtdcTransferBankToFutureReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///转账金额
TThostFtdcMoneyType TradeAmt;
///客户手续费
TThostFtdcMoneyType CustFee;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///银行资金转期货请求响应
struct CThostFtdcTransferBankToFutureRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///转帐金额
TThostFtdcMoneyType TradeAmt;
///应收客户手续费
TThostFtdcMoneyType CustFee;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///期货资金转银行请求,TradeCode=202002
struct CThostFtdcTransferFutureToBankReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///转账金额
TThostFtdcMoneyType TradeAmt;
///客户手续费
TThostFtdcMoneyType CustFee;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///期货资金转银行请求响应
struct CThostFtdcTransferFutureToBankRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///转帐金额
TThostFtdcMoneyType TradeAmt;
///应收客户手续费
TThostFtdcMoneyType CustFee;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行资金请求,TradeCode=204002
struct CThostFtdcTransferQryBankReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行资金请求响应
struct CThostFtdcTransferQryBankRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///银行余额
TThostFtdcMoneyType TradeAmt;
///银行可用余额
TThostFtdcMoneyType UseAmt;
///银行可取余额
TThostFtdcMoneyType FetchAmt;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行交易明细请求,TradeCode=204999
struct CThostFtdcTransferQryDetailReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
};
///查询银行交易明细请求响应
struct CThostFtdcTransferQryDetailRspField
{
///交易日期
TThostFtdcDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///交易代码
TThostFtdcTradeCodeType TradeCode;
///期货流水号
TThostFtdcTradeSerialNoType FutureSerial;
///期货公司代码
TThostFtdcFutureIDType FutureID;
///资金帐号
TThostFtdcFutureAccountType FutureAccount;
///银行流水号
TThostFtdcTradeSerialNoType BankSerial;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行账号
TThostFtdcBankAccountType BankAccount;
///证件号码
TThostFtdcCertCodeType CertCode;
///货币代码
TThostFtdcCurrencyCodeType CurrencyCode;
///发生金额
TThostFtdcMoneyType TxAmount;
///有效标志
TThostFtdcTransferValidFlagType Flag;
};
///响应信息
struct CThostFtdcRspInfoField
{
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易所
struct CThostFtdcExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所名称
TThostFtdcExchangeNameType ExchangeName;
///交易所属性
TThostFtdcExchangePropertyType ExchangeProperty;
};
///产品
struct CThostFtdcProductField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///产品名称
TThostFtdcProductNameType ProductName;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品类型
TThostFtdcProductClassType ProductClass;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///市价单最大下单量
TThostFtdcVolumeType MaxMarketOrderVolume;
///市价单最小下单量
TThostFtdcVolumeType MinMarketOrderVolume;
///限价单最大下单量
TThostFtdcVolumeType MaxLimitOrderVolume;
///限价单最小下单量
TThostFtdcVolumeType MinLimitOrderVolume;
///持仓类型
TThostFtdcPositionTypeType PositionType;
///持仓日期类型
TThostFtdcPositionDateTypeType PositionDateType;
///平仓处理类型
TThostFtdcCloseDealTypeType CloseDealType;
///交易币种类型
TThostFtdcCurrencyIDType TradeCurrencyID;
///质押资金可用范围
TThostFtdcMortgageFundUseRangeType MortgageFundUseRange;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///合约基础商品乘数
TThostFtdcUnderlyingMultipleType UnderlyingMultiple;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///交易所产品代码
TThostFtdcInstrumentIDType ExchangeProductID;
///开仓量限制粒度
TThostFtdcOpenLimitControlLevelType OpenLimitControlLevel;
///报单频率控制粒度
TThostFtdcOrderFreqControlLevelType OrderFreqControlLevel;
};
///合约
struct CThostFtdcInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约名称
TThostFtdcInstrumentNameType InstrumentName;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve3;
///产品类型
TThostFtdcProductClassType ProductClass;
///交割年份
TThostFtdcYearType DeliveryYear;
///交割月
TThostFtdcMonthType DeliveryMonth;
///市价单最大下单量
TThostFtdcVolumeType MaxMarketOrderVolume;
///市价单最小下单量
TThostFtdcVolumeType MinMarketOrderVolume;
///限价单最大下单量
TThostFtdcVolumeType MaxLimitOrderVolume;
///限价单最小下单量
TThostFtdcVolumeType MinLimitOrderVolume;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///创建日
TThostFtdcDateType CreateDate;
///上市日
TThostFtdcDateType OpenDate;
///到期日
TThostFtdcDateType ExpireDate;
///开始交割日
TThostFtdcDateType StartDelivDate;
///结束交割日
TThostFtdcDateType EndDelivDate;
///合约生命周期状态
TThostFtdcInstLifePhaseType InstLifePhase;
///当前是否交易
TThostFtdcBoolType IsTrading;
///持仓类型
TThostFtdcPositionTypeType PositionType;
///持仓日期类型
TThostFtdcPositionDateTypeType PositionDateType;
///多头保证金率
TThostFtdcRatioType LongMarginRatio;
///空头保证金率
TThostFtdcRatioType ShortMarginRatio;
///是否使用大额单边保证金算法
TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve4;
///执行价
TThostFtdcPriceType StrikePrice;
///期权类型
TThostFtdcOptionsTypeType OptionsType;
///合约基础商品乘数
TThostFtdcUnderlyingMultipleType UnderlyingMultiple;
///组合类型
TThostFtdcCombinationTypeType CombinationType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///基础商品代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
};
///经纪公司
struct CThostFtdcBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司简称
TThostFtdcBrokerAbbrType BrokerAbbr;
///经纪公司名称
TThostFtdcBrokerNameType BrokerName;
///是否活跃
TThostFtdcBoolType IsActive;
};
///交易所交易员
struct CThostFtdcTraderField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装数量
TThostFtdcInstallCountType InstallCount;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
///交易报盘安装数量
TThostFtdcInstallCountType TradeInstallCount;
///行情报盘安装数量
TThostFtdcInstallCountType MDInstallCount;
};
///投资者
struct CThostFtdcInvestorField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者名称
TThostFtdcPartyNameType InvestorName;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///是否活跃
TThostFtdcBoolType IsActive;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///开户日期
TThostFtdcDateType OpenDate;
///手机
TThostFtdcMobileType Mobile;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///是否频率控制
TThostFtdcEnumBoolType IsOrderFreq;
///是否开仓限制
TThostFtdcEnumBoolType IsOpenVolLimit;
};
///交易编码
struct CThostFtdcTradingCodeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///是否活跃
TThostFtdcBoolType IsActive;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
///营业部编号
TThostFtdcBranchIDType BranchID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///会员编码和经纪公司编码对照表
struct CThostFtdcPartBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///是否活跃
TThostFtdcBoolType IsActive;
};
///管理用户
struct CThostFtdcSuperUserField
{
///用户代码
TThostFtdcUserIDType UserID;
///用户名称
TThostFtdcUserNameType UserName;
///密码
TThostFtdcPasswordType Password;
///是否活跃
TThostFtdcBoolType IsActive;
};
///管理用户功能权限
struct CThostFtdcSuperUserFunctionField
{
///用户代码
TThostFtdcUserIDType UserID;
///功能代码
TThostFtdcFunctionCodeType FunctionCode;
};
///投资者组
struct CThostFtdcInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者分组名称
TThostFtdcInvestorGroupNameType InvestorGroupName;
};
///资金账户
struct CThostFtdcTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///业务类型
TThostFtdcBizTypeType BizType;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///投资者持仓
struct CThostFtdcInvestorPositionField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///合约保证金率
struct CThostFtdcInstrumentMarginRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///合约手续费率
struct CThostFtdcInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///深度行情
struct CThostFtdcDepthMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
///当日均价
TThostFtdcPriceType AveragePrice;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
};
///投资者合约交易权限
struct CThostFtdcInstrumentTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///经纪公司用户
struct CThostFtdcBrokerUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户名称
TThostFtdcUserNameType UserName;
///用户类型
TThostFtdcUserTypeType UserType;
///是否活跃
TThostFtdcBoolType IsActive;
///是否使用令牌
TThostFtdcBoolType IsUsingOTP;
///是否强制终端认证
TThostFtdcBoolType IsAuthForce;
};
///经纪公司用户口令
struct CThostFtdcBrokerUserPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///上次修改时间
TThostFtdcDateTimeType LastUpdateTime;
///上次登陆时间
TThostFtdcDateTimeType LastLoginTime;
///密码过期时间
TThostFtdcDateType ExpireDate;
///弱密码过期时间
TThostFtdcDateType WeakExpireDate;
};
///经纪公司用户功能权限
struct CThostFtdcBrokerUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///经纪公司功能代码
TThostFtdcBrokerFunctionCodeType BrokerFunctionCode;
};
///交易所交易员报盘机
struct CThostFtdcTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所交易员连接状态
TThostFtdcTraderConnectStatusType TraderConnectStatus;
///发出连接请求的日期
TThostFtdcDateType ConnectRequestDate;
///发出连接请求的时间
TThostFtdcTimeType ConnectRequestTime;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///完成连接日期
TThostFtdcDateType ConnectDate;
///完成连接时间
TThostFtdcTimeType ConnectTime;
///启动日期
TThostFtdcDateType StartDate;
///启动时间
TThostFtdcTimeType StartTime;
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///本席位最大成交编号
TThostFtdcTradeIDType MaxTradeID;
///本席位最大报单备拷
TThostFtdcReturnCodeType MaxOrderMessageReference;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
};
///投资者结算结果
struct CThostFtdcSettlementInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///消息正文
TThostFtdcContentType Content;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///合约保证金率调整
struct CThostFtdcInstrumentMarginRateAdjustField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所保证金率
struct CThostFtdcExchangeMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所保证金率调整
struct CThostFtdcExchangeMarginRateAdjustField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///跟随交易所投资者多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///跟随交易所投资者多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///跟随交易所投资者空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///跟随交易所投资者空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///交易所多头保证金率
TThostFtdcRatioType ExchLongMarginRatioByMoney;
///交易所多头保证金费
TThostFtdcMoneyType ExchLongMarginRatioByVolume;
///交易所空头保证金率
TThostFtdcRatioType ExchShortMarginRatioByMoney;
///交易所空头保证金费
TThostFtdcMoneyType ExchShortMarginRatioByVolume;
///不跟随交易所投资者多头保证金率
TThostFtdcRatioType NoLongMarginRatioByMoney;
///不跟随交易所投资者多头保证金费
TThostFtdcMoneyType NoLongMarginRatioByVolume;
///不跟随交易所投资者空头保证金率
TThostFtdcRatioType NoShortMarginRatioByMoney;
///不跟随交易所投资者空头保证金费
TThostFtdcMoneyType NoShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///汇率
struct CThostFtdcExchangeRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源币种单位数量
TThostFtdcCurrencyUnitType FromCurrencyUnit;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
};
///结算引用
struct CThostFtdcSettlementRefField
{
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
};
///当前时间
struct CThostFtdcCurrentTimeField
{
///当前交易日
TThostFtdcDateType CurrDate;
///当前时间
TThostFtdcTimeType CurrTime;
///当前时间(毫秒)
TThostFtdcMillisecType CurrMillisec;
///自然日期
TThostFtdcDateType ActionDay;
};
///通讯阶段
struct CThostFtdcCommPhaseField
{
///交易日
TThostFtdcDateType TradingDay;
///通讯时段编号
TThostFtdcCommPhaseNoType CommPhaseNo;
///系统编号
TThostFtdcSystemIDType SystemID;
};
///登录信息
struct CThostFtdcLoginInfoField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录日期
TThostFtdcDateType LoginDate;
///登录时间
TThostFtdcTimeType LoginTime;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///系统名称
TThostFtdcSystemNameType SystemName;
///密码,已弃用
TThostFtdcPasswordType PasswordDeprecated;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///能源中心时间
TThostFtdcTimeType INETime;
///查询时是否需要流控
TThostFtdcBoolType IsQryControl;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///密码
TThostFtdcPasswordType Password;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///登录信息
struct CThostFtdcLogoutAllField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///系统名称
TThostFtdcSystemNameType SystemName;
};
///前置状态
struct CThostFtdcFrontStatusField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///是否活跃
TThostFtdcBoolType IsActive;
};
///用户口令变更
struct CThostFtdcUserPasswordUpdateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
};
///输入报单
struct CThostFtdcInputOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报单
struct CThostFtdcOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///相关报单
TThostFtdcOrderSysIDType RelativeOrderSysID;
///郑商所成交数量
TThostFtdcVolumeType ZCETotalTradedVolume;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///交易所报单
struct CThostFtdcExchangeOrderField
{
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报单插入失败
struct CThostFtdcExchangeOrderInsertErrorField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///输入报单操作
struct CThostFtdcInputOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报单操作
struct CThostFtdcOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///交易所报单操作
struct CThostFtdcExchangeOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报单操作失败
struct CThostFtdcExchangeOrderActionErrorField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易所成交
struct CThostFtdcExchangeTradeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///买卖方向
TThostFtdcDirectionType Direction;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易角色
TThostFtdcTradingRoleType TradingRole;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///价格
TThostFtdcPriceType Price;
///数量
TThostFtdcVolumeType Volume;
///成交时期
TThostFtdcDateType TradeDate;
///成交时间
TThostFtdcTimeType TradeTime;
///成交类型
TThostFtdcTradeTypeType TradeType;
///成交价来源
TThostFtdcPriceSourceType PriceSource;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///序号
TThostFtdcSequenceNoType SequenceNo;
///成交来源
TThostFtdcTradeSourceType TradeSource;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///成交
struct CThostFtdcTradeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///买卖方向
TThostFtdcDirectionType Direction;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易角色
TThostFtdcTradingRoleType TradingRole;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///价格
TThostFtdcPriceType Price;
///数量
TThostFtdcVolumeType Volume;
///成交时期
TThostFtdcDateType TradeDate;
///成交时间
TThostFtdcTimeType TradeTime;
///成交类型
TThostFtdcTradeTypeType TradeType;
///成交价来源
TThostFtdcPriceSourceType PriceSource;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///序号
TThostFtdcSequenceNoType SequenceNo;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///成交来源
TThostFtdcTradeSourceType TradeSource;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///用户会话
struct CThostFtdcUserSessionField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录日期
TThostFtdcDateType LoginDate;
///登录时间
TThostFtdcTimeType LoginTime;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询最大报单数量
struct CThostFtdcQryMaxOrderVolumeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///最大允许报单数量
TThostFtdcVolumeType MaxVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///投资者结算结果确认信息
struct CThostFtdcSettlementInfoConfirmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///确认日期
TThostFtdcDateType ConfirmDate;
///确认时间
TThostFtdcTimeType ConfirmTime;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///出入金同步
struct CThostFtdcSyncDepositField
{
///出入金流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///入金金额
TThostFtdcMoneyType Deposit;
///是否强制进行
TThostFtdcBoolType IsForce;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///是否是个股期权内转
TThostFtdcBoolType IsFromSopt;
///资金密码
TThostFtdcPasswordType TradingPassword;
///是否二级代理商的内转
TThostFtdcBoolType IsSecAgentTranfer;
};
///货币质押同步
struct CThostFtdcSyncFundMortgageField
{
///货币质押流水号
TThostFtdcDepositSeqNoType MortgageSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///质押金额
TThostFtdcMoneyType MortgageAmount;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
};
///经纪公司同步
struct CThostFtdcBrokerSyncField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///正在同步中的投资者
struct CThostFtdcSyncingInvestorField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者名称
TThostFtdcPartyNameType InvestorName;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///是否活跃
TThostFtdcBoolType IsActive;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///开户日期
TThostFtdcDateType OpenDate;
///手机
TThostFtdcMobileType Mobile;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///是否频率控制
TThostFtdcEnumBoolType IsOrderFreq;
///是否开仓限制
TThostFtdcEnumBoolType IsOpenVolLimit;
};
///正在同步中的交易代码
struct CThostFtdcSyncingTradingCodeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///是否活跃
TThostFtdcBoolType IsActive;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
};
///正在同步中的投资者分组
struct CThostFtdcSyncingInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者分组名称
TThostFtdcInvestorGroupNameType InvestorGroupName;
};
///正在同步中的交易账号
struct CThostFtdcSyncingTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///正在同步中的投资者持仓
struct CThostFtdcSyncingInvestorPositionField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约保证金率
struct CThostFtdcSyncingInstrumentMarginRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约手续费率
struct CThostFtdcSyncingInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约交易权限
struct CThostFtdcSyncingInstrumentTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询报单
struct CThostFtdcQryOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询成交
struct CThostFtdcQryTradeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///开始时间
TThostFtdcTimeType TradeTimeStart;
///结束时间
TThostFtdcTimeType TradeTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询投资者持仓
struct CThostFtdcQryInvestorPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询资金账户
struct CThostFtdcQryTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///查询投资者
struct CThostFtdcQryInvestorField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询交易编码
struct CThostFtdcQryTradingCodeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询投资者组
struct CThostFtdcQryInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///查询合约保证金率
struct CThostFtdcQryInstrumentMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询手续费率
struct CThostFtdcQryInstrumentCommissionRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询合约交易权限
struct CThostFtdcQryInstrumentTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司
struct CThostFtdcQryBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///查询交易员
struct CThostFtdcQryTraderField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询管理用户功能权限
struct CThostFtdcQrySuperUserFunctionField
{
///用户代码
TThostFtdcUserIDType UserID;
};
///查询用户会话
struct CThostFtdcQryUserSessionField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询经纪公司会员代码
struct CThostFtdcQryPartBrokerField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
};
///查询前置状态
struct CThostFtdcQryFrontStatusField
{
///前置编号
TThostFtdcFrontIDType FrontID;
};
///查询交易所报单
struct CThostFtdcQryExchangeOrderField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///查询报单操作
struct CThostFtdcQryOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///查询交易所报单操作
struct CThostFtdcQryExchangeOrderActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询管理用户
struct CThostFtdcQrySuperUserField
{
///用户代码
TThostFtdcUserIDType UserID;
};
///查询交易所
struct CThostFtdcQryExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///查询产品
struct CThostFtdcQryProductField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///产品类型
TThostFtdcProductClassType ProductClass;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询合约
struct CThostFtdcQryInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve3;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询行情
struct CThostFtdcQryDepthMarketDataField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///产品类型
TThostFtdcProductClassType ProductClass;
};
///查询经纪公司用户
struct CThostFtdcQryBrokerUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询经纪公司用户权限
struct CThostFtdcQryBrokerUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询交易员报盘机
struct CThostFtdcQryTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询出入金流水
struct CThostFtdcQrySyncDepositField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///出入金流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
};
///查询投资者结算结果
struct CThostFtdcQrySettlementInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易日
TThostFtdcDateType TradingDay;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询交易所保证金率
struct CThostFtdcQryExchangeMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询交易所调整保证金率
struct CThostFtdcQryExchangeMarginRateAdjustField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询汇率
struct CThostFtdcQryExchangeRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
};
///查询货币质押流水
struct CThostFtdcQrySyncFundMortgageField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///货币质押流水号
TThostFtdcDepositSeqNoType MortgageSeqNo;
};
///查询报单
struct CThostFtdcQryHisOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约最小保证金
struct CThostFtdcOptionInstrMiniMarginField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///单位(手)期权合约最小保证金
TThostFtdcMoneyType MinMargin;
///取值方式
TThostFtdcValueMethodType ValueMethod;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约保证金调整系数
struct CThostFtdcOptionInstrMarginAdjustField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约手续费的详细内容
struct CThostFtdcOptionInstrCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权交易成本
struct CThostFtdcOptionInstrTradeCostField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权合约保证金不变部分
TThostFtdcMoneyType FixedMargin;
///期权合约最小保证金
TThostFtdcMoneyType MiniMargin;
///期权合约权利金
TThostFtdcMoneyType Royalty;
///交易所期权合约保证金不变部分
TThostFtdcMoneyType ExchFixedMargin;
///交易所期权合约最小保证金
TThostFtdcMoneyType ExchMiniMargin;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权交易成本查询
struct CThostFtdcQryOptionInstrTradeCostField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权合约报价
TThostFtdcPriceType InputPrice;
///标的价格,填0则用昨结算价
TThostFtdcPriceType UnderlyingPrice;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权手续费率查询
struct CThostFtdcQryOptionInstrCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///股指现货指数
struct CThostFtdcIndexPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///指数现货收盘价
TThostFtdcPriceType ClosePrice;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的执行宣告
struct CThostFtdcInputExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入执行宣告操作
struct CThostFtdcInputExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告
struct CThostFtdcExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///执行宣告提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///执行结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerExecOrderSeq;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告操作
struct CThostFtdcExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///执行类型
TThostFtdcActionTypeType ActionType;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告查询
struct CThostFtdcQryExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所执行宣告信息
struct CThostFtdcExchangeExecOrderField
{
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///执行宣告提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///执行结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所执行宣告查询
struct CThostFtdcQryExchangeExecOrderField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///执行宣告操作查询
struct CThostFtdcQryExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所执行宣告操作
struct CThostFtdcExchangeExecOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///执行类型
TThostFtdcActionTypeType ActionType;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///数量
TThostFtdcVolumeType Volume;
///IP地址
TThostFtdcIPAddressType IPAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///交易所执行宣告操作查询
struct CThostFtdcQryExchangeExecOrderActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///错误执行宣告
struct CThostFtdcErrExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误执行宣告
struct CThostFtdcQryErrExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误执行宣告操作
struct CThostFtdcErrExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误执行宣告操作
struct CThostFtdcQryErrExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///投资者期权合约交易权限
struct CThostFtdcOptionInstrTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///买卖方向
TThostFtdcDirectionType Direction;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询期权合约交易权限
struct CThostFtdcQryOptionInstrTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的询价
struct CThostFtdcInputForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价引用
TThostFtdcOrderRefType ForQuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///询价
struct CThostFtdcForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价引用
TThostFtdcOrderRefType ForQuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///本地询价编号
TThostFtdcOrderLocalIDType ForQuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///询价状态
TThostFtdcForQuoteStatusType ForQuoteStatus;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司询价编号
TThostFtdcSequenceNoType BrokerForQutoSeq;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///询价查询
struct CThostFtdcQryForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所询价信息
struct CThostFtdcExchangeForQuoteField
{
///本地询价编号
TThostFtdcOrderLocalIDType ForQuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///询价状态
TThostFtdcForQuoteStatusType ForQuoteStatus;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所询价查询
struct CThostFtdcQryExchangeForQuoteField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///输入的报价
struct CThostFtdcInputQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///衍生卖报单引用
TThostFtdcOrderRefType AskOrderRef;
///衍生买报单引用
TThostFtdcOrderRefType BidOrderRef;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///被顶单编号
TThostFtdcOrderSysIDType ReplaceSysID;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///输入报价操作
struct CThostFtdcInputQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报价操作引用
TThostFtdcOrderActionRefType QuoteActionRef;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价
struct CThostFtdcQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报价提示序号
TThostFtdcSequenceNoType NotifySequence;
///报价提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///报价状态
TThostFtdcOrderStatusType QuoteStatus;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///卖方报单编号
TThostFtdcOrderSysIDType AskOrderSysID;
///买方报单编号
TThostFtdcOrderSysIDType BidOrderSysID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报价编号
TThostFtdcSequenceNoType BrokerQuoteSeq;
///衍生卖报单引用
TThostFtdcOrderRefType AskOrderRef;
///衍生买报单引用
TThostFtdcOrderRefType BidOrderRef;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///被顶单编号
TThostFtdcOrderSysIDType ReplaceSysID;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价操作
struct CThostFtdcQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报价操作引用
TThostFtdcOrderActionRefType QuoteActionRef;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价查询
struct CThostFtdcQryQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所报价信息
struct CThostFtdcExchangeQuoteField
{
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报价提示序号
TThostFtdcSequenceNoType NotifySequence;
///报价提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///报价状态
TThostFtdcOrderStatusType QuoteStatus;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///卖方报单编号
TThostFtdcOrderSysIDType AskOrderSysID;
///买方报单编号
TThostFtdcOrderSysIDType BidOrderSysID;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
};
///交易所报价查询
struct CThostFtdcQryExchangeQuoteField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///报价操作查询
struct CThostFtdcQryQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所报价操作
struct CThostFtdcExchangeQuoteActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报价操作查询
struct CThostFtdcQryExchangeQuoteActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///期权合约delta值
struct CThostFtdcOptionInstrDeltaField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///Delta值
TThostFtdcRatioType Delta;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///发给做市商的询价请求
struct CThostFtdcForQuoteRspField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///询价时间
TThostFtdcTimeType ForQuoteTime;
///业务日期
TThostFtdcDateType ActionDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约执行偏移值的详细内容
struct CThostFtdcStrikeOffsetField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行偏移值
TThostFtdcMoneyType Offset;
///执行偏移类型
TThostFtdcStrikeOffsetTypeType OffsetType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权执行偏移值查询
struct CThostFtdcQryStrikeOffsetField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入批量报单操作
struct CThostFtdcInputBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///用户代码
TThostFtdcUserIDType UserID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///批量报单操作
struct CThostFtdcBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所批量报单操作
struct CThostFtdcExchangeBatchOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询批量报单操作
struct CThostFtdcQryBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///组合合约安全系数
struct CThostFtdcCombInstrumentGuardField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///
TThostFtdcRatioType GuarantRatio;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///组合合约安全系数查询
struct CThostFtdcQryCombInstrumentGuardField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的申请组合
struct CThostFtdcInputCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///组合引用
TThostFtdcOrderRefType CombActionRef;
///用户代码
TThostFtdcUserIDType UserID;
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///申请组合
struct CThostFtdcCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///组合引用
TThostFtdcOrderRefType CombActionRef;
///用户代码
TThostFtdcUserIDType UserID;
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///本地申请组合编号
TThostFtdcOrderLocalIDType ActionLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///组合状态
TThostFtdcOrderActionStatusType ActionStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///申请组合查询
struct CThostFtdcQryCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所申请组合信息
struct CThostFtdcExchangeCombActionField
{
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///本地申请组合编号
TThostFtdcOrderLocalIDType ActionLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///组合状态
TThostFtdcOrderActionStatusType ActionStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所申请组合查询
struct CThostFtdcQryExchangeCombActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///产品报价汇率
struct CThostFtdcProductExchRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价币种类型
TThostFtdcCurrencyIDType QuoteCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///产品报价汇率查询
struct CThostFtdcQryProductExchRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询询价价差参数
struct CThostFtdcQryForQuoteParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///询价价差参数
struct CThostFtdcForQuoteParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///最新价
TThostFtdcPriceType LastPrice;
///价差
TThostFtdcPriceType PriceInterval;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前做市商期权合约手续费的详细内容
struct CThostFtdcMMOptionInstrCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///做市商期权手续费率查询
struct CThostFtdcQryMMOptionInstrCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///做市商合约手续费率
struct CThostFtdcMMInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询做市商合约手续费率
struct CThostFtdcQryMMInstrumentCommissionRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前报单手续费的详细内容
struct CThostFtdcInstrumentOrderCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///报单手续费
TThostFtdcRatioType OrderCommByVolume;
///撤单手续费
TThostFtdcRatioType OrderActionCommByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///报单手续费
TThostFtdcRatioType OrderCommByTrade;
///撤单手续费
TThostFtdcRatioType OrderActionCommByTrade;
};
///报单手续费率查询
struct CThostFtdcQryInstrumentOrderCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易参数
struct CThostFtdcTradeParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///参数代码
TThostFtdcTradeParamIDType TradeParamID;
///参数代码值
TThostFtdcSettlementParamValueType TradeParamValue;
///备注
TThostFtdcMemoType Memo;
};
///合约保证金率调整
struct CThostFtdcInstrumentMarginRateULField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期货持仓限制参数
struct CThostFtdcFutureLimitPosiParamField
{
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///当日投机开仓数量限制
TThostFtdcVolumeType SpecOpenVolume;
///当日套利开仓数量限制
TThostFtdcVolumeType ArbiOpenVolume;
///当日投机+套利开仓数量限制
TThostFtdcVolumeType OpenVolume;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///禁止登录IP
struct CThostFtdcLoginForbiddenIPField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///IP列表
struct CThostFtdcIPListField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///是否白名单
TThostFtdcBoolType IsWhite;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入的期权自对冲
struct CThostFtdcInputOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入期权自对冲操作
struct CThostFtdcInputOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期权自对冲操作引用
TThostFtdcOrderActionRefType OptionSelfCloseActionRef;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲
struct CThostFtdcOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///期权自对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///自对冲结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOptionSelfCloseSeq;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲操作
struct CThostFtdcOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期权自对冲操作引用
TThostFtdcOrderActionRefType OptionSelfCloseActionRef;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲查询
struct CThostFtdcQryOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所期权自对冲信息
struct CThostFtdcExchangeOptionSelfCloseField
{
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///期权自对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///自对冲结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲操作查询
struct CThostFtdcQryOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所期权自对冲操作
struct CThostFtdcExchangeOptionSelfCloseActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///IP地址
TThostFtdcIPAddressType IPAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///延时换汇同步
struct CThostFtdcSyncDelaySwapField
{
///换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源金额
TThostFtdcMoneyType FromAmount;
///源换汇冻结金额(可用冻结)
TThostFtdcMoneyType FromFrozenSwap;
///源剩余换汇额度(可提冻结)
TThostFtdcMoneyType FromRemainSwap;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
///目标金额
TThostFtdcMoneyType ToAmount;
///是否手工换汇
TThostFtdcBoolType IsManualSwap;
///是否将所有外币的剩余换汇额度设置为0
TThostFtdcBoolType IsAllRemainSetZero;
};
///查询延时换汇同步
struct CThostFtdcQrySyncDelaySwapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///延时换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
};
///投资单元
struct CThostFtdcInvestUnitField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///投资者单元名称
TThostFtdcPartyNameType InvestorUnitName;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询投资单元
struct CThostFtdcQryInvestUnitField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///二级代理商资金校验模式
struct CThostFtdcSecAgentCheckModeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
///是否需要校验自己的资金账户
TThostFtdcBoolType CheckSelfAccount;
};
///二级代理商信息
struct CThostFtdcSecAgentTradeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///二级代理商姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///市场行情
struct CThostFtdcMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///行情基础属性
struct CThostFtdcMarketDataBaseField
{
///交易日
TThostFtdcDateType TradingDay;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///昨虚实度
TThostFtdcRatioType PreDelta;
};
///行情静态属性
struct CThostFtdcMarketDataStaticField
{
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///今收盘
TThostFtdcPriceType ClosePrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///今虚实度
TThostFtdcRatioType CurrDelta;
};
///行情最新成交属性
struct CThostFtdcMarketDataLastMatchField
{
///最新价
TThostFtdcPriceType LastPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
};
///行情最优价属性
struct CThostFtdcMarketDataBestPriceField
{
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
};
///行情申买二、三属性
struct CThostFtdcMarketDataBid23Field
{
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
};
///行情申卖二、三属性
struct CThostFtdcMarketDataAsk23Field
{
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
};
///行情申买四、五属性
struct CThostFtdcMarketDataBid45Field
{
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
};
///行情申卖四、五属性
struct CThostFtdcMarketDataAsk45Field
{
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
};
///行情更新时间属性
struct CThostFtdcMarketDataUpdateTimeField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///行情上下带价
struct CThostFtdcMarketDataBandingPriceField
{
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
};
///行情交易所代码属性
struct CThostFtdcMarketDataExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///指定的合约
struct CThostFtdcSpecificInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///合约状态
struct CThostFtdcInstrumentStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///结算组代码
TThostFtdcSettlementGroupIDType SettlementGroupID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///合约交易状态
TThostFtdcInstrumentStatusType InstrumentStatus;
///交易阶段编号
TThostFtdcTradingSegmentSNType TradingSegmentSN;
///进入本状态时间
TThostFtdcTimeType EnterTime;
///进入本状态原因
TThostFtdcInstStatusEnterReasonType EnterReason;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询合约状态
struct CThostFtdcQryInstrumentStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///投资者账户
struct CThostFtdcInvestorAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///浮动盈亏算法
struct CThostFtdcPositionProfitAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///盈亏算法
TThostFtdcAlgorithmType Algorithm;
///备注
TThostFtdcMemoType Memo;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///会员资金折扣
struct CThostFtdcDiscountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///资金折扣比例
TThostFtdcRatioType Discount;
};
///查询转帐银行
struct CThostFtdcQryTransferBankField
{
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
};
///转帐银行
struct CThostFtdcTransferBankField
{
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行名称
TThostFtdcBankNameType BankName;
///是否活跃
TThostFtdcBoolType IsActive;
};
///查询投资者持仓明细
struct CThostFtdcQryInvestorPositionDetailField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///投资者持仓明细
struct CThostFtdcInvestorPositionDetailField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///开仓日期
TThostFtdcDateType OpenDate;
///成交编号
TThostFtdcTradeIDType TradeID;
///数量
TThostFtdcVolumeType Volume;
///开仓价
TThostFtdcPriceType OpenPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///成交类型
TThostFtdcTradeTypeType TradeType;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///逐日盯市持仓盈亏
TThostFtdcMoneyType PositionProfitByDate;
///逐笔对冲持仓盈亏
TThostFtdcMoneyType PositionProfitByTrade;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///昨结算价
TThostFtdcPriceType LastSettlementPrice;
///结算价
TThostFtdcPriceType SettlementPrice;
///平仓量
TThostFtdcVolumeType CloseVolume;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///先开先平剩余数量
TThostFtdcVolumeType TimeFirstVolume;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///特殊持仓标志
TThostFtdcSpecPosiTypeType SpecPosiType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///资金账户口令域
struct CThostFtdcTradingAccountPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///交易所行情报盘机
struct CThostFtdcMDTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所交易员连接状态
TThostFtdcTraderConnectStatusType TraderConnectStatus;
///发出连接请求的日期
TThostFtdcDateType ConnectRequestDate;
///发出连接请求的时间
TThostFtdcTimeType ConnectRequestTime;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///完成连接日期
TThostFtdcDateType ConnectDate;
///完成连接时间
TThostFtdcTimeType ConnectTime;
///启动日期
TThostFtdcDateType StartDate;
///启动时间
TThostFtdcTimeType StartTime;
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///本席位最大成交编号
TThostFtdcTradeIDType MaxTradeID;
///本席位最大报单备拷
TThostFtdcReturnCodeType MaxOrderMessageReference;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
};
///查询行情报盘机
struct CThostFtdcQryMDTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询客户通知
struct CThostFtdcQryNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///客户通知
struct CThostFtdcNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///消息正文
TThostFtdcContentType Content;
///经纪公司通知内容序列号
TThostFtdcSequenceLabelType SequenceLabel;
};
///用户权限
struct CThostFtdcUserRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///客户权限类型
TThostFtdcUserRightTypeType UserRightType;
///是否禁止
TThostFtdcBoolType IsForbidden;
};
///查询结算信息确认域
struct CThostFtdcQrySettlementInfoConfirmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///装载结算信息
struct CThostFtdcLoadSettlementInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///经纪公司可提资金算法表
struct CThostFtdcBrokerWithdrawAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///可提资金算法
TThostFtdcAlgorithmType WithdrawAlgorithm;
///资金使用率
TThostFtdcRatioType UsingRatio;
///可提是否包含平仓盈利
TThostFtdcIncludeCloseProfitType IncludeCloseProfit;
///本日无仓且无成交客户是否受可提比例限制
TThostFtdcAllWithoutTradeType AllWithoutTrade;
///可用是否包含平仓盈利
TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit;
///是否启用用户事件
TThostFtdcBoolType IsBrokerUserEvent;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///货币质押比率
TThostFtdcRatioType FundMortgageRatio;
///权益算法
TThostFtdcBalanceAlgorithmType BalanceAlgorithm;
};
///资金账户口令变更域
struct CThostFtdcTradingAccountPasswordUpdateV1Field
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
};
///资金账户口令变更域
struct CThostFtdcTradingAccountPasswordUpdateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询组合合约分腿
struct CThostFtdcQryCombinationLegField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///单腿编号
TThostFtdcLegIDType LegID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///查询组合合约分腿
struct CThostFtdcQrySyncStatusField
{
///交易日
TThostFtdcDateType TradingDay;
};
///组合交易合约的单腿
struct CThostFtdcCombinationLegField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///单腿编号
TThostFtdcLegIDType LegID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///派生层数
TThostFtdcImplyLevelType ImplyLevel;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///数据同步状态
struct CThostFtdcSyncStatusField
{
///交易日
TThostFtdcDateType TradingDay;
///数据同步状态
TThostFtdcDataSyncStatusType DataSyncStatus;
};
///查询联系人
struct CThostFtdcQryLinkManField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///联系人
struct CThostFtdcLinkManField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///联系人类型
TThostFtdcPersonTypeType PersonType;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///名称
TThostFtdcPartyNameType PersonName;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///邮政编码
TThostFtdcZipCodeType ZipCode;
///优先级
TThostFtdcPriorityType Priority;
///开户邮政编码
TThostFtdcUOAZipCodeType UOAZipCode;
///全称
TThostFtdcInvestorFullNameType PersonFullName;
};
///查询经纪公司用户事件
struct CThostFtdcQryBrokerUserEventField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户事件类型
TThostFtdcUserEventTypeType UserEventType;
};
///查询经纪公司用户事件
struct CThostFtdcBrokerUserEventField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户事件类型
TThostFtdcUserEventTypeType UserEventType;
///用户事件序号
TThostFtdcSequenceNoType EventSequenceNo;
///事件发生日期
TThostFtdcDateType EventDate;
///事件发生时间
TThostFtdcTimeType EventTime;
///用户事件信息
TThostFtdcUserEventInfoType UserEventInfo;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易日
TThostFtdcDateType TradingDay;
};
///查询签约银行请求
struct CThostFtdcQryContractBankField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
};
///查询签约银行响应
struct CThostFtdcContractBankField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行名称
TThostFtdcBankNameType BankName;
};
///投资者组合持仓明细
struct CThostFtdcInvestorPositionCombineDetailField
{
///交易日
TThostFtdcDateType TradingDay;
///开仓日期
TThostFtdcDateType OpenDate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///撮合编号
TThostFtdcTradeIDType TradeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///持仓量
TThostFtdcVolumeType TotalAmt;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合持仓合约编码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///预埋单
struct CThostFtdcParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///预埋报单编号
TThostFtdcParkedOrderIDType ParkedOrderID;
///用户类型
TThostFtdcUserTypeType UserType;
///预埋单状态
TThostFtdcParkedOrderStatusType Status;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入预埋单操作
struct CThostFtdcParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///预埋撤单单编号
TThostFtdcParkedOrderActionIDType ParkedOrderActionID;
///用户类型
TThostFtdcUserTypeType UserType;
///预埋撤单状态
TThostFtdcParkedOrderStatusType Status;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询预埋单
struct CThostFtdcQryParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询预埋撤单
struct CThostFtdcQryParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///删除预埋单
struct CThostFtdcRemoveParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///预埋报单编号
TThostFtdcParkedOrderIDType ParkedOrderID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///删除预埋撤单
struct CThostFtdcRemoveParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///预埋撤单编号
TThostFtdcParkedOrderActionIDType ParkedOrderActionID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///经纪公司可提资金算法表
struct CThostFtdcInvestorWithdrawAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///可提资金比例
TThostFtdcRatioType UsingRatio;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///货币质押比率
TThostFtdcRatioType FundMortgageRatio;
};
///查询组合持仓明细
struct CThostFtdcQryInvestorPositionCombineDetailField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///组合持仓合约编码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///成交均价
struct CThostFtdcMarketDataAveragePriceField
{
///当日均价
TThostFtdcPriceType AveragePrice;
};
///校验投资者密码
struct CThostFtdcVerifyInvestorPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///密码
TThostFtdcPasswordType Password;
};
///用户IP
struct CThostFtdcUserIPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
///IP地址掩码
TThostFtdcIPAddressType IPMask;
};
///用户事件通知信息
struct CThostFtdcTradingNoticeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///发送时间
TThostFtdcTimeType SendTime;
///消息正文
TThostFtdcContentType FieldContent;
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///用户事件通知
struct CThostFtdcTradingNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///用户代码
TThostFtdcUserIDType UserID;
///发送时间
TThostFtdcTimeType SendTime;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///消息正文
TThostFtdcContentType FieldContent;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询交易事件通知
struct CThostFtdcQryTradingNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询错误报单
struct CThostFtdcQryErrOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误报单
struct CThostFtdcErrOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///查询错误报单操作
struct CThostFtdcErrorConditionalOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///相关报单
TThostFtdcOrderSysIDType RelativeOrderSysID;
///郑商所成交数量
TThostFtdcVolumeType ZCETotalTradedVolume;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误报单操作
struct CThostFtdcQryErrOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误报单操作
struct CThostFtdcErrOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///查询交易所状态
struct CThostFtdcQryExchangeSequenceField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所状态
struct CThostFtdcExchangeSequenceField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///合约交易状态
TThostFtdcInstrumentStatusType MarketStatus;
};
///根据价格查询最大报单数量
struct CThostFtdcQryMaxOrderVolumeWithPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///最大允许报单数量
TThostFtdcVolumeType MaxVolume;
///报单价格
TThostFtdcPriceType Price;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司交易参数
struct CThostFtdcQryBrokerTradingParamsField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///经纪公司交易参数
struct CThostFtdcBrokerTradingParamsField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保证金价格类型
TThostFtdcMarginPriceTypeType MarginPriceType;
///盈亏算法
TThostFtdcAlgorithmType Algorithm;
///可用是否包含平仓盈利
TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期权权利金价格类型
TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///查询经纪公司交易算法
struct CThostFtdcQryBrokerTradingAlgosField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///经纪公司交易算法
struct CThostFtdcBrokerTradingAlgosField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///持仓处理算法编号
TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID;
///寻找保证金率算法编号
TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID;
///资金处理算法编号
TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司资金
struct CThostFtdcQueryBrokerDepositField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///经纪公司资金
struct CThostFtdcBrokerDepositField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///可提资金
TThostFtdcMoneyType Available;
///基本准备金
TThostFtdcMoneyType Reserve;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
};
///查询保证金监管系统经纪公司密钥
struct CThostFtdcQryCFMMCBrokerKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///保证金监管系统经纪公司密钥
struct CThostFtdcCFMMCBrokerKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///密钥生成日期
TThostFtdcDateType CreateDate;
///密钥生成时间
TThostFtdcTimeType CreateTime;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态密钥
TThostFtdcCFMMCKeyType CurrentKey;
///动态密钥类型
TThostFtdcCFMMCKeyKindType KeyKind;
};
///保证金监管系统经纪公司资金账户密钥
struct CThostFtdcCFMMCTradingAccountKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态密钥
TThostFtdcCFMMCKeyType CurrentKey;
};
///请求查询保证金监管系统经纪公司资金账户密钥
struct CThostFtdcQryCFMMCTradingAccountKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///用户动态令牌参数
struct CThostFtdcBrokerUserOTPParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///动态令牌提供商
TThostFtdcOTPVendorsIDType OTPVendorsID;
///动态令牌序列号
TThostFtdcSerialNumberType SerialNumber;
///令牌密钥
TThostFtdcAuthKeyType AuthKey;
///漂移值
TThostFtdcLastDriftType LastDrift;
///成功值
TThostFtdcLastSuccessType LastSuccess;
///动态令牌类型
TThostFtdcOTPTypeType OTPType;
};
///手工同步用户动态令牌
struct CThostFtdcManualSyncBrokerUserOTPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///动态令牌类型
TThostFtdcOTPTypeType OTPType;
///第一个动态密码
TThostFtdcPasswordType FirstOTP;
///第二个动态密码
TThostFtdcPasswordType SecondOTP;
};
///投资者手续费率模板
struct CThostFtdcCommRateModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///模板名称
TThostFtdcCommModelNameType CommModelName;
};
///请求查询投资者手续费率模板
struct CThostFtdcQryCommRateModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
};
///投资者保证金率模板
struct CThostFtdcMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///模板名称
TThostFtdcCommModelNameType MarginModelName;
};
///请求查询投资者保证金率模板
struct CThostFtdcQryMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
};
///仓单折抵信息
struct CThostFtdcEWarrantOffsetField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///数量
TThostFtdcVolumeType Volume;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询仓单折抵信息
struct CThostFtdcQryEWarrantOffsetField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询投资者品种/跨品种保证金
struct CThostFtdcQryInvestorProductGroupMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///品种/跨品种标示
TThostFtdcInstrumentIDType ProductGroupID;
};
///投资者品种/跨品种保证金
struct CThostFtdcInvestorProductGroupMarginField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///多头冻结的保证金
TThostFtdcMoneyType LongFrozenMargin;
///空头冻结的保证金
TThostFtdcMoneyType ShortFrozenMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///多头保证金
TThostFtdcMoneyType LongUseMargin;
///空头保证金
TThostFtdcMoneyType ShortUseMargin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///交易所多头保证金
TThostFtdcMoneyType LongExchMargin;
///交易所空头保证金
TThostFtdcMoneyType ShortExchMargin;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///折抵总金额
TThostFtdcMoneyType OffsetAmount;
///多头折抵总金额
TThostFtdcMoneyType LongOffsetAmount;
///空头折抵总金额
TThostFtdcMoneyType ShortOffsetAmount;
///交易所折抵总金额
TThostFtdcMoneyType ExchOffsetAmount;
///交易所多头折抵总金额
TThostFtdcMoneyType LongExchOffsetAmount;
///交易所空头折抵总金额
TThostFtdcMoneyType ShortExchOffsetAmount;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///品种/跨品种标示
TThostFtdcInstrumentIDType ProductGroupID;
};
///查询监控中心用户令牌
struct CThostFtdcQueryCFMMCTradingAccountTokenField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///监控中心用户令牌
struct CThostFtdcCFMMCTradingAccountTokenField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态令牌
TThostFtdcCFMMCTokenType Token;
};
///查询产品组
struct CThostFtdcQryProductGroupField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///投资者品种/跨品种保证金产品组
struct CThostFtdcProductGroupField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///产品组代码
TThostFtdcInstrumentIDType ProductGroupID;
};
///交易所公告
struct CThostFtdcBulletinField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易日
TThostFtdcDateType TradingDay;
///公告编号
TThostFtdcBulletinIDType BulletinID;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///公告类型
TThostFtdcNewsTypeType NewsType;
///紧急程度
TThostFtdcNewsUrgencyType NewsUrgency;
///发送时间
TThostFtdcTimeType SendTime;
///消息摘要
TThostFtdcAbstractType Abstract;
///消息来源
TThostFtdcComeFromType ComeFrom;
///消息正文
TThostFtdcContentType Content;
///WEB地址
TThostFtdcURLLinkType URLLink;
///市场代码
TThostFtdcMarketIDType MarketID;
};
///查询交易所公告
struct CThostFtdcQryBulletinField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///公告编号
TThostFtdcBulletinIDType BulletinID;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///公告类型
TThostFtdcNewsTypeType NewsType;
///紧急程度
TThostFtdcNewsUrgencyType NewsUrgency;
};
///MulticastInstrument
struct CThostFtdcMulticastInstrumentField
{
///主题号
TThostFtdcInstallIDType TopicID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约编号
TThostFtdcInstallIDType InstrumentNo;
///基准价
TThostFtdcPriceType CodePrice;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///QryMulticastInstrument
struct CThostFtdcQryMulticastInstrumentField
{
///主题号
TThostFtdcInstallIDType TopicID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///App客户端权限分配
struct CThostFtdcAppIDAuthAssignField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///转帐开户请求
struct CThostFtdcReqOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///转帐销户请求
struct CThostFtdcReqCancelAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///变更银行账户请求
struct CThostFtdcReqChangeAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///新银行帐号
TThostFtdcBankAccountType NewBankAccount;
///新银行密码
TThostFtdcPasswordType NewBankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易ID
TThostFtdcTIDType TID;
///摘要
TThostFtdcDigestType Digest;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///转账请求
struct CThostFtdcReqTransferField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银行发起银行资金转期货响应
struct CThostFtdcRspTransferField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///冲正请求
struct CThostFtdcReqRepealField
{
///冲正时间间隔
TThostFtdcRepealTimeIntervalType RepealTimeInterval;
///已经冲正次数
TThostFtdcRepealedTimesType RepealedTimes;
///银行冲正标志
TThostFtdcBankRepealFlagType BankRepealFlag;
///期商冲正标志
TThostFtdcBrokerRepealFlagType BrokerRepealFlag;
///被冲正平台流水号
TThostFtdcPlateSerialType PlateRepealSerial;
///被冲正银行流水号
TThostFtdcBankSerialType BankRepealSerial;
///被冲正期货流水号
TThostFtdcFutureSerialType FutureRepealSerial;
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///冲正响应
struct CThostFtdcRspRepealField
{
///冲正时间间隔
TThostFtdcRepealTimeIntervalType RepealTimeInterval;
///已经冲正次数
TThostFtdcRepealedTimesType RepealedTimes;
///银行冲正标志
TThostFtdcBankRepealFlagType BankRepealFlag;
///期商冲正标志
TThostFtdcBrokerRepealFlagType BrokerRepealFlag;
///被冲正平台流水号
TThostFtdcPlateSerialType PlateRepealSerial;
///被冲正银行流水号
TThostFtdcBankSerialType BankRepealSerial;
///被冲正期货流水号
TThostFtdcFutureSerialType FutureRepealSerial;
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询账户信息请求
struct CThostFtdcReqQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询账户信息响应
struct CThostFtdcRspQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///期商签到签退
struct CThostFtdcFutureSignIOField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///期商签到响应
struct CThostFtdcRspFutureSignInField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///PIN密钥
TThostFtdcPasswordKeyType PinKey;
///MAC密钥
TThostFtdcPasswordKeyType MacKey;
};
///期商签退请求
struct CThostFtdcReqFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///期商签退响应
struct CThostFtdcRspFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///查询指定流水号的交易结果请求
struct CThostFtdcReqQueryTradeResultBySerialField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///流水号
TThostFtdcSerialType Reference;
///本流水号发布者的机构类型
TThostFtdcInstitutionTypeType RefrenceIssureType;
///本流水号发布者机构编码
TThostFtdcOrganCodeType RefrenceIssure;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///摘要
TThostFtdcDigestType Digest;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询指定流水号的交易结果响应
struct CThostFtdcRspQueryTradeResultBySerialField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///流水号
TThostFtdcSerialType Reference;
///本流水号发布者的机构类型
TThostFtdcInstitutionTypeType RefrenceIssureType;
///本流水号发布者机构编码
TThostFtdcOrganCodeType RefrenceIssure;
///原始返回代码
TThostFtdcReturnCodeType OriginReturnCode;
///原始返回码描述
TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///摘要
TThostFtdcDigestType Digest;
};
///日终文件就绪请求
struct CThostFtdcReqDayEndFileReadyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///文件业务功能
TThostFtdcFileBusinessCodeType FileBusinessCode;
///摘要
TThostFtdcDigestType Digest;
};
///返回结果
struct CThostFtdcReturnResultField
{
///返回代码
TThostFtdcReturnCodeType ReturnCode;
///返回码描述
TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode;
};
///验证期货资金密码
struct CThostFtdcVerifyFuturePasswordField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///交易ID
TThostFtdcTIDType TID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///验证客户信息
struct CThostFtdcVerifyCustInfoField
{
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///验证期货资金密码和客户信息
struct CThostFtdcVerifyFuturePasswordAndCustInfoField
{
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///验证期货资金密码和客户信息
struct CThostFtdcDepositResultInformField
{
///出入金流水号,该流水号为银期报盘返回的流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///入金金额
TThostFtdcMoneyType Deposit;
///请求编号
TThostFtdcRequestIDType RequestID;
///返回代码
TThostFtdcReturnCodeType ReturnCode;
///返回码描述
TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode;
};
///交易核心向银期报盘发出密钥同步请求
struct CThostFtdcReqSyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///交易核心向银期报盘发出密钥同步响应
struct CThostFtdcRspSyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///查询账户信息通知
struct CThostFtdcNotifyQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期转账交易流水表
struct CThostFtdcTransferSerialField
{
///平台流水号
TThostFtdcPlateSerialType PlateSerial;
///交易发起方日期
TThostFtdcTradeDateType TradeDate;
///交易日期
TThostFtdcDateType TradingDay;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///交易代码
TThostFtdcTradeCodeType TradeCode;
///会话编号
TThostFtdcSessionIDType SessionID;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///期货公司编码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///期货公司帐号类型
TThostFtdcFutureAccTypeType FutureAccType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易金额
TThostFtdcTradeAmountType TradeAmount;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///有效标志
TThostFtdcAvailabilityFlagType AvailabilityFlag;
///操作员
TThostFtdcOperatorCodeType OperatorCode;
///新银行帐号
TThostFtdcBankAccountType BankNewAccount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///请求查询转帐流水
struct CThostFtdcQryTransferSerialField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行编码
TThostFtdcBankIDType BankID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///期商签到通知
struct CThostFtdcNotifyFutureSignInField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///PIN密钥
TThostFtdcPasswordKeyType PinKey;
///MAC密钥
TThostFtdcPasswordKeyType MacKey;
};
///期商签退通知
struct CThostFtdcNotifyFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易核心向银期报盘发出密钥同步处理结果的通知
struct CThostFtdcNotifySyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///请求查询银期签约关系
struct CThostFtdcQryAccountregisterField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///客户开销户信息表
struct CThostFtdcAccountregisterField
{
///交易日期
TThostFtdcTradeDateType TradeDay;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///期货公司编码
TThostFtdcBrokerIDType BrokerID;
///期货公司分支机构编码
TThostFtdcFutureBranchIDType BrokerBranchID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///开销户类别
TThostFtdcOpenOrDestroyType OpenOrDestroy;
///签约日期
TThostFtdcTradeDateType RegDate;
///解约日期
TThostFtdcTradeDateType OutDate;
///交易ID
TThostFtdcTIDType TID;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期开户信息
struct CThostFtdcOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期销户信息
struct CThostFtdcCancelAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期变更银行账号信息
struct CThostFtdcChangeAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///新银行帐号
TThostFtdcBankAccountType NewBankAccount;
///新银行密码
TThostFtdcPasswordType NewBankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易ID
TThostFtdcTIDType TID;
///摘要
TThostFtdcDigestType Digest;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///二级代理操作员银期权限
struct CThostFtdcSecAgentACIDMapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///资金账户
TThostFtdcAccountIDType AccountID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
};
///二级代理操作员银期权限查询
struct CThostFtdcQrySecAgentACIDMapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///资金账户
TThostFtdcAccountIDType AccountID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
};
///灾备中心交易权限
struct CThostFtdcUserRightsAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///经济公司是否有在本标示的交易权限
struct CThostFtdcBrokerUserRightAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///能否交易
TThostFtdcBoolType Tradeable;
};
///灾备交易转换报文
struct CThostFtdcDRTransferField
{
///原交易中心代码
TThostFtdcDRIdentityIDType OrigDRIdentityID;
///目标交易中心代码
TThostFtdcDRIdentityIDType DestDRIdentityID;
///原应用单元代码
TThostFtdcBrokerIDType OrigBrokerID;
///目标易用单元代码
TThostFtdcBrokerIDType DestBrokerID;
};
///Fens用户信息
struct CThostFtdcFensUserInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录模式
TThostFtdcLoginModeType LoginMode;
};
///当前银期所属交易中心
struct CThostFtdcCurrTransferIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType IdentityID;
};
///禁止登录用户
struct CThostFtdcLoginForbiddenUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询禁止登录用户
struct CThostFtdcQryLoginForbiddenUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///资金账户基本准备金
struct CThostFtdcTradingAccountReserveField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///基本准备金
TThostFtdcMoneyType Reserve;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询禁止登录IP
struct CThostFtdcQryLoginForbiddenIPField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询IP列表
struct CThostFtdcQryIPListField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询用户下单权限分配表
struct CThostFtdcQryUserRightsAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///银期预约开户确认请求
struct CThostFtdcReserveOpenAccountConfirmField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcLongIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易ID
TThostFtdcTIDType TID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///预约开户银行流水号
TThostFtdcBankSerialType BankReserveOpenSeq;
///预约开户日期
TThostFtdcTradeDateType BookDate;
///预约开户验证密码
TThostFtdcPasswordType BookPsw;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///银期预约开户
struct CThostFtdcReserveOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcLongIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易ID
TThostFtdcTIDType TID;
///预约开户状态
TThostFtdcReserveOpenAccStasType ReserveOpenAccStas;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///银行账户属性
struct CThostFtdcAccountPropertyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行统一标识类型
TThostFtdcBankIDType BankID;
///银行账户
TThostFtdcBankAccountType BankAccount;
///银行账户的开户人名称
TThostFtdcInvestorFullNameType OpenName;
///银行账户的开户行
TThostFtdcOpenBankType OpenBank;
///是否活跃
TThostFtdcBoolType IsActive;
///账户来源
TThostFtdcAccountSourceTypeType AccountSourceType;
///开户日期
TThostFtdcDateType OpenDate;
///注销日期
TThostFtdcDateType CancelDate;
///录入员代码
TThostFtdcOperatorIDType OperatorID;
///录入日期
TThostFtdcDateType OperateDate;
///录入时间
TThostFtdcTimeType OperateTime;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询当前交易中心
struct CThostFtdcQryCurrDRIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///当前交易中心
struct CThostFtdcCurrDRIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///查询二级代理商资金校验模式
struct CThostFtdcQrySecAgentCheckModeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询二级代理商信息
struct CThostFtdcQrySecAgentTradeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqUserAuthMethodField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///用户发出获取安全安全登陆方法回复
struct CThostFtdcRspUserAuthMethodField
{
///当前可以用的认证模式
TThostFtdcCurrentAuthMethodType UsableAuthMethod;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqGenUserCaptchaField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///生成的图片验证码信息
struct CThostFtdcRspGenUserCaptchaField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///图片信息长度
TThostFtdcCaptchaInfoLenType CaptchaInfoLen;
///图片信息
TThostFtdcCaptchaInfoType CaptchaInfo;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqGenUserTextField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///短信验证码生成的回复
struct CThostFtdcRspGenUserTextField
{
///短信验证码序号
TThostFtdcUserTextSeqType UserTextSeq;
};
///用户发出带图形验证码的登录请求请求
struct CThostFtdcReqUserLoginWithCaptchaField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///图形验证码的文字内容
TThostFtdcPasswordType Captcha;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户发出带短信验证码的登录请求请求
struct CThostFtdcReqUserLoginWithTextField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///短信验证码文字内容
TThostFtdcPasswordType Text;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户发出带动态验证码的登录请求请求
struct CThostFtdcReqUserLoginWithOTPField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///OTP密码
TThostFtdcPasswordType OTPPassword;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///api握手请求
struct CThostFtdcReqApiHandshakeField
{
///api与front通信密钥版本号
TThostFtdcCryptoKeyVersionType CryptoKeyVersion;
};
///front发给api的握手回复
struct CThostFtdcRspApiHandshakeField
{
///握手回复数据长度
TThostFtdcHandshakeDataLenType FrontHandshakeDataLen;
///握手回复数据
TThostFtdcHandshakeDataType FrontHandshakeData;
///API认证是否开启
TThostFtdcBoolType IsApiAuthEnabled;
};
///api给front的验证key的请求
struct CThostFtdcReqVerifyApiKeyField
{
///握手回复数据长度
TThostFtdcHandshakeDataLenType ApiHandshakeDataLen;
///握手回复数据
TThostFtdcHandshakeDataType ApiHandshakeData;
};
///操作员组织架构关系
struct CThostFtdcDepartmentUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///投资者范围
TThostFtdcDepartmentRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询频率,每秒查询比数
struct CThostFtdcQueryFreqField
{
///查询频率
TThostFtdcQueryFreqType QueryFreq;
///FTD频率
TThostFtdcQueryFreqType FTDPkgFreq;
};
///禁止认证IP
struct CThostFtdcAuthForbiddenIPField
{
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询禁止认证IP
struct CThostFtdcQryAuthForbiddenIPField
{
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///换汇可提冻结
struct CThostFtdcSyncDelaySwapFrozenField
{
///换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源剩余换汇额度(可提冻结)
TThostFtdcMoneyType FromRemainSwap;
///是否手工换汇
TThostFtdcBoolType IsManualSwap;
};
///用户系统信息
struct CThostFtdcUserSystemInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端系统内部信息长度
TThostFtdcSystemInfoLenType ClientSystemInfoLen;
///用户端系统内部信息
TThostFtdcClientSystemInfoType ClientSystemInfo;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///登录成功时间
TThostFtdcTimeType ClientLoginTime;
///App代码
TThostFtdcAppIDType ClientAppID;
///用户公网IP
TThostFtdcIPAddressType ClientPublicIP;
///客户登录备注2
TThostFtdcClientLoginRemarkType ClientLoginRemark;
};
///终端用户绑定信息
struct CThostFtdcAuthUserIDField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///用户代码
TThostFtdcUserIDType UserID;
///校验类型
TThostFtdcAuthTypeType AuthType;
};
///用户IP绑定信息
struct CThostFtdcAuthIPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///用户代码
TThostFtdcIPAddressType IPAddress;
};
///查询分类合约
struct CThostFtdcQryClassifiedInstrumentField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///合约交易状态
TThostFtdcTradingTypeType TradingType;
///合约分类类型
TThostFtdcClassTypeType ClassType;
};
///查询组合优惠比例
struct CThostFtdcQryCombPromotionParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///组合优惠比例
struct CThostFtdcCombPromotionParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///期权组合保证金比例
TThostFtdcDiscountRatioType Xparameter;
};
///国密用户登录请求
struct CThostFtdcReqUserLoginSMField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
///经纪公司名称
TThostFtdcBrokerNameType BrokerName;
///认证码
TThostFtdcAuthCodeType AuthCode;
///App代码
TThostFtdcAppIDType AppID;
///PIN码
TThostFtdcPasswordType PIN;
};
///投资者风险结算持仓查询
struct CThostFtdcQryRiskSettleInvstPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///风险结算产品查询
struct CThostFtdcQryRiskSettleProductStatusField
{
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///投资者风险结算持仓
struct CThostFtdcRiskSettleInvstPositionField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
};
///风险品种
struct CThostFtdcRiskSettleProductStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品编号
TThostFtdcInstrumentIDType ProductID;
///产品结算状态
TThostFtdcProductStatusType ProductStatus;
};
///风险结算追平信息
struct CThostFtdcSyncDeltaInfoField
{
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
///追平状态
TThostFtdcSyncDeltaStatusType SyncDeltaStatus;
///追平描述
TThostFtdcSyncDescriptionType SyncDescription;
///是否只有资金追平
TThostFtdcBoolType IsOnlyTrdDelta;
};
///风险结算追平产品信息
struct CThostFtdcSyncDeltaProductStatusField
{
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///是否允许交易
TThostFtdcProductStatusType ProductStatus;
};
///风险结算追平持仓明细
struct CThostFtdcSyncDeltaInvstPosDtlField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///开仓日期
TThostFtdcDateType OpenDate;
///成交编号
TThostFtdcTradeIDType TradeID;
///数量
TThostFtdcVolumeType Volume;
///开仓价
TThostFtdcPriceType OpenPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///成交类型
TThostFtdcTradeTypeType TradeType;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///逐日盯市持仓盈亏
TThostFtdcMoneyType PositionProfitByDate;
///逐笔对冲持仓盈亏
TThostFtdcMoneyType PositionProfitByTrade;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///昨结算价
TThostFtdcPriceType LastSettlementPrice;
///结算价
TThostFtdcPriceType SettlementPrice;
///平仓量
TThostFtdcVolumeType CloseVolume;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///先开先平剩余数量
TThostFtdcVolumeType TimeFirstVolume;
///特殊持仓标志
TThostFtdcSpecPosiTypeType SpecPosiType;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平组合持仓明细
struct CThostFtdcSyncDeltaInvstPosCombDtlField
{
///交易日
TThostFtdcDateType TradingDay;
///开仓日期
TThostFtdcDateType OpenDate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///撮合编号
TThostFtdcTradeIDType TradeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///持仓量
TThostFtdcVolumeType TotalAmt;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平资金
struct CThostFtdcSyncDeltaTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///投资者风险结算总保证金
struct CThostFtdcSyncDeltaInitInvstMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///追平前总风险保证金
TThostFtdcMoneyType LastRiskTotalInvstMargin;
///追平前交易所总风险保证金
TThostFtdcMoneyType LastRiskTotalExchMargin;
///本次追平品种总保证金
TThostFtdcMoneyType ThisSyncInvstMargin;
///本次追平品种交易所总保证金
TThostFtdcMoneyType ThisSyncExchMargin;
///本次未追平品种总保证金
TThostFtdcMoneyType RemainRiskInvstMargin;
///本次未追平品种交易所总保证金
TThostFtdcMoneyType RemainRiskExchMargin;
///追平前总特殊产品风险保证金
TThostFtdcMoneyType LastRiskSpecTotalInvstMargin;
///追平前总特殊产品交易所风险保证金
TThostFtdcMoneyType LastRiskSpecTotalExchMargin;
///本次追平品种特殊产品总保证金
TThostFtdcMoneyType ThisSyncSpecInvstMargin;
///本次追平品种特殊产品交易所总保证金
TThostFtdcMoneyType ThisSyncSpecExchMargin;
///本次未追平品种特殊产品总保证金
TThostFtdcMoneyType RemainRiskSpecInvstMargin;
///本次未追平品种特殊产品交易所总保证金
TThostFtdcMoneyType RemainRiskSpecExchMargin;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平组合优先级
struct CThostFtdcSyncDeltaDceCombInstrumentField
{
///合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///投机套保标志
TThostFtdcHedgeFlagType CombHedgeFlag;
///组合类型
TThostFtdcDceCombinationTypeType CombinationType;
///买卖
TThostFtdcDirectionType Direction;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///期权组合保证金比例
TThostFtdcDiscountRatioType Xparameter;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者期货保证金率
struct CThostFtdcSyncDeltaInvstMarginRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平交易所期货保证金率
struct CThostFtdcSyncDeltaExchMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平中金现货期权交易所保证金率
struct CThostFtdcSyncDeltaOptExchMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平中金现货期权投资者保证金率
struct CThostFtdcSyncDeltaOptInvstMarginField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期权标的调整保证金率
struct CThostFtdcSyncDeltaInvstMarginRateULField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期权手续费率
struct CThostFtdcSyncDeltaOptInvstCommRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期货手续费率
struct CThostFtdcSyncDeltaInvstCommRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平交叉汇率
struct CThostFtdcSyncDeltaProductExchRateField
{
///产品代码
TThostFtdcInstrumentIDType ProductID;
///报价币种类型
TThostFtdcCurrencyIDType QuoteCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平行情
struct CThostFtdcSyncDeltaDepthMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
///当日均价
TThostFtdcPriceType AveragePrice;
///业务日期
TThostFtdcDateType ActionDay;
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平现货指数
struct CThostFtdcSyncDeltaIndexPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///指数现货收盘价
TThostFtdcPriceType ClosePrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平仓单折抵
struct CThostFtdcSyncDeltaEWarrantOffsetField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///数量
TThostFtdcVolumeType Volume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///SPBM期货合约保证金参数
struct CThostFtdcSPBMFutureParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期货合约因子
TThostFtdcVolumeMultipleType Cvf;
///阶段标识
TThostFtdcTimeRangeType TimeRange;
///品种保证金标准
TThostFtdcRatioType MarginRate;
///期货合约内部对锁仓费率折扣比例
TThostFtdcRatioType LockRateX;
///提高保证金标准
TThostFtdcRatioType AddOnRate;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///期货合约内部对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnLockRateX2;
};
///SPBM期权合约保证金参数
struct CThostFtdcSPBMOptionParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期权合约因子
TThostFtdcVolumeMultipleType Cvf;
///期权冲抵价格
TThostFtdcPriceType DownPrice;
///Delta值
TThostFtdcDeltaType Delta;
///卖方期权风险转换最低值
TThostFtdcDeltaType SlimiDelta;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
};
///SPBM品种内对锁仓折扣参数
struct CThostFtdcSPBMIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///品种内合约间对锁仓费率折扣比例
TThostFtdcRatioType IntraRateY;
///品种内合约间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnIntraRateY2;
};
///SPBM跨品种抵扣参数
struct CThostFtdcSPBMInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRateZ;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///同步SPBM参数结束
struct CThostFtdcSyncSPBMParameterEndField
{
///交易日
TThostFtdcDateType TradingDay;
};
///SPBM期货合约保证金参数查询
struct CThostFtdcQrySPBMFutureParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM期权合约保证金参数查询
struct CThostFtdcQrySPBMOptionParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM品种内对锁仓折扣参数查询
struct CThostFtdcQrySPBMIntraParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM跨品种抵扣参数查询
struct CThostFtdcQrySPBMInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///组合保证金套餐
struct CThostFtdcSPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///是否启用SPBM
TThostFtdcBoolType IsSPBM;
};
///投资者套餐选择
struct CThostFtdcSPBMInvestorPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
};
///投资者新型组合保证金系数
struct CThostFtdcInvestorPortfMarginRatioField
{
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员对投资者收取的保证金和交易所对投资者收取的保证金的比例
TThostFtdcRatioType MarginRatio;
///产品群代码
TThostFtdcProductIDType ProductGroupID;
};
///组合保证金套餐查询
struct CThostFtdcQrySPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///投资者套餐选择查询
struct CThostFtdcQrySPBMInvestorPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///投资者新型组合保证金系数查询
struct CThostFtdcQryInvestorPortfMarginRatioField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品群代码
TThostFtdcProductIDType ProductGroupID;
};
///投资者产品SPBM明细
struct CThostFtdcInvestorProdSPBMDetailField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///合约内对锁保证金
TThostFtdcMoneyType IntraInstrMargin;
///买归集保证金
TThostFtdcMoneyType BCollectingMargin;
///卖归集保证金
TThostFtdcMoneyType SCollectingMargin;
///品种内合约间对锁保证金
TThostFtdcMoneyType IntraProdMargin;
///净保证金
TThostFtdcMoneyType NetMargin;
///产品间对锁保证金
TThostFtdcMoneyType InterProdMargin;
///裸保证金
TThostFtdcMoneyType SingleMargin;
///附加保证金
TThostFtdcMoneyType AddOnMargin;
///交割月保证金
TThostFtdcMoneyType DeliveryMargin;
///看涨期权最低风险
TThostFtdcMoneyType CallOptionMinRisk;
///看跌期权最低风险
TThostFtdcMoneyType PutOptionMinRisk;
///卖方期权最低风险
TThostFtdcMoneyType OptionMinRisk;
///买方期权冲抵价值
TThostFtdcMoneyType OptionValueOffset;
///卖方期权权利金
TThostFtdcMoneyType OptionRoyalty;
///价值冲抵
TThostFtdcMoneyType RealOptionValueOffset;
///保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
};
///投资者产品SPBM明细查询
struct CThostFtdcQryInvestorProdSPBMDetailField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///组保交易参数设置
struct CThostFtdcPortfTradeParamSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///新型组保算法
TThostFtdcPortfolioType Portfolio;
///撤单是否验资
TThostFtdcBoolType IsActionVerify;
///平仓是否验资
TThostFtdcBoolType IsCloseVerify;
};
///投资者交易权限设置
struct CThostFtdcInvestorTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcInvstTradingRightType InvstTradingRight;
};
///质押配比参数
struct CThostFtdcMortgageParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///质押配比系数
TThostFtdcRatioType MortgageBalance;
///开仓是否验证质押配比
TThostFtdcBoolType CheckMortgageRatio;
};
///可提控制参数
struct CThostFtdcWithDrawParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///参数代码
TThostFtdcWithDrawParamIDType WithDrawParamID;
///参数代码值
TThostFtdcWithDrawParamValueType WithDrawParamValue;
};
///Thost终端用户功能权限
struct CThostFtdcThostUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///Thost终端功能代码
TThostFtdcThostFunctionCodeType ThostFunctionCode;
};
///Thost终端用户功能权限查询
struct CThostFtdcQryThostUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///SPBM附加跨品种抵扣参数
struct CThostFtdcSPBMAddOnInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnInterRateZ2;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///SPBM附加跨品种抵扣参数查询
struct CThostFtdcQrySPBMAddOnInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///投资者商品组SPMM记录查询
struct CThostFtdcQryInvestorCommoditySPMMMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
};
///投资者商品群SPMM记录查询
struct CThostFtdcQryInvestorCommodityGroupSPMMMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///SPMM合约参数查询
struct CThostFtdcQrySPMMInstParamField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///SPMM产品参数查询
struct CThostFtdcQrySPMMProductParamField
{
///产品代码
TThostFtdcSPMMProductIDType ProductID;
};
///投资者商品组SPMM记录
struct CThostFtdcInvestorCommoditySPMMMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///优惠仓位应收保证金
TThostFtdcMoneyType MarginBeforeDiscount;
///不优惠仓位应收保证金
TThostFtdcMoneyType MarginNoDiscount;
///多头实仓风险
TThostFtdcMoneyType LongPosRisk;
///多头开仓冻结风险
TThostFtdcMoneyType LongOpenFrozenRisk;
///多头被平冻结风险
TThostFtdcMoneyType LongCloseFrozenRisk;
///空头实仓风险
TThostFtdcMoneyType ShortPosRisk;
///空头开仓冻结风险
TThostFtdcMoneyType ShortOpenFrozenRisk;
///空头被平冻结风险
TThostFtdcMoneyType ShortCloseFrozenRisk;
///SPMM品种内跨期优惠系数
TThostFtdcSPMMDiscountRatioType IntraCommodityRate;
///SPMM期权优惠系数
TThostFtdcSPMMDiscountRatioType OptionDiscountRate;
///实仓对冲优惠金额
TThostFtdcMoneyType PosDiscount;
///开仓报单对冲优惠金额
TThostFtdcMoneyType OpenFrozenDiscount;
///品种风险净头
TThostFtdcMoneyType NetRisk;
///平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///行权冻结资金
TThostFtdcMoneyType StrikeFrozenMargin;
};
///投资者商品群SPMM记录
struct CThostFtdcInvestorCommodityGroupSPMMMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///优惠仓位应收保证金
TThostFtdcMoneyType MarginBeforeDiscount;
///不优惠仓位应收保证金
TThostFtdcMoneyType MarginNoDiscount;
///多头风险
TThostFtdcMoneyType LongRisk;
///空头风险
TThostFtdcMoneyType ShortRisk;
///商品群平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///SPMM跨品种优惠系数
TThostFtdcSPMMDiscountRatioType InterCommodityRate;
///商品群最小保证金比例
TThostFtdcSPMMDiscountRatioType MiniMarginRatio;
///投资者保证金和交易所保证金的比例
TThostFtdcRatioType AdjustRatio;
///SPMM品种内优惠汇总
TThostFtdcMoneyType IntraCommodityDiscount;
///SPMM跨品种优惠
TThostFtdcMoneyType InterCommodityDiscount;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType InvestorMargin;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///行权冻结资金
TThostFtdcMoneyType StrikeFrozenMargin;
};
///SPMM合约参数
struct CThostFtdcSPMMInstParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///SPMM合约保证金算法
TThostFtdcInstMarginCalIDType InstMarginCalID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///SPMM产品参数
struct CThostFtdcSPMMProductParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcSPMMProductIDType ProductID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///席位与交易中心对应关系维护查询
struct CThostFtdcQryTraderAssignField
{
///交易员代码
TThostFtdcTraderIDType TraderID;
};
///席位与交易中心对应关系
struct CThostFtdcTraderAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///投资者申报费阶梯收取设置
struct CThostFtdcInvestorInfoCntSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcProductIDType ProductID;
///是否收取申报费
TThostFtdcBoolType IsCalInfoComm;
///是否限制信息量
TThostFtdcBoolType IsLimitInfoMax;
///信息量限制笔数
TThostFtdcVolumeType InfoMaxLimit;
};
///RCAMS产品组合信息
struct CThostFtdcRCAMSCombProductInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RCAMS同合约风险对冲参数
struct CThostFtdcRCAMSInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///同合约风险对冲比率
TThostFtdcHedgeRateType HedgeRate;
};
///RCAMS品种内风险对冲参数
struct CThostFtdcRCAMSIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///品种内对冲比率
TThostFtdcHedgeRateType HedgeRate;
};
///RCAMS跨品种风险折抵参数
struct CThostFtdcRCAMSInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///折抵率
TThostFtdcHedgeRateType CreditRate;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
};
///RCAMS空头期权风险调整参数
struct CThostFtdcRCAMSShortOptAdjustParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///空头期权风险调整标准
TThostFtdcAdjustValueType AdjustValue;
};
///RCAMS策略组合持仓
struct CThostFtdcRCAMSInvestorCombPositionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///持仓量
TThostFtdcVolumeType TotalAmt;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType Margin;
};
///投资者品种RCAMS保证金
struct CThostFtdcInvestorProdRCAMSMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///品种组合前风险
TThostFtdcMoneyType RiskBeforeDiscount;
///同合约对冲风险
TThostFtdcMoneyType IntraInstrRisk;
///品种买持仓风险
TThostFtdcMoneyType BPosRisk;
///品种卖持仓风险
TThostFtdcMoneyType SPosRisk;
///品种内对冲风险
TThostFtdcMoneyType IntraProdRisk;
///品种净持仓风险
TThostFtdcMoneyType NetRisk;
///品种间对冲风险
TThostFtdcMoneyType InterProdRisk;
///空头期权风险调整
TThostFtdcMoneyType ShortOptRiskAdj;
///空头期权权利金
TThostFtdcMoneyType OptionRoyalty;
///大边组合平仓冻结保证金
TThostFtdcMoneyType MMSACloseFrozenMargin;
///策略组合平仓/行权冻结保证金
TThostFtdcMoneyType CloseCombFrozenMargin;
///平仓/行权冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///大边组合开仓冻结保证金
TThostFtdcMoneyType MMSAOpenFrozenMargin;
///交割月期货开仓冻结保证金
TThostFtdcMoneyType DeliveryOpenFrozenMargin;
///开仓冻结保证金
TThostFtdcMoneyType OpenFrozenMargin;
///投资者冻结保证金
TThostFtdcMoneyType UseFrozenMargin;
///大边组合交易所持仓保证金
TThostFtdcMoneyType MMSAExchMargin;
///交割月期货交易所持仓保证金
TThostFtdcMoneyType DeliveryExchMargin;
///策略组合交易所保证金
TThostFtdcMoneyType CombExchMargin;
///交易所持仓保证金
TThostFtdcMoneyType ExchMargin;
///投资者持仓保证金
TThostFtdcMoneyType UseMargin;
};
///RCAMS产品组合信息查询
struct CThostFtdcQryRCAMSCombProductInfoField
{
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RCAMS同合约风险对冲参数查询
struct CThostFtdcQryRCAMSInstrParameterField
{
///产品代码
TThostFtdcProductIDType ProductID;
};
///RCAMS品种内风险对冲参数查询
struct CThostFtdcQryRCAMSIntraParameterField
{
///产品组合代码
TThostFtdcProductIDType CombProductID;
};
///RCAMS跨品种风险折抵参数查询
struct CThostFtdcQryRCAMSInterParameterField
{
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
};
///RCAMS空头期权风险调整参数查询
struct CThostFtdcQryRCAMSShortOptAdjustParamField
{
///产品组合代码
TThostFtdcProductIDType CombProductID;
};
///RCAMS策略组合持仓查询
struct CThostFtdcQryRCAMSInvestorCombPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///投资者品种RCAMS保证金查询
struct CThostFtdcQryInvestorProdRCAMSMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RULE合约保证金参数
struct CThostFtdcRULEInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///投机买折算系数
TThostFtdcRatioType BSpecRatio;
///投机卖折算系数
TThostFtdcRatioType SSpecRatio;
///套保买折算系数
TThostFtdcRatioType BHedgeRatio;
///套保卖折算系数
TThostFtdcRatioType SHedgeRatio;
///买附加风险保证金
TThostFtdcMoneyType BAddOnMargin;
///卖附加风险保证金
TThostFtdcMoneyType SAddOnMargin;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///RULE品种内对锁仓折扣参数
struct CThostFtdcRULEIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///标准合约保证金
TThostFtdcMoneyType StdInstrMargin;
///一般月份合约组合保证金系数
TThostFtdcRatioType UsualIntraRate;
///临近交割合约组合保证金系数
TThostFtdcRatioType DeliveryIntraRate;
};
///RULE跨品种抵扣参数
struct CThostFtdcRULEInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRate;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///腿1比例系数
TThostFtdcCommonIntType Leg1PropFactor;
///腿2比例系数
TThostFtdcCommonIntType Leg2PropFactor;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///商品群名称
TThostFtdcInstrumentNameType CommodityGroupName;
};
///RULE合约保证金参数查询
struct CThostFtdcQryRULEInstrParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///RULE品种内对锁仓折扣参数查询
struct CThostFtdcQryRULEIntraParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///RULE跨品种抵扣参数查询
struct CThostFtdcQryRULEInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///投资者产品RULE保证金
struct CThostFtdcInvestorProdRULEMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///买标准持仓
TThostFtdcStdPositionType BStdPosition;
///卖标准持仓
TThostFtdcStdPositionType SStdPosition;
///买标准开仓冻结
TThostFtdcStdPositionType BStdOpenFrozen;
///卖标准开仓冻结
TThostFtdcStdPositionType SStdOpenFrozen;
///买标准平仓冻结
TThostFtdcStdPositionType BStdCloseFrozen;
///卖标准平仓冻结
TThostFtdcStdPositionType SStdCloseFrozen;
///品种内对冲标准持仓
TThostFtdcStdPositionType IntraProdStdPosition;
///品种内单腿标准持仓
TThostFtdcStdPositionType NetStdPosition;
///品种间对冲标准持仓
TThostFtdcStdPositionType InterProdStdPosition;
///单腿标准持仓
TThostFtdcStdPositionType SingleStdPosition;
///品种内对锁保证金
TThostFtdcMoneyType IntraProdMargin;
///品种间对锁保证金
TThostFtdcMoneyType InterProdMargin;
///跨品种单腿保证金
TThostFtdcMoneyType SingleMargin;
///非组合合约保证金
TThostFtdcMoneyType NonCombMargin;
///附加保证金
TThostFtdcMoneyType AddOnMargin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///附加冻结保证金
TThostFtdcMoneyType AddOnFrozenMargin;
///开仓冻结保证金
TThostFtdcMoneyType OpenFrozenMargin;
///平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///品种保证金
TThostFtdcMoneyType Margin;
///冻结保证金
TThostFtdcMoneyType FrozenMargin;
};
///投资者产品RULE保证金查询
struct CThostFtdcQryInvestorProdRULEMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///风险结算追平SPBM组合保证金套餐
struct CThostFtdcSyncDeltaSPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///是否启用SPBM
TThostFtdcBoolType IsSPBM;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者SPBM套餐选择
struct CThostFtdcSyncDeltaSPBMInvstPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM期货合约保证金参数
struct CThostFtdcSyncDeltaSPBMFutureParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期货合约因子
TThostFtdcVolumeMultipleType Cvf;
///阶段标识
TThostFtdcTimeRangeType TimeRange;
///品种保证金标准
TThostFtdcRatioType MarginRate;
///期货合约内部对锁仓费率折扣比例
TThostFtdcRatioType LockRateX;
///提高保证金标准
TThostFtdcRatioType AddOnRate;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///期货合约内部对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnLockRateX2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM期权合约保证金参数
struct CThostFtdcSyncDeltaSPBMOptionParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期权合约因子
TThostFtdcVolumeMultipleType Cvf;
///期权冲抵价格
TThostFtdcPriceType DownPrice;
///Delta值
TThostFtdcDeltaType Delta;
///卖方期权风险转换最低值
TThostFtdcDeltaType SlimiDelta;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM品种内对锁仓折扣参数
struct CThostFtdcSyncDeltaSPBMIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///品种内合约间对锁仓费率折扣比例
TThostFtdcRatioType IntraRateY;
///品种内合约间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnIntraRateY2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM跨品种抵扣参数
struct CThostFtdcSyncDeltaSPBMInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRateZ;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM附加跨品种抵扣参数
struct CThostFtdcSyncDeltaSPBMAddOnInterParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnInterRateZ2;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM合约参数
struct CThostFtdcSyncDeltaSPMMInstParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///SPMM合约保证金算法
TThostFtdcInstMarginCalIDType InstMarginCalID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM产品相关参数
struct CThostFtdcSyncDeltaSPMMProductParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcSPMMProductIDType ProductID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者SPMM模板选择
struct CThostFtdcSyncDeltaInvestorSPMMModelField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///SPMM模板ID
TThostFtdcSPMMModelIDType SPMMModelID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM模板参数设置
struct CThostFtdcSyncDeltaSPMMModelParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///SPMM模板ID
TThostFtdcSPMMModelIDType SPMMModelID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///SPMM品种内跨期优惠系数
TThostFtdcSPMMDiscountRatioType IntraCommodityRate;
///SPMM品种间优惠系数
TThostFtdcSPMMDiscountRatioType InterCommodityRate;
///SPMM期权优惠系数
TThostFtdcSPMMDiscountRatioType OptionDiscountRate;
///商品群最小保证金比例
TThostFtdcSPMMDiscountRatioType MiniMarginRatio;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS产品组合信息
struct CThostFtdcSyncDeltaRCAMSCombProdInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS同合约风险对冲参数
struct CThostFtdcSyncDeltaRCAMSInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///同合约风险对冲比率
TThostFtdcHedgeRateType HedgeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS品种内风险对冲参数
struct CThostFtdcSyncDeltaRCAMSIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///品种内对冲比率
TThostFtdcHedgeRateType HedgeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS跨品种风险折抵参数
struct CThostFtdcSyncDeltaRCAMSInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///折抵率
TThostFtdcHedgeRateType CreditRate;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS空头期权风险调整参数
struct CThostFtdcSyncDeltaRCAMSSOptAdjParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///空头期权风险调整标准
TThostFtdcAdjustValueType AdjustValue;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS策略组合规则明细
struct CThostFtdcSyncDeltaRCAMSCombRuleDtlField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///策略产品
TThostFtdcProductIDType ProdGroup;
///策略id
TThostFtdcRuleIdType RuleId;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///组合保证金标准
TThostFtdcMoneyType CombMargin;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS策略组合持仓
struct CThostFtdcSyncDeltaRCAMSInvstCombPosField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///持仓量
TThostFtdcVolumeType TotalAmt;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType Margin;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE合约保证金参数
struct CThostFtdcSyncDeltaRULEInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///投机买折算系数
TThostFtdcRatioType BSpecRatio;
///投机卖折算系数
TThostFtdcRatioType SSpecRatio;
///套保买折算系数
TThostFtdcRatioType BHedgeRatio;
///套保卖折算系数
TThostFtdcRatioType SHedgeRatio;
///买附加风险保证金
TThostFtdcMoneyType BAddOnMargin;
///卖附加风险保证金
TThostFtdcMoneyType SAddOnMargin;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE品种内对锁仓折扣参数
struct CThostFtdcSyncDeltaRULEIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///标准合约保证金
TThostFtdcMoneyType StdInstrMargin;
///一般月份合约组合保证金系数
TThostFtdcRatioType UsualIntraRate;
///临近交割合约组合保证金系数
TThostFtdcRatioType DeliveryIntraRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE跨品种抵扣参数
struct CThostFtdcSyncDeltaRULEInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRate;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///腿1比例系数
TThostFtdcCommonIntType Leg1PropFactor;
///腿2比例系数
TThostFtdcCommonIntType Leg2PropFactor;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///商品群名称
TThostFtdcInstrumentNameType CommodityGroupName;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///服务地址参数
struct CThostFtdcIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易中心名称
TThostFtdcDRIdentityNameType DRIdentityName;
///交易地址OR行情地址
TThostFtdcAddrSrvModeType AddrSrvMode;
///地址版本
TThostFtdcAddrVerType AddrVer;
///服务地址编号
TThostFtdcCommonIntType AddrNo;
///服务地址名称
TThostFtdcAddrNameType AddrName;
///是否是国密地址
TThostFtdcBoolType IsSM;
///是否是内网地址
TThostFtdcBoolType IsLocalAddr;
///地址补充信息
TThostFtdcAddrRemarkType Remark;
///站点
TThostFtdcSiteType Site;
///网络运营商
TThostFtdcNetOperatorType NetOperator;
};
///服务地址参数查询
struct CThostFtdcQryIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///服务地址参数
struct CThostFtdcTGIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易中心名称
TThostFtdcDRIdentityNameType DRIdentityName;
///交易地址OR行情地址
TThostFtdcAddrSrvModeType AddrSrvMode;
///地址版本
TThostFtdcAddrVerType AddrVer;
///服务地址编号
TThostFtdcCommonIntType AddrNo;
///服务地址名称
TThostFtdcAddrNameType AddrName;
///是否是国密地址
TThostFtdcBoolType IsSM;
///是否是内网地址
TThostFtdcBoolType IsLocalAddr;
///地址补充信息
TThostFtdcAddrRemarkType Remark;
///站点
TThostFtdcSiteType Site;
///网络运营商
TThostFtdcNetOperatorType NetOperator;
};
///服务地址参数查询
struct CThostFtdcQryTGIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///App代码
TThostFtdcAppIDType AppID;
};
///TGate会话查询状态
struct CThostFtdcTGSessionQryStatusField
{
///最近30s的查询频率
TThostFtdcCommonIntType LastQryFreq;
///查询状态
TThostFtdcTGSessionQryStatusType QryStatus;
};
///内网地址配置
struct CThostFtdcLocalAddrConfigField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///对端地址
TThostFtdcIpAddrType PeerAddr;
///子网掩码
TThostFtdcIpAddrType NetMask;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///内网服务地址
TThostFtdcIpAddrType LocalAddress;
};
///内网地址配置查询
struct CThostFtdcQryLocalAddrConfigField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///次席查询银行资金帐户信息请求
struct CThostFtdcReqQueryBankAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次席查询银行资金帐户信息回报
struct CThostFtdcRspQueryBankAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次中心发起的转帐交易
struct CThostFtdcReqTransferBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次中心发起的转帐交易回报
struct CThostFtdcRspTransferBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///查询银行资金帐户信息通知 要发往次席
struct CThostFtdcNotifyQueryFutureAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///退出紧急状态参数
struct CThostFtdcExitEmergencyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///新组保保证金系数投资者模板对应关系
struct CThostFtdcInvestorPortfMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保证金系数模板
TThostFtdcInvestorIDType MarginModelID;
};
///投资者新组保设置
struct CThostFtdcInvestorPortfSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///是否开启新组保
TThostFtdcBoolType UsePortf;
};
///投资者新组保设置查询
struct CThostFtdcQryInvestorPortfSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
};
///来自次席的用户口令变更
struct CThostFtdcUserPasswordUpdateFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///来自次席的结算结果确认
struct CThostFtdcSettlementInfoConfirmFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///确认日期
TThostFtdcDateType ConfirmDate;
///确认时间
TThostFtdcTimeType ConfirmTime;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///来自次席的资金账户口令变更
struct CThostFtdcTradingAccountPasswordUpdateFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///风控禁止的合约交易权限
struct CThostFtdcRiskForbiddenRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
///合约/产品代码
TThostFtdcInstrumentIDType InstrumentID;
///用户代码
TThostFtdcUserIDType UserID;
};
///投资者申报费阶梯收取记录
struct CThostFtdcInvestorInfoCommRecField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcInstrumentIDType InstrumentID;
///报单总笔数
TThostFtdcVolumeType OrderCount;
///撤单总笔数
TThostFtdcVolumeType OrderActionCount;
///询价总次数
TThostFtdcVolumeType ForQuoteCnt;
///申报费
TThostFtdcMoneyType InfoComm;
///是否期权系列
TThostFtdcBoolType IsOptSeries;
///品种代码
TThostFtdcProductIDType ProductID;
///信息量总量
TThostFtdcVolumeType InfoCnt;
};
///投资者申报费阶梯收取记录查询
struct CThostFtdcQryInvestorInfoCommRecField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///组合腿信息
struct CThostFtdcCombLegField
{
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///派生层数
TThostFtdcImplyLevelType ImplyLevel;
};
///组合腿信息查询
struct CThostFtdcQryCombLegField
{
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///输入的对冲设置
struct CThostFtdcInputOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
};
///对冲设置
struct CThostFtdcOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///交易所合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///交易所期权系列号
TThostFtdcExchangeInstIDType ExchangeSerialNo;
///交易所产品代码
TThostFtdcProductIDType ExchangeProductID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///对冲设置结果
TThostFtdcExecResultType ExecResult;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOffsetSettingSeq;
///申请来源
TThostFtdcApplySrcType ApplySrc;
};
///撤销对冲设置
struct CThostFtdcCancelOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///交易所合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///交易所期权系列号
TThostFtdcExchangeInstIDType ExchangeSerialNo;
///交易所产品代码
TThostFtdcProductIDType ExchangeProductID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
};
///查询对冲设置
struct CThostFtdcQryOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
};
///服务地址和AppID的关系
struct CThostFtdcAddrAppIDRelationField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///App代码
TThostFtdcAppIDType AppID;
};
///服务地址和AppID的关系查询
struct CThostFtdcQryAddrAppIDRelationField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///微信小程序等用户系统信息
struct CThostFtdcWechatUserSystemInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///微信小程序等用户端系统内部信息长度
TThostFtdcSystemInfoLenType WechatCltSysInfoLen;
///微信小程序等用户端系统内部信息
TThostFtdcClientSystemInfoType WechatCltSysInfo;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///登录成功时间
TThostFtdcTimeType ClientLoginTime;
///App代码
TThostFtdcAppIDType ClientAppID;
///用户公网IP
TThostFtdcIPAddressType ClientPublicIP;
///客户登录备注2
TThostFtdcClientLoginRemarkType ClientLoginRemark;
};
///投资者预留信息
struct CThostFtdcInvestorReserveInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///预留信息
TThostFtdcReserveInfoType ReserveInfo;
};
///查询组织架构投资者对应关系
struct CThostFtdcQryInvestorDepartmentFlatField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///组织架构投资者对应关系
struct CThostFtdcInvestorDepartmentFlatField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组织架构代码
TThostFtdcInvestorIDType DepartmentID;
};
///查询操作员组织架构关系
struct CThostFtdcQryDepartmentUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///前置信息
struct CThostFtdcFrontInfoField
{
///前置地址
TThostFtdcAddressType FrontAddr;
///查询流控
TThostFtdcQueryFreqType QryFreq;
///FTD流控
TThostFtdcQueryFreqType FTDPkgFreq;
};
#endif
================================================
FILE: native/ctp_bridge/api/linux/error.dtd
================================================
================================================
FILE: native/ctp_bridge/api/linux/error.xml
================================================
================================================
FILE: native/ctp_bridge/api/win/DataCollect.h
================================================
#ifndef DATA_COLLECT_H
#define DATA_COLLECT_H
#define DLL_EXPORT __declspec(dllexport)
#if defined(IS_WINCOLLECT_LIB) && defined(WIN32)
#ifdef LIB_DATA_COLLECT_API_EXPORT
#define DATA_COLLECT_API_EXPORT __declspec(dllexport)
#else
#define DATA_COLLECT_API_EXPORT __declspec(dllimport)
#endif
#else
#define DATA_COLLECT_API_EXPORT
#endif
/// 获取AES加密和RSA加密的终端信息 pSystemInfo的空间需要调用者自己分配
/// 至少270个字节
/// windows返回值定义
/* 返回的int值 不为0 表示采集信息有误 具体哪个采集项有问题需要做如下判断
从低位开始分别标示 终端信息 ->系统盘分区信息
返回值 & (0x01 << 0) 不为0 表示终端类型未采集到
返回值 & (0x01 << 1) 不为0 表示 信息采集时间获取异常
返回值 & (0x01 << 2) 不为0 表示ip 获取失败
(采集多个相同类型信息的场景有一个采集到 即表示采集成功) 返回值 & (0x01 << 3)
不为0 表示mac 获取失败 返回值 & (0x01 << 4) 不为0 表示 设备名 获取失败 返回值
& (0x01 << 5) 不为0 表示 操作系统版本 获取失败 返回值 & (0x01 << 6) 不为0
表示 硬盘序列号 获取失败 返回值 & (0x01 << 7) 不为0 表示 CPU序列号 获取失败
返回值 & (0x01 << 8) 不为0 表示 BIOS 获取失败
返回值 & (0x01 << 9) 不为0 表示 系统盘分区信息 获取失败
*/
/// linux返回值定义
/* 返回的int值 不为0 表示采集信息有误 具体哪个采集项有问题需要做如下判断
从低位开始分别标示 终端信息 -> BIOS信息
返回值 & (0x01 << 0) 不为0 表示终端类型未采集到
返回值 & (0x01 << 1) 不为0 表示 信息采集时间获取异常
返回值 & (0x01 << 2) 不为0 表示ip 获取失败
(采集多个相同类型信息的场景有一个采集到 即表示采集成功) 返回值 & (0x01 << 3)
不为0 表示mac 获取失败 返回值 & (0x01 << 4) 不为0 表示 设备名 获取失败 返回值
& (0x01 << 5) 不为0 表示 操作系统版本 获取失败 返回值 & (0x01 << 6) 不为0
表示 硬盘序列号 获取失败 返回值 & (0x01 << 7) 不为0 表示 CPU序列号 获取失败
返回值 & (0x01 << 8) 不为0 表示 BIOS 获取失败
*/
DATA_COLLECT_API_EXPORT int CTP_GetSystemInfo(char *pSystemInfo, int &nLen);
// 版本号格式
// Sfit + 生产还是测试秘钥(pro/tst) + 秘钥版本 + 编译时间 + 版本(内部)
DATA_COLLECT_API_EXPORT const char *CTP_GetDataCollectApiVersion(void);
#endif
================================================
FILE: native/ctp_bridge/api/win/ThostFtdcMdApi.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcMdApi.h
///@brief 定义了客户端接口
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCMDAPI_H)
#define THOST_FTDCMDAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_MD_API_EXPORT
#define MD_API_EXPORT __declspec(dllexport)
#else
#define MD_API_EXPORT __declspec(dllimport)
#endif
#else
#define MD_API_EXPORT
#endif
class CThostFtdcMdSpi
{
public:
///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
virtual void OnFrontConnected(){};
///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。
///@param nReason 错误原因
/// 0x1001 网络读失败
/// 0x1002 网络写失败
/// 0x2001 接收心跳超时
/// 0x2002 发送心跳失败
/// 0x2003 收到错误报文
virtual void OnFrontDisconnected(int nReason){};
///心跳超时警告。当长时间未收到报文时,该方法被调用。
///@param nTimeLapse 距离上次接收报文的时间
virtual void OnHeartBeatWarning(int nTimeLapse){};
///登录请求响应
virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登出请求响应
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询组播合约响应
virtual void OnRspQryMulticastInstrument(CThostFtdcMulticastInstrumentField *pMulticastInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///错误应答
virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///订阅行情应答
virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///取消订阅行情应答
virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///订阅询价应答
virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///取消订阅询价应答
virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///深度行情通知
virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {};
///询价通知
virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {};
};
class MD_API_EXPORT CThostFtdcMdApi
{
public:
///创建MdApi
///@param pszFlowPath 存贮订阅信息文件的目录,默认为当前目录
///@param bIsProductionMode true:使用生产版本的API false:使用测评版本API
///@return 创建出的UserApi
///modify for udp marketdata
static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false, bool bIsProductionMode=true);
///获取API的版本信息
///@retrun 获取到的版本号
static const char *GetApiVersion();
///删除接口对象本身
///@remark 不再使用本接口对象时,调用该函数删除接口对象
virtual void Release() = 0;
///初始化
///@remark 初始化运行环境,只有调用后,接口才开始工作
virtual void Init() = 0;
///等待接口线程结束运行
///@return 线程退出代码
virtual int Join() = 0;
///获取当前交易日
///@retrun 获取到的交易日
///@remark 只有登录成功后,才能得到正确的交易日
virtual const char *GetTradingDay() = 0;
///注册前置机网络地址
///@param pszFrontAddress:前置机网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”17001”代表服务器端口号。
virtual void RegisterFront(char *pszFrontAddress) = 0;
///注册名字服务器网络地址
///@param pszNsAddress:名字服务器网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:12001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”12001”代表服务器端口号。
///@remark RegisterNameServer优先于RegisterFront
virtual void RegisterNameServer(char *pszNsAddress) = 0;
///注册名字服务器用户信息
///@param pFensUserInfo:用户信息。
virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0;
///注册回调接口
///@param pSpi 派生自回调接口类的实例
virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0;
///订阅行情。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0;
///退订行情。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0;
///订阅询价。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0;
///退订询价。
///@param ppInstrumentID 合约ID
///@param nCount 要订阅/退订行情的合约个数
///@remark
virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0;
///用户登录请求
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
///登出请求
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
///请求查询组播合约
virtual int ReqQryMulticastInstrument(CThostFtdcQryMulticastInstrumentField *pQryMulticastInstrument, int nRequestID) = 0;
protected:
~CThostFtdcMdApi(){};
};
#endif
================================================
FILE: native/ctp_bridge/api/win/ThostFtdcTraderApi.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcTraderApi.h
///@brief 定义了客户端接口
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCTRADERAPI_H)
#define THOST_FTDCTRADERAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_TRADER_API_EXPORT
#define TRADER_API_EXPORT __declspec(dllexport)
#else
#define TRADER_API_EXPORT __declspec(dllimport)
#endif
#else
#define TRADER_API_EXPORT
#endif
class CThostFtdcTraderSpi
{
public:
///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。
virtual void OnFrontConnected(){};
///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。
///@param nReason 错误原因
/// 0x1001 网络读失败
/// 0x1002 网络写失败
/// 0x2001 接收心跳超时
/// 0x2002 发送心跳失败
/// 0x2003 收到错误报文
virtual void OnFrontDisconnected(int nReason){};
///心跳超时警告。当长时间未收到报文时,该方法被调用。
///@param nTimeLapse 距离上次接收报文的时间
virtual void OnHeartBeatWarning(int nTimeLapse){};
///客户端认证响应
virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登录请求响应
virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///登出请求响应
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///用户口令更新请求响应
virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///资金账户口令更新请求响应
virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询用户当前支持的认证模式的回复
virtual void OnRspUserAuthMethod(CThostFtdcRspUserAuthMethodField *pRspUserAuthMethod, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///获取图形验证码请求的回复
virtual void OnRspGenUserCaptcha(CThostFtdcRspGenUserCaptchaField *pRspGenUserCaptcha, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///获取短信验证码请求的回复
virtual void OnRspGenUserText(CThostFtdcRspGenUserTextField *pRspGenUserText, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单录入请求响应
virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///预埋单录入请求响应
virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///预埋撤单录入请求响应
virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单操作请求响应
virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询最大报单数量响应
virtual void OnRspQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField *pQryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者结算结果确认响应
virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///删除预埋单响应
virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///删除预埋撤单响应
virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///执行宣告录入请求响应
virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///执行宣告操作请求响应
virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///询价录入请求响应
virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报价录入请求响应
virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报价操作请求响应
virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///批量报单操作请求响应
virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期权自对冲录入请求响应
virtual void OnRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期权自对冲操作请求响应
virtual void OnRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///申请组合录入请求响应
virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报单响应
virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询成交响应
virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓响应
virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询资金账户响应
virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者响应
virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易编码响应
virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约保证金率响应
virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约手续费率响应
virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询用户会话响应
virtual void OnRspQryUserSession(CThostFtdcUserSessionField *pUserSession, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所响应
virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品响应
virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询合约响应
virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询行情响应
virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易员报盘机响应
virtual void OnRspQryTraderOffer(CThostFtdcTraderOfferField *pTraderOffer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者结算结果响应
virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询转帐银行响应
virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓明细响应
virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询客户通知响应
virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询结算信息确认响应
virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者持仓明细响应
virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///查询保证金监管系统经纪公司资金账户密钥响应
virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询仓单折抵信息响应
virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资者品种/跨品种保证金响应
virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所保证金率响应
virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易所调整保证金率响应
virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询汇率响应
virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理操作员银期权限响应
virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品报价汇率
virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询产品组
virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询做市商合约手续费率响应
virtual void OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询做市商期权合约手续费响应
virtual void OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报单手续费响应
virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询资金账户响应
virtual void OnRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理商资金校验模式响应
virtual void OnRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询二级代理商信息响应
virtual void OnRspQrySecAgentTradeInfo(CThostFtdcSecAgentTradeInfoField *pSecAgentTradeInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权交易成本响应
virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权合约手续费响应
virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询执行宣告响应
virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询询价响应
virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询报价响应
virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询期权自对冲响应
virtual void OnRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询投资单元响应
virtual void OnRspQryInvestUnit(CThostFtdcInvestUnitField *pInvestUnit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询组合合约安全系数响应
virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询申请组合响应
virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询转帐流水响应
virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询银期签约关系响应
virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///错误应答
virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///报单通知
virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {};
///成交通知
virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {};
///报单录入错误回报
virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {};
///报单操作错误回报
virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///合约交易状态通知
virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {};
///交易所公告通知
virtual void OnRtnBulletin(CThostFtdcBulletinField *pBulletin) {};
///交易通知
virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {};
///提示条件单校验错误
virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {};
///执行宣告通知
virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {};
///执行宣告录入错误回报
virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {};
///执行宣告操作错误回报
virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///询价录入错误回报
virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {};
///报价通知
virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {};
///报价录入错误回报
virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {};
///报价操作错误回报
virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {};
///询价通知
virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {};
///保证金监控中心用户令牌
virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {};
///批量报单操作错误回报
virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) {};
///期权自对冲通知
virtual void OnRtnOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose) {};
///期权自对冲录入错误回报
virtual void OnErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo) {};
///期权自对冲操作错误回报
virtual void OnErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo) {};
///申请组合通知
virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {};
///申请组合录入错误回报
virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {};
///请求查询签约银行响应
virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询预埋单响应
virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询预埋撤单响应
virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询交易通知响应
virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询经纪公司交易参数响应
virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询经纪公司交易算法响应
virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求查询监控中心用户令牌
virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///银行发起银行资金转期货通知
virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {};
///银行发起期货资金转银行通知
virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {};
///银行发起冲正银行转期货通知
virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {};
///银行发起冲正期货转银行通知
virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起银行资金转期货通知
virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
///期货发起期货资金转银行通知
virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {};
///系统运行时期货端手工发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
///系统运行时期货端手工发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起查询银行余额通知
virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {};
///期货发起银行资金转期货错误回报
virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起期货资金转银行错误回报
virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {};
///系统运行时期货端手工发起冲正银行转期货错误回报
virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
///系统运行时期货端手工发起冲正期货转银行错误回报
virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起查询银行余额错误回报
virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {};
///期货发起冲正银行转期货请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起冲正期货转银行请求,银行处理完毕后报盘发回的通知
virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {};
///期货发起银行资金转期货应答
virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期货发起期货资金转银行应答
virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///期货发起查询银行余额应答
virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///银行发起银期开户通知
virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {};
///银行发起银期销户通知
virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {};
///银行发起变更银行账号通知
virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {};
///请求查询分类合约响应
virtual void OnRspQryClassifiedInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///请求组合优惠比例响应
virtual void OnRspQryCombPromotionParam(CThostFtdcCombPromotionParamField *pCombPromotionParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者风险结算持仓查询响应
virtual void OnRspQryRiskSettleInvstPosition(CThostFtdcRiskSettleInvstPositionField *pRiskSettleInvstPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///风险结算产品查询响应
virtual void OnRspQryRiskSettleProductStatus(CThostFtdcRiskSettleProductStatusField *pRiskSettleProductStatus, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM期货合约参数查询响应
virtual void OnRspQrySPBMFutureParameter(CThostFtdcSPBMFutureParameterField *pSPBMFutureParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM期权合约参数查询响应
virtual void OnRspQrySPBMOptionParameter(CThostFtdcSPBMOptionParameterField *pSPBMOptionParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM品种内对锁仓折扣参数查询响应
virtual void OnRspQrySPBMIntraParameter(CThostFtdcSPBMIntraParameterField *pSPBMIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM跨品种抵扣参数查询响应
virtual void OnRspQrySPBMInterParameter(CThostFtdcSPBMInterParameterField *pSPBMInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM组合保证金套餐查询响应
virtual void OnRspQrySPBMPortfDefinition(CThostFtdcSPBMPortfDefinitionField *pSPBMPortfDefinition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者SPBM套餐选择查询响应
virtual void OnRspQrySPBMInvestorPortfDef(CThostFtdcSPBMInvestorPortfDefField *pSPBMInvestorPortfDef, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者新型组合保证金系数查询响应
virtual void OnRspQryInvestorPortfMarginRatio(CThostFtdcInvestorPortfMarginRatioField *pInvestorPortfMarginRatio, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者产品SPBM明细查询响应
virtual void OnRspQryInvestorProdSPBMDetail(CThostFtdcInvestorProdSPBMDetailField *pInvestorProdSPBMDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者商品组SPMM记录查询响应
virtual void OnRspQryInvestorCommoditySPMMMargin(CThostFtdcInvestorCommoditySPMMMarginField *pInvestorCommoditySPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者商品群SPMM记录查询响应
virtual void OnRspQryInvestorCommodityGroupSPMMMargin(CThostFtdcInvestorCommodityGroupSPMMMarginField *pInvestorCommodityGroupSPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPMM合约参数查询响应
virtual void OnRspQrySPMMInstParam(CThostFtdcSPMMInstParamField *pSPMMInstParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPMM产品参数查询响应
virtual void OnRspQrySPMMProductParam(CThostFtdcSPMMProductParamField *pSPMMProductParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///SPBM附加跨品种抵扣参数查询响应
virtual void OnRspQrySPBMAddOnInterParameter(CThostFtdcSPBMAddOnInterParameterField *pSPBMAddOnInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS产品组合信息查询响应
virtual void OnRspQryRCAMSCombProductInfo(CThostFtdcRCAMSCombProductInfoField *pRCAMSCombProductInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS同合约风险对冲参数查询响应
virtual void OnRspQryRCAMSInstrParameter(CThostFtdcRCAMSInstrParameterField *pRCAMSInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS品种内风险对冲参数查询响应
virtual void OnRspQryRCAMSIntraParameter(CThostFtdcRCAMSIntraParameterField *pRCAMSIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS跨品种风险折抵参数查询响应
virtual void OnRspQryRCAMSInterParameter(CThostFtdcRCAMSInterParameterField *pRCAMSInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS空头期权风险调整参数查询响应
virtual void OnRspQryRCAMSShortOptAdjustParam(CThostFtdcRCAMSShortOptAdjustParamField *pRCAMSShortOptAdjustParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RCAMS策略组合持仓查询响应
virtual void OnRspQryRCAMSInvestorCombPosition(CThostFtdcRCAMSInvestorCombPositionField *pRCAMSInvestorCombPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者品种RCAMS保证金查询响应
virtual void OnRspQryInvestorProdRCAMSMargin(CThostFtdcInvestorProdRCAMSMarginField *pInvestorProdRCAMSMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE合约保证金参数查询响应
virtual void OnRspQryRULEInstrParameter(CThostFtdcRULEInstrParameterField *pRULEInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE品种内对锁仓折扣参数查询响应
virtual void OnRspQryRULEIntraParameter(CThostFtdcRULEIntraParameterField *pRULEIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///RULE跨品种抵扣参数查询响应
virtual void OnRspQryRULEInterParameter(CThostFtdcRULEInterParameterField *pRULEInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者产品RULE保证金查询响应
virtual void OnRspQryInvestorProdRULEMargin(CThostFtdcInvestorProdRULEMarginField *pInvestorProdRULEMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者新型组合保证金开关查询响应
virtual void OnRspQryInvestorPortfSetting(CThostFtdcInvestorPortfSettingField *pInvestorPortfSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///投资者申报费阶梯收取记录查询响应
virtual void OnRspQryInvestorInfoCommRec(CThostFtdcInvestorInfoCommRecField *pInvestorInfoCommRec, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///组合腿信息查询响应
virtual void OnRspQryCombLeg(CThostFtdcCombLegField *pCombLeg, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置请求响应
virtual void OnRspOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置撤销请求响应
virtual void OnRspCancelOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///对冲设置通知
virtual void OnRtnOffsetSetting(CThostFtdcOffsetSettingField *pOffsetSetting) {};
///对冲设置错误回报
virtual void OnErrRtnOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, CThostFtdcRspInfoField *pRspInfo) {};
///对冲设置撤销错误回报
virtual void OnErrRtnCancelOffsetSetting(CThostFtdcCancelOffsetSettingField *pCancelOffsetSetting, CThostFtdcRspInfoField *pRspInfo) {};
///投资者对冲设置查询响应
virtual void OnRspQryOffsetSetting(CThostFtdcOffsetSettingField *pOffsetSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
};
class TRADER_API_EXPORT CThostFtdcTraderApi
{
public:
///创建TraderApi
///@param pszFlowPath 存贮订阅信息文件的目录,默认为当前目录
///@param bIsProductionMode true:使用生产版本的API false:使用测评版本的API
///@return 创建出的UserApi
static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = "", bool bIsProductionMode = true);
///获取API的版本信息
///@retrun 获取到的版本号
static const char *GetApiVersion();
///删除接口对象本身
///@remark 不再使用本接口对象时,调用该函数删除接口对象
virtual void Release() = 0;
///初始化
///@remark 初始化运行环境,只有调用后,接口才开始工作
virtual void Init() = 0;
///等待接口线程结束运行
///@return 线程退出代码
virtual int Join() = 0;
///获取当前交易日
///@retrun 获取到的交易日
///@remark 只有登录成功后,才能得到正确的交易日
virtual const char *GetTradingDay() = 0;
///获取已连接的前置的信息
/// @param pFrontInfo:输入输出参数,用于存储获取到的前置信息,不能为空
/// @remark 连接成功后,可获取正确的前置地址信息
/// @remark 登录成功后,可获取正确的前置流控信息
virtual void GetFrontInfo(CThostFtdcFrontInfoField* pFrontInfo) =0;
///注册前置机网络地址
///@param pszFrontAddress:前置机网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”17001”代表服务器端口号。
virtual void RegisterFront(char *pszFrontAddress) = 0;
///注册名字服务器网络地址
///@param pszNsAddress:名字服务器网络地址。
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:12001”。
///@remark “tcp”代表传输协议,“127.0.0.1”代表服务器地址。”12001”代表服务器端口号。
///@remark RegisterNameServer优先于RegisterFront
virtual void RegisterNameServer(char *pszNsAddress) = 0;
///注册名字服务器用户信息
///@param pFensUserInfo:用户信息。
virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0;
///注册回调接口
///@param pSpi 派生自回调接口类的实例
virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0;
///订阅私有流。
///@param nResumeType 私有流重传方式
/// THOST_TERT_RESTART:从本交易日开始重传
/// THOST_TERT_RESUME:从上次收到的续传
/// THOST_TERT_QUICK:只传送登录后私有流的内容
///@remark 该方法要在Init方法前调用。若不调用则不会收到私有流的数据。
virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
///订阅公共流。
///@param nResumeType 公共流重传方式
/// THOST_TERT_RESTART:从本交易日开始重传
/// THOST_TERT_RESUME:从上次收到的续传
/// THOST_TERT_QUICK:只传送登录后公共流的内容
/// THOST_TERT_NONE:取消订阅公共流
///@remark 该方法要在Init方法前调用。若不调用则不会收到公共流的数据。
virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0;
///客户端认证请求
virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0;
///注册用户终端信息,用于中继服务器多连接模式
///需要在终端认证成功后,用户登录前调用该接口
virtual int RegisterUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;
///上报用户终端信息,用于中继服务器操作员登录模式
///操作员登录后,可以多次调用该接口上报客户信息
virtual int SubmitUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;
///注册用户终端信息,用于中继服务器多连接模式.用于微信小程序等应用上报信息.
virtual int RegisterWechatUserSystemInfo(CThostFtdcWechatUserSystemInfoField *pUserSystemInfo) = 0;
///上报用户终端信息,用于中继服务器操作员登录模式.用于微信小程序等应用上报信息.
virtual int SubmitWechatUserSystemInfo(CThostFtdcWechatUserSystemInfoField *pUserSystemInfo) = 0;
///用户登录请求
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
///登出请求
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
///用户口令更新请求
virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0;
///资金账户口令更新请求
virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0;
///查询用户当前支持的认证模式
virtual int ReqUserAuthMethod(CThostFtdcReqUserAuthMethodField *pReqUserAuthMethod, int nRequestID) = 0;
///用户发出获取图形验证码请求
virtual int ReqGenUserCaptcha(CThostFtdcReqGenUserCaptchaField *pReqGenUserCaptcha, int nRequestID) = 0;
///用户发出获取短信验证码请求
virtual int ReqGenUserText(CThostFtdcReqGenUserTextField *pReqGenUserText, int nRequestID) = 0;
///用户发出带有图片验证码的登陆请求
virtual int ReqUserLoginWithCaptcha(CThostFtdcReqUserLoginWithCaptchaField *pReqUserLoginWithCaptcha, int nRequestID) = 0;
///用户发出带有短信验证码的登陆请求
virtual int ReqUserLoginWithText(CThostFtdcReqUserLoginWithTextField *pReqUserLoginWithText, int nRequestID) = 0;
///用户发出带有动态口令的登陆请求
virtual int ReqUserLoginWithOTP(CThostFtdcReqUserLoginWithOTPField *pReqUserLoginWithOTP, int nRequestID) = 0;
///报单录入请求
virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0;
///预埋单录入请求
virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0;
///预埋撤单录入请求
virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0;
///报单操作请求
virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0;
///查询最大报单数量请求
virtual int ReqQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField *pQryMaxOrderVolume, int nRequestID) = 0;
///投资者结算结果确认
virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0;
///请求删除预埋单
virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0;
///请求删除预埋撤单
virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0;
///执行宣告录入请求
virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0;
///执行宣告操作请求
virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0;
///询价录入请求
virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0;
///报价录入请求
virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0;
///报价操作请求
virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0;
///批量报单操作请求
virtual int ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, int nRequestID) = 0;
///期权自对冲录入请求
virtual int ReqOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, int nRequestID) = 0;
///期权自对冲操作请求
virtual int ReqOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, int nRequestID) = 0;
///申请组合录入请求
virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0;
///请求查询报单
virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0;
///请求查询成交
virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0;
///请求查询投资者持仓
virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0;
///请求查询资金账户
virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
///请求查询投资者
virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0;
///请求查询交易编码
virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0;
///请求查询合约保证金率
virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0;
///请求查询合约手续费率
virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0;
///请求查询用户会话
virtual int ReqQryUserSession(CThostFtdcQryUserSessionField *pQryUserSession, int nRequestID) = 0;
///请求查询交易所
virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0;
///请求查询产品
virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0;
///请求查询合约
virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0;
///请求查询行情
virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0;
///请求查询交易员报盘机
virtual int ReqQryTraderOffer(CThostFtdcQryTraderOfferField *pQryTraderOffer, int nRequestID) = 0;
///请求查询投资者结算结果
virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0;
///请求查询转帐银行
virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0;
///请求查询投资者持仓明细
virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0;
///请求查询客户通知
virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0;
///请求查询结算信息确认
virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0;
///请求查询投资者持仓明细
virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0;
///请求查询保证金监管系统经纪公司资金账户密钥
virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0;
///请求查询仓单折抵信息
virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0;
///请求查询投资者品种/跨品种保证金
virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0;
///请求查询交易所保证金率
virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0;
///请求查询交易所调整保证金率
virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0;
///请求查询汇率
virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0;
///请求查询二级代理操作员银期权限
virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0;
///请求查询产品报价汇率
virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0;
///请求查询产品组
virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0;
///请求查询做市商合约手续费率
virtual int ReqQryMMInstrumentCommissionRate(CThostFtdcQryMMInstrumentCommissionRateField *pQryMMInstrumentCommissionRate, int nRequestID) = 0;
///请求查询做市商期权合约手续费
virtual int ReqQryMMOptionInstrCommRate(CThostFtdcQryMMOptionInstrCommRateField *pQryMMOptionInstrCommRate, int nRequestID) = 0;
///请求查询报单手续费
virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0;
///请求查询资金账户
virtual int ReqQrySecAgentTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
///请求查询二级代理商资金校验模式
virtual int ReqQrySecAgentCheckMode(CThostFtdcQrySecAgentCheckModeField *pQrySecAgentCheckMode, int nRequestID) = 0;
///请求查询二级代理商信息
virtual int ReqQrySecAgentTradeInfo(CThostFtdcQrySecAgentTradeInfoField *pQrySecAgentTradeInfo, int nRequestID) = 0;
///请求查询期权交易成本
virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0;
///请求查询期权合约手续费
virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0;
///请求查询执行宣告
virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0;
///请求查询询价
virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0;
///请求查询报价
virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0;
///请求查询期权自对冲
virtual int ReqQryOptionSelfClose(CThostFtdcQryOptionSelfCloseField *pQryOptionSelfClose, int nRequestID) = 0;
///请求查询投资单元
virtual int ReqQryInvestUnit(CThostFtdcQryInvestUnitField *pQryInvestUnit, int nRequestID) = 0;
///请求查询组合合约安全系数
virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0;
///请求查询申请组合
virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0;
///请求查询转帐流水
virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0;
///请求查询银期签约关系
virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0;
///请求查询签约银行
virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0;
///请求查询预埋单
virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0;
///请求查询预埋撤单
virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0;
///请求查询交易通知
virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0;
///请求查询经纪公司交易参数
virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0;
///请求查询经纪公司交易算法
virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0;
///请求查询监控中心用户令牌
virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0;
///期货发起银行资金转期货请求
virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
///期货发起期货资金转银行请求
virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
///期货发起查询银行余额请求
virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0;
///请求查询分类合约
virtual int ReqQryClassifiedInstrument(CThostFtdcQryClassifiedInstrumentField *pQryClassifiedInstrument, int nRequestID) = 0;
///请求组合优惠比例
virtual int ReqQryCombPromotionParam(CThostFtdcQryCombPromotionParamField *pQryCombPromotionParam, int nRequestID) = 0;
///投资者风险结算持仓查询
virtual int ReqQryRiskSettleInvstPosition(CThostFtdcQryRiskSettleInvstPositionField *pQryRiskSettleInvstPosition, int nRequestID) = 0;
///风险结算产品查询
virtual int ReqQryRiskSettleProductStatus(CThostFtdcQryRiskSettleProductStatusField *pQryRiskSettleProductStatus, int nRequestID) = 0;
///SPBM期货合约参数查询
virtual int ReqQrySPBMFutureParameter(CThostFtdcQrySPBMFutureParameterField *pQrySPBMFutureParameter, int nRequestID) = 0;
///SPBM期权合约参数查询
virtual int ReqQrySPBMOptionParameter(CThostFtdcQrySPBMOptionParameterField *pQrySPBMOptionParameter, int nRequestID) = 0;
///SPBM品种内对锁仓折扣参数查询
virtual int ReqQrySPBMIntraParameter(CThostFtdcQrySPBMIntraParameterField *pQrySPBMIntraParameter, int nRequestID) = 0;
///SPBM跨品种抵扣参数查询
virtual int ReqQrySPBMInterParameter(CThostFtdcQrySPBMInterParameterField *pQrySPBMInterParameter, int nRequestID) = 0;
///SPBM组合保证金套餐查询
virtual int ReqQrySPBMPortfDefinition(CThostFtdcQrySPBMPortfDefinitionField *pQrySPBMPortfDefinition, int nRequestID) = 0;
///投资者SPBM套餐选择查询
virtual int ReqQrySPBMInvestorPortfDef(CThostFtdcQrySPBMInvestorPortfDefField *pQrySPBMInvestorPortfDef, int nRequestID) = 0;
///投资者新型组合保证金系数查询
virtual int ReqQryInvestorPortfMarginRatio(CThostFtdcQryInvestorPortfMarginRatioField *pQryInvestorPortfMarginRatio, int nRequestID) = 0;
///投资者产品SPBM明细查询
virtual int ReqQryInvestorProdSPBMDetail(CThostFtdcQryInvestorProdSPBMDetailField *pQryInvestorProdSPBMDetail, int nRequestID) = 0;
///投资者商品组SPMM记录查询
virtual int ReqQryInvestorCommoditySPMMMargin(CThostFtdcQryInvestorCommoditySPMMMarginField *pQryInvestorCommoditySPMMMargin, int nRequestID) = 0;
///投资者商品群SPMM记录查询
virtual int ReqQryInvestorCommodityGroupSPMMMargin(CThostFtdcQryInvestorCommodityGroupSPMMMarginField *pQryInvestorCommodityGroupSPMMMargin, int nRequestID) = 0;
///SPMM合约参数查询
virtual int ReqQrySPMMInstParam(CThostFtdcQrySPMMInstParamField *pQrySPMMInstParam, int nRequestID) = 0;
///SPMM产品参数查询
virtual int ReqQrySPMMProductParam(CThostFtdcQrySPMMProductParamField *pQrySPMMProductParam, int nRequestID) = 0;
///SPBM附加跨品种抵扣参数查询
virtual int ReqQrySPBMAddOnInterParameter(CThostFtdcQrySPBMAddOnInterParameterField *pQrySPBMAddOnInterParameter, int nRequestID) = 0;
///RCAMS产品组合信息查询
virtual int ReqQryRCAMSCombProductInfo(CThostFtdcQryRCAMSCombProductInfoField *pQryRCAMSCombProductInfo, int nRequestID) = 0;
///RCAMS同合约风险对冲参数查询
virtual int ReqQryRCAMSInstrParameter(CThostFtdcQryRCAMSInstrParameterField *pQryRCAMSInstrParameter, int nRequestID) = 0;
///RCAMS品种内风险对冲参数查询
virtual int ReqQryRCAMSIntraParameter(CThostFtdcQryRCAMSIntraParameterField *pQryRCAMSIntraParameter, int nRequestID) = 0;
///RCAMS跨品种风险折抵参数查询
virtual int ReqQryRCAMSInterParameter(CThostFtdcQryRCAMSInterParameterField *pQryRCAMSInterParameter, int nRequestID) = 0;
///RCAMS空头期权风险调整参数查询
virtual int ReqQryRCAMSShortOptAdjustParam(CThostFtdcQryRCAMSShortOptAdjustParamField *pQryRCAMSShortOptAdjustParam, int nRequestID) = 0;
///RCAMS策略组合持仓查询
virtual int ReqQryRCAMSInvestorCombPosition(CThostFtdcQryRCAMSInvestorCombPositionField *pQryRCAMSInvestorCombPosition, int nRequestID) = 0;
///投资者品种RCAMS保证金查询
virtual int ReqQryInvestorProdRCAMSMargin(CThostFtdcQryInvestorProdRCAMSMarginField *pQryInvestorProdRCAMSMargin, int nRequestID) = 0;
///RULE合约保证金参数查询
virtual int ReqQryRULEInstrParameter(CThostFtdcQryRULEInstrParameterField *pQryRULEInstrParameter, int nRequestID) = 0;
///RULE品种内对锁仓折扣参数查询
virtual int ReqQryRULEIntraParameter(CThostFtdcQryRULEIntraParameterField *pQryRULEIntraParameter, int nRequestID) = 0;
///RULE跨品种抵扣参数查询
virtual int ReqQryRULEInterParameter(CThostFtdcQryRULEInterParameterField *pQryRULEInterParameter, int nRequestID) = 0;
///投资者产品RULE保证金查询
virtual int ReqQryInvestorProdRULEMargin(CThostFtdcQryInvestorProdRULEMarginField *pQryInvestorProdRULEMargin, int nRequestID) = 0;
///投资者新型组合保证金开关查询
virtual int ReqQryInvestorPortfSetting(CThostFtdcQryInvestorPortfSettingField *pQryInvestorPortfSetting, int nRequestID) = 0;
///投资者申报费阶梯收取记录查询
virtual int ReqQryInvestorInfoCommRec(CThostFtdcQryInvestorInfoCommRecField *pQryInvestorInfoCommRec, int nRequestID) = 0;
///组合腿信息查询
virtual int ReqQryCombLeg(CThostFtdcQryCombLegField *pQryCombLeg, int nRequestID) = 0;
///对冲设置请求
virtual int ReqOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, int nRequestID) = 0;
///对冲设置撤销请求
virtual int ReqCancelOffsetSetting(CThostFtdcInputOffsetSettingField *pInputOffsetSetting, int nRequestID) = 0;
///投资者对冲设置查询
virtual int ReqQryOffsetSetting(CThostFtdcQryOffsetSettingField *pQryOffsetSetting, int nRequestID) = 0;
protected:
~CThostFtdcTraderApi(){};
};
#endif
================================================
FILE: native/ctp_bridge/api/win/ThostFtdcUserApiDataType.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcUserApiDataType.h
///@brief 定义了客户端接口使用的业务数据类型
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#ifndef THOST_FTDCDATATYPE_H
#define THOST_FTDCDATATYPE_H
enum THOST_TE_RESUME_TYPE
{
THOST_TERT_RESTART = 0,
THOST_TERT_RESUME,
THOST_TERT_QUICK,
THOST_TERT_NONE
};
/////////////////////////////////////////////////////////////////////////
///TFtdcTraderIDType是一个交易所交易员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTraderIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDType是一个投资者代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerIDType是一个经纪公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerAbbrType是一个经纪公司简称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerAbbrType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerNameType是一个经纪公司名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldExchangeInstIDType是一个合约在交易所的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldExchangeInstIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeInstIDType是一个合约在交易所的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeInstIDType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderRefType是一个报单引用类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderRefType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcParticipantIDType是一个会员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParticipantIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserIDType是一个用户代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserIDType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordType是一个密码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPasswordType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDType是一个交易编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldInstrumentIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldInstrumentIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentCodeType是一个合约标识码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentCodeType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcMarketIDType是一个市场代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMarketIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcProductNameType是一个产品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeIDType是一个交易所代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeNameType是一个交易所名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeAbbrType是一个交易所简称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeAbbrType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeFlagType是一个交易所标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExchangeFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcMacAddressType是一个Mac地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMacAddressType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemIDType是一个系统编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSystemIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientLoginRemarkType是一个客户登录备注2类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientLoginRemarkType[151];
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangePropertyType是一个交易所属性类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_EXP_Normal '0'
///根据成交生成报单
#define THOST_FTDC_EXP_GenOrderByTrade '1'
typedef char TThostFtdcExchangePropertyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTimeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongTimeType是一个长时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongTimeType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentNameType是一个合约名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementGroupIDType是一个结算组代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettlementGroupIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSysIDType是一个报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderSysIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeIDType是一个成交编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommandTypeType是一个DB命令类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommandTypeType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldIPAddressType是一个IP地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldIPAddressType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcIPAddressType是一个IP地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIPAddressType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcIPPortType是一个IP端口类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcIPPortType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductInfoType是一个产品信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductInfoType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcProtocolInfoType是一个协议信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProtocolInfoType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessUnitType是一个业务单元类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessUnitType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcDepositSeqNoType是一个出入金流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDepositSeqNoType[15];
/////////////////////////////////////////////////////////////////////////
///TFtdcIdentifiedCardNoType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIdentifiedCardNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcIdCardTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
///组织机构代码
#define THOST_FTDC_ICT_EID '0'
///中国公民身份证
#define THOST_FTDC_ICT_IDCard '1'
///军官证
#define THOST_FTDC_ICT_OfficerIDCard '2'
///警官证
#define THOST_FTDC_ICT_PoliceIDCard '3'
///士兵证
#define THOST_FTDC_ICT_SoldierIDCard '4'
///户口簿
#define THOST_FTDC_ICT_HouseholdRegister '5'
///护照
#define THOST_FTDC_ICT_Passport '6'
///台胞证
#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7'
///回乡证
#define THOST_FTDC_ICT_HomeComingCard '8'
///营业执照号
#define THOST_FTDC_ICT_LicenseNo '9'
///税务登记号/当地纳税ID
#define THOST_FTDC_ICT_TaxNo 'A'
///港澳居民来往内地通行证
#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B'
///台湾居民来往大陆通行证
#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C'
///驾照
#define THOST_FTDC_ICT_DrivingLicense 'D'
///当地社保ID
#define THOST_FTDC_ICT_SocialID 'F'
///当地身份证
#define THOST_FTDC_ICT_LocalID 'G'
///商业登记证
#define THOST_FTDC_ICT_BusinessRegistration 'H'
///港澳永久性居民身份证
#define THOST_FTDC_ICT_HKMCIDCard 'I'
///人行开户许可证
#define THOST_FTDC_ICT_AccountsPermits 'J'
///外国人永久居留证
#define THOST_FTDC_ICT_FrgPrmtRdCard 'K'
///资管产品备案函
#define THOST_FTDC_ICT_CptMngPrdLetter 'L'
///港澳台居民居住证
#define THOST_FTDC_ICT_HKMCTwResidencePermit 'M'
///统一社会信用代码
#define THOST_FTDC_ICT_UniformSocialCreditCode 'N'
///机构成立证明文件
#define THOST_FTDC_ICT_CorporationCertNo 'O'
///其他证件
#define THOST_FTDC_ICT_OtherCard 'x'
typedef char TThostFtdcIdCardTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderLocalIDType是一个本地报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderLocalIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserNameType是一个用户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcPartyNameType是一个参与人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPartyNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcErrorMsgType是一个错误信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcErrorMsgType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcFieldNameType是一个字段名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFieldNameType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcFieldContentType是一个字段内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFieldContentType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemNameType是一个系统名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSystemNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcContentType是一个消息正文类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcContentType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_IR_All '1'
///投资者组
#define THOST_FTDC_IR_Group '2'
///单一投资者
#define THOST_FTDC_IR_Single '3'
typedef char TThostFtdcInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDepartmentRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_DR_All '1'
///组织架构
#define THOST_FTDC_DR_Group '2'
///单一投资者
#define THOST_FTDC_DR_Single '3'
typedef char TThostFtdcDepartmentRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataSyncStatusType是一个数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///未同步
#define THOST_FTDC_DS_Asynchronous '1'
///同步中
#define THOST_FTDC_DS_Synchronizing '2'
///已同步
#define THOST_FTDC_DS_Synchronized '3'
typedef char TThostFtdcDataSyncStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerDataSyncStatusType是一个经纪公司数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///已同步
#define THOST_FTDC_BDS_Synchronized '1'
///同步中
#define THOST_FTDC_BDS_Synchronizing '2'
typedef char TThostFtdcBrokerDataSyncStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeConnectStatusType是一个交易所连接状态类型
/////////////////////////////////////////////////////////////////////////
///没有任何连接
#define THOST_FTDC_ECS_NoConnection '1'
///已经发出合约查询请求
#define THOST_FTDC_ECS_QryInstrumentSent '2'
///已经获取信息
#define THOST_FTDC_ECS_GotInformation '9'
typedef char TThostFtdcExchangeConnectStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTraderConnectStatusType是一个交易所交易员连接状态类型
/////////////////////////////////////////////////////////////////////////
///没有任何连接
#define THOST_FTDC_TCS_NotConnected '1'
///已经连接
#define THOST_FTDC_TCS_Connected '2'
///已经发出合约查询请求
#define THOST_FTDC_TCS_QryInstrumentSent '3'
///订阅私有流
#define THOST_FTDC_TCS_SubPrivateFlow '4'
typedef char TThostFtdcTraderConnectStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionCodeType是一个功能代码类型
/////////////////////////////////////////////////////////////////////////
///数据异步化
#define THOST_FTDC_FC_DataAsync '1'
///强制用户登出
#define THOST_FTDC_FC_ForceUserLogout '2'
///变更管理用户口令
#define THOST_FTDC_FC_UserPasswordUpdate '3'
///变更经纪公司口令
#define THOST_FTDC_FC_BrokerPasswordUpdate '4'
///变更投资者口令
#define THOST_FTDC_FC_InvestorPasswordUpdate '5'
///报单插入
#define THOST_FTDC_FC_OrderInsert '6'
///报单操作
#define THOST_FTDC_FC_OrderAction '7'
///同步系统数据
#define THOST_FTDC_FC_SyncSystemData '8'
///同步经纪公司数据
#define THOST_FTDC_FC_SyncBrokerData '9'
///批量同步经纪公司数据
#define THOST_FTDC_FC_BachSyncBrokerData 'A'
///超级查询
#define THOST_FTDC_FC_SuperQuery 'B'
///预埋报单插入
#define THOST_FTDC_FC_ParkedOrderInsert 'C'
///预埋报单操作
#define THOST_FTDC_FC_ParkedOrderAction 'D'
///同步动态令牌
#define THOST_FTDC_FC_SyncOTP 'E'
///删除未知单
#define THOST_FTDC_FC_DeleteOrder 'F'
///退出紧急状态
#define THOST_FTDC_FC_ExitEmergency 'G'
typedef char TThostFtdcFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerFunctionCodeType是一个经纪公司功能代码类型
/////////////////////////////////////////////////////////////////////////
///强制用户登出
#define THOST_FTDC_BFC_ForceUserLogout '1'
///变更用户口令
#define THOST_FTDC_BFC_UserPasswordUpdate '2'
///同步经纪公司数据
#define THOST_FTDC_BFC_SyncBrokerData '3'
///批量同步经纪公司数据
#define THOST_FTDC_BFC_BachSyncBrokerData '4'
///报单插入
#define THOST_FTDC_BFC_OrderInsert '5'
///报单操作
#define THOST_FTDC_BFC_OrderAction '6'
///全部查询
#define THOST_FTDC_BFC_AllQuery '7'
///系统功能:登入/登出/修改密码等
#define THOST_FTDC_BFC_log 'a'
///基本查询:查询基础数据,如合约,交易所等常量
#define THOST_FTDC_BFC_BaseQry 'b'
///交易查询:如查成交,委托
#define THOST_FTDC_BFC_TradeQry 'c'
///交易功能:报单,撤单
#define THOST_FTDC_BFC_Trade 'd'
///银期转账
#define THOST_FTDC_BFC_Virement 'e'
///风险监控
#define THOST_FTDC_BFC_Risk 'f'
///查询/管理:查询会话,踢人等
#define THOST_FTDC_BFC_Session 'g'
///风控通知控制
#define THOST_FTDC_BFC_RiskNoticeCtl 'h'
///风控通知发送
#define THOST_FTDC_BFC_RiskNotice 'i'
///察看经纪公司资金权限
#define THOST_FTDC_BFC_BrokerDeposit 'j'
///资金查询
#define THOST_FTDC_BFC_QueryFund 'k'
///报单查询
#define THOST_FTDC_BFC_QueryOrder 'l'
///成交查询
#define THOST_FTDC_BFC_QueryTrade 'm'
///持仓查询
#define THOST_FTDC_BFC_QueryPosition 'n'
///行情查询
#define THOST_FTDC_BFC_QueryMarketData 'o'
///用户事件查询
#define THOST_FTDC_BFC_QueryUserEvent 'p'
///风险通知查询
#define THOST_FTDC_BFC_QueryRiskNotify 'q'
///出入金查询
#define THOST_FTDC_BFC_QueryFundChange 'r'
///投资者信息查询
#define THOST_FTDC_BFC_QueryInvestor 's'
///交易编码查询
#define THOST_FTDC_BFC_QueryTradingCode 't'
///强平
#define THOST_FTDC_BFC_ForceClose 'u'
///压力测试
#define THOST_FTDC_BFC_PressTest 'v'
///权益反算
#define THOST_FTDC_BFC_RemainCalc 'w'
///净持仓保证金指标
#define THOST_FTDC_BFC_NetPositionInd 'x'
///风险预算
#define THOST_FTDC_BFC_RiskPredict 'y'
///数据导出
#define THOST_FTDC_BFC_DataExport 'z'
///风控指标设置
#define THOST_FTDC_BFC_RiskTargetSetup 'A'
///行情预警
#define THOST_FTDC_BFC_MarketDataWarn 'B'
///业务通知查询
#define THOST_FTDC_BFC_QryBizNotice 'C'
///业务通知模板设置
#define THOST_FTDC_BFC_CfgBizNotice 'D'
///同步动态令牌
#define THOST_FTDC_BFC_SyncOTP 'E'
///发送业务通知
#define THOST_FTDC_BFC_SendBizNotice 'F'
///风险级别标准设置
#define THOST_FTDC_BFC_CfgRiskLevelStd 'G'
///交易终端应急功能
#define THOST_FTDC_BFC_TbCommand 'H'
///删除未知单
#define THOST_FTDC_BFC_DeleteOrder 'J'
///预埋报单插入
#define THOST_FTDC_BFC_ParkedOrderInsert 'K'
///预埋报单操作
#define THOST_FTDC_BFC_ParkedOrderAction 'L'
///资金不够仍允许行权
#define THOST_FTDC_BFC_ExecOrderNoCheck 'M'
///指定
#define THOST_FTDC_BFC_Designate 'N'
///证券处置
#define THOST_FTDC_BFC_StockDisposal 'O'
///席位资金预警
#define THOST_FTDC_BFC_BrokerDepositWarn 'Q'
///备兑不足预警
#define THOST_FTDC_BFC_CoverWarn 'S'
///行权试算
#define THOST_FTDC_BFC_PreExecOrder 'T'
///行权交收风险
#define THOST_FTDC_BFC_ExecOrderRisk 'P'
///持仓限额预警
#define THOST_FTDC_BFC_PosiLimitWarn 'U'
///持仓限额查询
#define THOST_FTDC_BFC_QryPosiLimit 'V'
///银期签到签退
#define THOST_FTDC_BFC_FBSign 'W'
///银期签约解约
#define THOST_FTDC_BFC_FBAccount 'X'
typedef char TThostFtdcBrokerFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderActionStatusType是一个报单操作状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_OAS_Submitted 'a'
///已经接受
#define THOST_FTDC_OAS_Accepted 'b'
///已经被拒绝
#define THOST_FTDC_OAS_Rejected 'c'
typedef char TThostFtdcOrderActionStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderStatusType是一个报单状态类型
/////////////////////////////////////////////////////////////////////////
///全部成交
#define THOST_FTDC_OST_AllTraded '0'
///部分成交还在队列中
#define THOST_FTDC_OST_PartTradedQueueing '1'
///部分成交不在队列中
#define THOST_FTDC_OST_PartTradedNotQueueing '2'
///未成交还在队列中
#define THOST_FTDC_OST_NoTradeQueueing '3'
///未成交不在队列中
#define THOST_FTDC_OST_NoTradeNotQueueing '4'
///撤单
#define THOST_FTDC_OST_Canceled '5'
///未知
#define THOST_FTDC_OST_Unknown 'a'
///尚未触发
#define THOST_FTDC_OST_NotTouched 'b'
///已触发
#define THOST_FTDC_OST_Touched 'c'
typedef char TThostFtdcOrderStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSubmitStatusType是一个报单提交状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_OSS_InsertSubmitted '0'
///撤单已经提交
#define THOST_FTDC_OSS_CancelSubmitted '1'
///修改已经提交
#define THOST_FTDC_OSS_ModifySubmitted '2'
///已经接受
#define THOST_FTDC_OSS_Accepted '3'
///报单已经被拒绝
#define THOST_FTDC_OSS_InsertRejected '4'
///撤单已经被拒绝
#define THOST_FTDC_OSS_CancelRejected '5'
///改单已经被拒绝
#define THOST_FTDC_OSS_ModifyRejected '6'
typedef char TThostFtdcOrderSubmitStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionDateType是一个持仓日期类型
/////////////////////////////////////////////////////////////////////////
///今日持仓
#define THOST_FTDC_PSD_Today '1'
///历史持仓
#define THOST_FTDC_PSD_History '2'
typedef char TThostFtdcPositionDateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionDateTypeType是一个持仓日期类型类型
/////////////////////////////////////////////////////////////////////////
///使用历史持仓
#define THOST_FTDC_PDT_UseHistory '1'
///不使用历史持仓
#define THOST_FTDC_PDT_NoUseHistory '2'
typedef char TThostFtdcPositionDateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingRoleType是一个交易角色类型
/////////////////////////////////////////////////////////////////////////
///代理
#define THOST_FTDC_ER_Broker '1'
///自营
#define THOST_FTDC_ER_Host '2'
///做市商
#define THOST_FTDC_ER_Maker '3'
typedef char TThostFtdcTradingRoleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_PC_Futures '1'
///期货期权
#define THOST_FTDC_PC_Options '2'
///组合
#define THOST_FTDC_PC_Combination '3'
///即期
#define THOST_FTDC_PC_Spot '4'
///期转现
#define THOST_FTDC_PC_EFP '5'
///现货期权
#define THOST_FTDC_PC_SpotOption '6'
///TAS合约
#define THOST_FTDC_PC_TAS '7'
///金属指数
#define THOST_FTDC_PC_MI 'I'
typedef char TThostFtdcProductClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAPIProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货单一合约
#define THOST_FTDC_APC_FutureSingle '1'
///期权单一合约
#define THOST_FTDC_APC_OptionSingle '2'
///可交易期货(含期货组合和期货单一合约)
#define THOST_FTDC_APC_Futures '3'
///可交易期权(含期权组合和期权单一合约)
#define THOST_FTDC_APC_Options '4'
///可下单套利组合
#define THOST_FTDC_APC_TradingComb '5'
///可申请的组合(可以申请的组合合约 包含可以交易的合约)
#define THOST_FTDC_APC_UnTradingComb '6'
///所有可以交易合约
#define THOST_FTDC_APC_AllTrading '7'
///所有合约(包含不能交易合约 慎用)
#define THOST_FTDC_APC_All '8'
typedef char TThostFtdcAPIProductClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstLifePhaseType是一个合约生命周期状态类型
/////////////////////////////////////////////////////////////////////////
///未上市
#define THOST_FTDC_IP_NotStart '0'
///上市
#define THOST_FTDC_IP_Started '1'
///停牌
#define THOST_FTDC_IP_Pause '2'
///到期
#define THOST_FTDC_IP_Expired '3'
typedef char TThostFtdcInstLifePhaseType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDirectionType是一个买卖方向类型
/////////////////////////////////////////////////////////////////////////
///买
#define THOST_FTDC_D_Buy '0'
///卖
#define THOST_FTDC_D_Sell '1'
typedef char TThostFtdcDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionTypeType是一个持仓类型类型
/////////////////////////////////////////////////////////////////////////
///净持仓
#define THOST_FTDC_PT_Net '1'
///综合持仓
#define THOST_FTDC_PT_Gross '2'
typedef char TThostFtdcPositionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPosiDirectionType是一个持仓多空方向类型
/////////////////////////////////////////////////////////////////////////
///净
#define THOST_FTDC_PD_Net '1'
///多头
#define THOST_FTDC_PD_Long '2'
///空头
#define THOST_FTDC_PD_Short '3'
typedef char TThostFtdcPosiDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysSettlementStatusType是一个系统结算状态类型
/////////////////////////////////////////////////////////////////////////
///不活跃
#define THOST_FTDC_SS_NonActive '1'
///启动
#define THOST_FTDC_SS_Startup '2'
///操作
#define THOST_FTDC_SS_Operating '3'
///结算
#define THOST_FTDC_SS_Settlement '4'
///结算完成
#define THOST_FTDC_SS_SettlementFinished '5'
typedef char TThostFtdcSysSettlementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRatioAttrType是一个费率属性类型
/////////////////////////////////////////////////////////////////////////
///交易费率
#define THOST_FTDC_RA_Trade '0'
///结算费率
#define THOST_FTDC_RA_Settlement '1'
typedef char TThostFtdcRatioAttrType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeFlagType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_HF_Speculation '1'
///套利
#define THOST_FTDC_HF_Arbitrage '2'
///套保
#define THOST_FTDC_HF_Hedge '3'
///做市商
#define THOST_FTDC_HF_MarketMaker '5'
///第一腿投机第二腿套保
#define THOST_FTDC_HF_SpecHedge '6'
///第一腿套保第二腿投机
#define THOST_FTDC_HF_HedgeSpec '7'
typedef char TThostFtdcHedgeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillHedgeFlagType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_BHF_Speculation '1'
///套利
#define THOST_FTDC_BHF_Arbitrage '2'
///套保
#define THOST_FTDC_BHF_Hedge '3'
typedef char TThostFtdcBillHedgeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDTypeType是一个交易编码类型类型
/////////////////////////////////////////////////////////////////////////
///投机
#define THOST_FTDC_CIDT_Speculation '1'
///套利
#define THOST_FTDC_CIDT_Arbitrage '2'
///套保
#define THOST_FTDC_CIDT_Hedge '3'
///做市商
#define THOST_FTDC_CIDT_MarketMaker '5'
typedef char TThostFtdcClientIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderPriceTypeType是一个报单价格条件类型
/////////////////////////////////////////////////////////////////////////
///任意价
#define THOST_FTDC_OPT_AnyPrice '1'
///限价
#define THOST_FTDC_OPT_LimitPrice '2'
///最优价
#define THOST_FTDC_OPT_BestPrice '3'
///最新价
#define THOST_FTDC_OPT_LastPrice '4'
///最新价浮动上浮1个ticks
#define THOST_FTDC_OPT_LastPricePlusOneTicks '5'
///最新价浮动上浮2个ticks
#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6'
///最新价浮动上浮3个ticks
#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7'
///卖一价
#define THOST_FTDC_OPT_AskPrice1 '8'
///卖一价浮动上浮1个ticks
#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9'
///卖一价浮动上浮2个ticks
#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A'
///卖一价浮动上浮3个ticks
#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B'
///买一价
#define THOST_FTDC_OPT_BidPrice1 'C'
///买一价浮动上浮1个ticks
#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D'
///买一价浮动上浮2个ticks
#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E'
///买一价浮动上浮3个ticks
#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F'
///五档价
#define THOST_FTDC_OPT_FiveLevelPrice 'G'
typedef char TThostFtdcOrderPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetFlagType是一个开平标志类型
/////////////////////////////////////////////////////////////////////////
///开仓
#define THOST_FTDC_OF_Open '0'
///平仓
#define THOST_FTDC_OF_Close '1'
///强平
#define THOST_FTDC_OF_ForceClose '2'
///平今
#define THOST_FTDC_OF_CloseToday '3'
///平昨
#define THOST_FTDC_OF_CloseYesterday '4'
///强减
#define THOST_FTDC_OF_ForceOff '5'
///本地强平
#define THOST_FTDC_OF_LocalForceClose '6'
typedef char TThostFtdcOffsetFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseReasonType是一个强平原因类型
/////////////////////////////////////////////////////////////////////////
///非强平
#define THOST_FTDC_FCC_NotForceClose '0'
///资金不足
#define THOST_FTDC_FCC_LackDeposit '1'
///客户超仓
#define THOST_FTDC_FCC_ClientOverPositionLimit '2'
///会员超仓
#define THOST_FTDC_FCC_MemberOverPositionLimit '3'
///持仓非整数倍
#define THOST_FTDC_FCC_NotMultiple '4'
///违规
#define THOST_FTDC_FCC_Violation '5'
///其它
#define THOST_FTDC_FCC_Other '6'
///自然人临近交割
#define THOST_FTDC_FCC_PersonDeliv '7'
///本地强平资金不足忽略敞口
#define THOST_FTDC_FCC_Notverifycapital '8'
///本地强平资金不足
#define THOST_FTDC_FCC_LocalLackDeposit '9'
///本地强平违规持仓忽略敞口
#define THOST_FTDC_FCC_LocalViolationNocheck 'a'
///本地强平违规持仓
#define THOST_FTDC_FCC_LocalViolation 'b'
typedef char TThostFtdcForceCloseReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderTypeType是一个报单类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_ORDT_Normal '0'
///报价衍生
#define THOST_FTDC_ORDT_DeriveFromQuote '1'
///组合衍生
#define THOST_FTDC_ORDT_DeriveFromCombination '2'
///组合报单
#define THOST_FTDC_ORDT_Combination '3'
///条件单
#define THOST_FTDC_ORDT_ConditionalOrder '4'
///互换单
#define THOST_FTDC_ORDT_Swap '5'
///大宗交易成交衍生
#define THOST_FTDC_ORDT_DeriveFromBlockTrade '6'
///期转现成交衍生
#define THOST_FTDC_ORDT_DeriveFromEFPTrade '7'
typedef char TThostFtdcOrderTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeConditionType是一个有效期类型类型
/////////////////////////////////////////////////////////////////////////
///立即完成,否则撤销
#define THOST_FTDC_TC_IOC '1'
///本节有效
#define THOST_FTDC_TC_GFS '2'
///当日有效
#define THOST_FTDC_TC_GFD '3'
///指定日期前有效
#define THOST_FTDC_TC_GTD '4'
///撤销前有效
#define THOST_FTDC_TC_GTC '5'
///集合竞价有效
#define THOST_FTDC_TC_GFA '6'
typedef char TThostFtdcTimeConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeConditionType是一个成交量类型类型
/////////////////////////////////////////////////////////////////////////
///任何数量
#define THOST_FTDC_VC_AV '1'
///最小数量
#define THOST_FTDC_VC_MV '2'
///全部数量
#define THOST_FTDC_VC_CV '3'
typedef char TThostFtdcVolumeConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcContingentConditionType是一个触发条件类型
/////////////////////////////////////////////////////////////////////////
///立即
#define THOST_FTDC_CC_Immediately '1'
///止损
#define THOST_FTDC_CC_Touch '2'
///止赢
#define THOST_FTDC_CC_TouchProfit '3'
///预埋单
#define THOST_FTDC_CC_ParkedOrder '4'
///最新价大于条件价
#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5'
///最新价大于等于条件价
#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6'
///最新价小于条件价
#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7'
///最新价小于等于条件价
#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8'
///卖一价大于条件价
#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9'
///卖一价大于等于条件价
#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A'
///卖一价小于条件价
#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B'
///卖一价小于等于条件价
#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C'
///买一价大于条件价
#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D'
///买一价大于等于条件价
#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E'
///买一价小于条件价
#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F'
///买一价小于等于条件价
#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H'
typedef char TThostFtdcContingentConditionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionFlagType是一个操作标志类型
/////////////////////////////////////////////////////////////////////////
///删除
#define THOST_FTDC_AF_Delete '0'
///修改
#define THOST_FTDC_AF_Modify '3'
typedef char TThostFtdcActionFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingRightType是一个交易权限类型
/////////////////////////////////////////////////////////////////////////
///可以交易
#define THOST_FTDC_TR_Allow '0'
///只能平仓
#define THOST_FTDC_TR_CloseOnly '1'
///不能交易
#define THOST_FTDC_TR_Forbidden '2'
typedef char TThostFtdcTradingRightType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderSourceType是一个报单来源类型
/////////////////////////////////////////////////////////////////////////
///来自参与者
#define THOST_FTDC_OSRC_Participant '0'
///来自管理员
#define THOST_FTDC_OSRC_Administrator '1'
typedef char TThostFtdcOrderSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeTypeType是一个成交类型类型
/////////////////////////////////////////////////////////////////////////
///组合持仓拆分为单一持仓,初始化不应包含该类型的持仓
#define THOST_FTDC_TRDT_SplitCombination '#'
///普通成交
#define THOST_FTDC_TRDT_Common '0'
///期权执行
#define THOST_FTDC_TRDT_OptionsExecution '1'
///OTC成交
#define THOST_FTDC_TRDT_OTC '2'
///期转现衍生成交
#define THOST_FTDC_TRDT_EFPDerived '3'
///组合衍生成交
#define THOST_FTDC_TRDT_CombinationDerived '4'
///大宗交易成交
#define THOST_FTDC_TRDT_BlockTrade '5'
typedef char TThostFtdcTradeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecPosiTypeType是一个特殊持仓明细标识类型
/////////////////////////////////////////////////////////////////////////
///普通持仓明细
#define THOST_FTDC_SPOST_Common '#'
///TAS合约成交产生的标的合约持仓明细
#define THOST_FTDC_SPOST_Tas '0'
typedef char TThostFtdcSpecPosiTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceSourceType是一个成交价来源类型
/////////////////////////////////////////////////////////////////////////
///前成交价
#define THOST_FTDC_PSRC_LastPrice '0'
///买委托价
#define THOST_FTDC_PSRC_Buy '1'
///卖委托价
#define THOST_FTDC_PSRC_Sell '2'
///场外成交价
#define THOST_FTDC_PSRC_OTC '3'
typedef char TThostFtdcPriceSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentStatusType是一个合约交易状态类型
/////////////////////////////////////////////////////////////////////////
///开盘前
#define THOST_FTDC_IS_BeforeTrading '0'
///非交易
#define THOST_FTDC_IS_NoTrading '1'
///连续交易
#define THOST_FTDC_IS_Continous '2'
///集合竞价报单
#define THOST_FTDC_IS_AuctionOrdering '3'
///集合竞价价格平衡
#define THOST_FTDC_IS_AuctionBalance '4'
///集合竞价撮合
#define THOST_FTDC_IS_AuctionMatch '5'
///收盘
#define THOST_FTDC_IS_Closed '6'
///交易业务处理
#define THOST_FTDC_IS_TransactionProcessing '7'
typedef char TThostFtdcInstrumentStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstStatusEnterReasonType是一个品种进入交易状态原因类型
/////////////////////////////////////////////////////////////////////////
///自动切换
#define THOST_FTDC_IER_Automatic '1'
///手动切换
#define THOST_FTDC_IER_Manual '2'
///熔断
#define THOST_FTDC_IER_Fuse '3'
typedef char TThostFtdcInstStatusEnterReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderActionRefType是一个报单操作引用类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcOrderActionRefType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstallCountType是一个安装数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcInstallCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstallIDType是一个安装编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcInstallIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcErrorIDType是一个错误代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcErrorIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementIDType是一个结算编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSettlementIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeType是一个数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcVolumeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFrontIDType是一个前置编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFrontIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSessionIDType是一个会话编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSessionIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceNoType是一个序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSequenceNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommandNoType是一个DB命令序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommandNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMillisecType是一个时间(毫秒)类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMillisecType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSecType是一个时间(秒)类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSecType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVolumeMultipleType是一个合约数量乘数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcVolumeMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingSegmentSNType是一个交易阶段编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradingSegmentSNType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRequestIDType是一个请求编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRequestIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcYearType是一个年份类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcYearType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthType是一个月份类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMonthType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBoolType是一个布尔型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBoolType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceType是一个价格类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcPriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombOffsetFlagType是一个组合开平标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombOffsetFlagType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombHedgeFlagType是一个组合投机套保标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombHedgeFlagType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcRatioType是一个比率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLargeVolumeType是一个大额数量类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcLargeVolumeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceSeriesType是一个序列系列号类型
/////////////////////////////////////////////////////////////////////////
typedef short TThostFtdcSequenceSeriesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommPhaseNoType是一个通讯时段编号类型
/////////////////////////////////////////////////////////////////////////
typedef short TThostFtdcCommPhaseNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceLabelType是一个序列编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSequenceLabelType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcUnderlyingMultipleType是一个基础商品乘数类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcUnderlyingMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcContractCodeType是一个合同编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcContractCodeType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcCityType是一个市类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCityType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcIsStockType是一个是否股民类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIsStockType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcChannelType是一个渠道类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcChannelType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddressType是一个通讯地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddressType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcZipCodeType是一个邮政编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcZipCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcTelephoneType是一个联系电话类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTelephoneType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcFaxType是一个传真类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFaxType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcMobileType是一个手机类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMobileType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcEMailType是一个电子邮件类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEMailType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcMemoType是一个备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMemoType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcCompanyCodeType是一个企业代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCompanyCodeType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcWebsiteType是一个网站地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWebsiteType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcTaxNoType是一个税务登记号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTaxNoType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcBatchStatusType是一个处理状态类型
/////////////////////////////////////////////////////////////////////////
///未上传
#define THOST_FTDC_BS_NoUpload '1'
///已上传
#define THOST_FTDC_BS_Uploaded '2'
///审核失败
#define THOST_FTDC_BS_Failed '3'
typedef char TThostFtdcBatchStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyIDType是一个属性代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyNameType是一个属性名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcLicenseNoType是一个营业执照号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLicenseNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentIDType是一个经纪人代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentNameType是一个经纪人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentGroupIDType是一个经纪人组代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentGroupIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentGroupNameType是一个经纪人组名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentGroupNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnStyleType是一个按品种返还方式类型
/////////////////////////////////////////////////////////////////////////
///按所有品种
#define THOST_FTDC_RS_All '1'
///按品种
#define THOST_FTDC_RS_ByProduct '2'
typedef char TThostFtdcReturnStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnPatternType是一个返还模式类型
/////////////////////////////////////////////////////////////////////////
///按成交手数
#define THOST_FTDC_RP_ByVolume '1'
///按留存手续费
#define THOST_FTDC_RP_ByFeeOnHand '2'
typedef char TThostFtdcReturnPatternType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnLevelType是一个返还级别类型
/////////////////////////////////////////////////////////////////////////
///级别1
#define THOST_FTDC_RL_Level1 '1'
///级别2
#define THOST_FTDC_RL_Level2 '2'
///级别3
#define THOST_FTDC_RL_Level3 '3'
///级别4
#define THOST_FTDC_RL_Level4 '4'
///级别5
#define THOST_FTDC_RL_Level5 '5'
///级别6
#define THOST_FTDC_RL_Level6 '6'
///级别7
#define THOST_FTDC_RL_Level7 '7'
///级别8
#define THOST_FTDC_RL_Level8 '8'
///级别9
#define THOST_FTDC_RL_Level9 '9'
typedef char TThostFtdcReturnLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnStandardType是一个返还标准类型
/////////////////////////////////////////////////////////////////////////
///分阶段返还
#define THOST_FTDC_RSD_ByPeriod '1'
///按某一标准
#define THOST_FTDC_RSD_ByStandard '2'
typedef char TThostFtdcReturnStandardType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMortgageTypeType是一个质押类型类型
/////////////////////////////////////////////////////////////////////////
///质出
#define THOST_FTDC_MT_Out '0'
///质入
#define THOST_FTDC_MT_In '1'
typedef char TThostFtdcMortgageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorSettlementParamIDType是一个投资者结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///质押比例
#define THOST_FTDC_ISPI_MortgageRatio '4'
///保证金算法
#define THOST_FTDC_ISPI_MarginWay '5'
///结算单结存是否包含质押
#define THOST_FTDC_ISPI_BillDeposit '9'
typedef char TThostFtdcInvestorSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeSettlementParamIDType是一个交易所结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///质押比例
#define THOST_FTDC_ESPI_MortgageRatio '1'
///分项资金导入项
#define THOST_FTDC_ESPI_OtherFundItem '2'
///分项资金入交易所出入金
#define THOST_FTDC_ESPI_OtherFundImport '3'
///中金所开户最低可用金额
#define THOST_FTDC_ESPI_CFFEXMinPrepa '6'
///郑商所结算方式
#define THOST_FTDC_ESPI_CZCESettlementType '7'
///交易所交割手续费收取方式
#define THOST_FTDC_ESPI_ExchDelivFeeMode '9'
///投资者交割手续费收取方式
#define THOST_FTDC_ESPI_DelivFeeMode '0'
///郑商所组合持仓保证金收取方式
#define THOST_FTDC_ESPI_CZCEComMarginType 'A'
///大商所套利保证金是否优惠
#define THOST_FTDC_ESPI_DceComMarginType 'B'
///虚值期权保证金优惠比率
#define THOST_FTDC_ESPI_OptOutDisCountRate 'a'
///最低保障系数
#define THOST_FTDC_ESPI_OptMiniGuarantee 'b'
typedef char TThostFtdcExchangeSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemParamIDType是一个系统参数代码类型
/////////////////////////////////////////////////////////////////////////
///投资者代码最小长度
#define THOST_FTDC_SPI_InvestorIDMinLength '1'
///投资者帐号代码最小长度
#define THOST_FTDC_SPI_AccountIDMinLength '2'
///投资者开户默认登录权限
#define THOST_FTDC_SPI_UserRightLogon '3'
///投资者交易结算单成交汇总方式
#define THOST_FTDC_SPI_SettlementBillTrade '4'
///统一开户更新交易编码方式
#define THOST_FTDC_SPI_TradingCode '5'
///结算是否判断存在未复核的出入金和分项资金
#define THOST_FTDC_SPI_CheckFund '6'
///是否启用手续费模板数据权限
#define THOST_FTDC_SPI_CommModelRight '7'
///是否启用保证金率模板数据权限
#define THOST_FTDC_SPI_MarginModelRight '9'
///是否规范用户才能激活
#define THOST_FTDC_SPI_IsStandardActive '8'
///上传的交易所结算文件路径
#define THOST_FTDC_SPI_UploadSettlementFile 'U'
///上报保证金监控中心文件路径
#define THOST_FTDC_SPI_DownloadCSRCFile 'D'
///生成的结算单文件路径
#define THOST_FTDC_SPI_SettlementBillFile 'S'
///证监会文件标识
#define THOST_FTDC_SPI_CSRCOthersFile 'C'
///投资者照片路径
#define THOST_FTDC_SPI_InvestorPhoto 'P'
///全结经纪公司上传文件路径
#define THOST_FTDC_SPI_CSRCData 'R'
///开户密码录入方式
#define THOST_FTDC_SPI_InvestorPwdModel 'I'
///投资者中金所结算文件下载路径
#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F'
///投资者代码编码方式
#define THOST_FTDC_SPI_InvestorIDType 'a'
///休眠户最高权益
#define THOST_FTDC_SPI_FreezeMaxReMain 'r'
///手续费相关操作实时上场开关
#define THOST_FTDC_SPI_IsSync 'A'
///解除开仓权限限制
#define THOST_FTDC_SPI_RelieveOpenLimit 'O'
///是否规范用户才能休眠
#define THOST_FTDC_SPI_IsStandardFreeze 'X'
///郑商所是否开放所有品种套保交易
#define THOST_FTDC_SPI_CZCENormalProductHedge 'B'
typedef char TThostFtdcSystemParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeParamIDType是一个交易系统参数代码类型
/////////////////////////////////////////////////////////////////////////
///系统加密算法
#define THOST_FTDC_TPID_EncryptionStandard 'E'
///系统风险算法
#define THOST_FTDC_TPID_RiskMode 'R'
///系统风险算法是否全局 0-否 1-是
#define THOST_FTDC_TPID_RiskModeGlobal 'G'
///密码加密算法
#define THOST_FTDC_TPID_modeEncode 'P'
///价格小数位数参数
#define THOST_FTDC_TPID_tickMode 'T'
///用户最大会话数
#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S'
///最大连续登录失败数
#define THOST_FTDC_TPID_LoginFailMaxNum 'L'
///是否强制认证
#define THOST_FTDC_TPID_IsAuthForce 'A'
///是否冻结证券持仓
#define THOST_FTDC_TPID_IsPosiFreeze 'F'
///是否限仓
#define THOST_FTDC_TPID_IsPosiLimit 'M'
///郑商所询价时间间隔
#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q'
///是否期货限仓
#define THOST_FTDC_TPID_IsFuturePosiLimit 'B'
///是否期货下单频率限制
#define THOST_FTDC_TPID_IsFutureOrderFreq 'C'
///行权冻结是否计算盈利
#define THOST_FTDC_TPID_IsExecOrderProfit 'H'
///银期开户是否验证开户银行卡号是否是预留银行账户
#define THOST_FTDC_TPID_IsCheckBankAcc 'I'
///弱密码最后修改日期
#define THOST_FTDC_TPID_PasswordDeadLine 'J'
///强密码校验
#define THOST_FTDC_TPID_IsStrongPassword 'K'
///自有资金质押比
#define THOST_FTDC_TPID_BalanceMorgage 'a'
///最小密码长度
#define THOST_FTDC_TPID_MinPwdLen 'O'
///IP当日最大登陆失败次数
#define THOST_FTDC_TPID_LoginFailMaxNumForIP 'U'
///密码有效期
#define THOST_FTDC_TPID_PasswordPeriod 'V'
///历史密码重复限制次数
#define THOST_FTDC_TPID_PwdHistoryCmp 'X'
///转账是否验证预留银行账户
#define THOST_FTDC_TPID_TranferChkProperty 'i'
///非交易时间异常报单校验参数
#define THOST_FTDC_TPID_TradeChkPhase 'j'
///其他异常报单校验参数(价格和手数)
#define THOST_FTDC_TPID_TradeChkPriceVol 'k'
///卖出垂直价差组合新算法
#define THOST_FTDC_TPID_NewBESMarginAlgo 'l'
typedef char TThostFtdcTradeParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementParamValueType是一个参数代码值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettlementParamValueType[256];
/////////////////////////////////////////////////////////////////////////
///TFtdcCounterIDType是一个计数器代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCounterIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorGroupNameType是一个投资者分组名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorGroupNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcBrandCodeType是一个牌号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrandCodeType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcWarehouseType是一个仓库类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWarehouseType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcProductDateType是一个产期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductDateType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcGradeType是一个等级类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcGradeType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcClassifyType是一个类别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClassifyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcPositionType是一个货位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPositionType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcYieldlyType是一个产地类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcYieldlyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcWeightType是一个公定重量类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWeightType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubEntryFundNoType是一个分项资金流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSubEntryFundNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileIDType是一个文件标识类型
/////////////////////////////////////////////////////////////////////////
///资金数据
#define THOST_FTDC_FI_SettlementFund 'F'
///成交数据
#define THOST_FTDC_FI_Trade 'T'
///投资者持仓数据
#define THOST_FTDC_FI_InvestorPosition 'P'
///投资者分项资金数据
#define THOST_FTDC_FI_SubEntryFund 'O'
///组合持仓数据
#define THOST_FTDC_FI_CZCECombinationPos 'C'
///上报保证金监控中心数据
#define THOST_FTDC_FI_CSRCData 'R'
///郑商所平仓了结数据
#define THOST_FTDC_FI_CZCEClose 'L'
///郑商所非平仓了结数据
#define THOST_FTDC_FI_CZCENoClose 'N'
///持仓明细数据
#define THOST_FTDC_FI_PositionDtl 'D'
///期权执行文件
#define THOST_FTDC_FI_OptionStrike 'S'
///结算价比对文件
#define THOST_FTDC_FI_SettlementPriceComparison 'M'
///上期所非持仓变动明细
#define THOST_FTDC_FI_NonTradePosChange 'B'
typedef char TThostFtdcFileIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileNameType是一个文件名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFileNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcFileTypeType是一个文件上传类型类型
/////////////////////////////////////////////////////////////////////////
///结算
#define THOST_FTDC_FUT_Settlement '0'
///核对
#define THOST_FTDC_FUT_Check '1'
typedef char TThostFtdcFileTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileFormatType是一个文件格式类型
/////////////////////////////////////////////////////////////////////////
///文本文件(.txt)
#define THOST_FTDC_FFT_Txt '0'
///压缩文件(.zip)
#define THOST_FTDC_FFT_Zip '1'
///DBF文件(.dbf)
#define THOST_FTDC_FFT_DBF '2'
typedef char TThostFtdcFileFormatType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileUploadStatusType是一个文件状态类型
/////////////////////////////////////////////////////////////////////////
///上传成功
#define THOST_FTDC_FUS_SucceedUpload '1'
///上传失败
#define THOST_FTDC_FUS_FailedUpload '2'
///导入成功
#define THOST_FTDC_FUS_SucceedLoad '3'
///导入部分成功
#define THOST_FTDC_FUS_PartSucceedLoad '4'
///导入失败
#define THOST_FTDC_FUS_FailedLoad '5'
typedef char TThostFtdcFileUploadStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferDirectionType是一个移仓方向类型
/////////////////////////////////////////////////////////////////////////
///移出
#define THOST_FTDC_TD_Out '0'
///移入
#define THOST_FTDC_TD_In '1'
typedef char TThostFtdcTransferDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUploadModeType是一个上传文件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUploadModeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountIDType是一个投资者帐号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAccountIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankFlagType是一个银行统一标识类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankFlagType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountType是一个银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenNameType是一个银行账户的开户人名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOpenNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenBankType是一个银行账户的开户行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOpenBankType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankNameType是一个银行名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcPublishPathType是一个发布路径类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPublishPathType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperatorIDType是一个操作员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperatorIDType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthCountType是一个月份数量类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcMonthCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdvanceMonthArrayType是一个月份提前数组类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAdvanceMonthArrayType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcDateExprType是一个日期表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateExprType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDExprType是一个合约代码表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDExprType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentNameExprType是一个合约名称表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentNameExprType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecialCreateRuleType是一个特殊的创建规则类型
/////////////////////////////////////////////////////////////////////////
///没有特殊创建规则
#define THOST_FTDC_SC_NoSpecialRule '0'
///不包含春节
#define THOST_FTDC_SC_NoSpringFestival '1'
typedef char TThostFtdcSpecialCreateRuleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBasisPriceTypeType是一个挂牌基准价类型类型
/////////////////////////////////////////////////////////////////////////
///上一合约结算价
#define THOST_FTDC_IPT_LastSettlement '1'
///上一合约收盘价
#define THOST_FTDC_IPT_LaseClose '2'
typedef char TThostFtdcBasisPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductLifePhaseType是一个产品生命周期状态类型
/////////////////////////////////////////////////////////////////////////
///活跃
#define THOST_FTDC_PLP_Active '1'
///不活跃
#define THOST_FTDC_PLP_NonActive '2'
///注销
#define THOST_FTDC_PLP_Canceled '3'
typedef char TThostFtdcProductLifePhaseType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeliveryModeType是一个交割方式类型
/////////////////////////////////////////////////////////////////////////
///现金交割
#define THOST_FTDC_DM_CashDeliv '1'
///实物交割
#define THOST_FTDC_DM_CommodityDeliv '2'
typedef char TThostFtdcDeliveryModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLogLevelType是一个日志级别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLogLevelType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessNameType是一个存储过程名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperationMemoType是一个操作摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperationMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcFundIOTypeType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///出入金
#define THOST_FTDC_FIOT_FundIO '1'
///银期转帐
#define THOST_FTDC_FIOT_Transfer '2'
///银期换汇
#define THOST_FTDC_FIOT_SwapCurrency '3'
typedef char TThostFtdcFundIOTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundTypeType是一个资金类型类型
/////////////////////////////////////////////////////////////////////////
///银行存款
#define THOST_FTDC_FT_Deposite '1'
///分项资金
#define THOST_FTDC_FT_ItemFund '2'
///公司调整
#define THOST_FTDC_FT_Company '3'
///资金内转
#define THOST_FTDC_FT_InnerTransfer '4'
typedef char TThostFtdcFundTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundDirectionType是一个出入金方向类型
/////////////////////////////////////////////////////////////////////////
///入金
#define THOST_FTDC_FD_In '1'
///出金
#define THOST_FTDC_FD_Out '2'
typedef char TThostFtdcFundDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundStatusType是一个资金状态类型
/////////////////////////////////////////////////////////////////////////
///已录入
#define THOST_FTDC_FS_Record '1'
///已复核
#define THOST_FTDC_FS_Check '2'
///已冲销
#define THOST_FTDC_FS_Charge '3'
typedef char TThostFtdcFundStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillNoType是一个票据号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBillNoType[15];
/////////////////////////////////////////////////////////////////////////
///TFtdcBillNameType是一个票据名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBillNameType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcPublishStatusType是一个发布状态类型
/////////////////////////////////////////////////////////////////////////
///未发布
#define THOST_FTDC_PS_None '1'
///正在发布
#define THOST_FTDC_PS_Publishing '2'
///已发布
#define THOST_FTDC_PS_Published '3'
typedef char TThostFtdcPublishStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueIDType是一个枚举值代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueIDType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueTypeType是一个枚举值类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueLabelType是一个枚举值名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueLabelType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumValueResultType是一个枚举值结果类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEnumValueResultType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemStatusType是一个系统状态类型
/////////////////////////////////////////////////////////////////////////
///不活跃
#define THOST_FTDC_ES_NonActive '1'
///启动
#define THOST_FTDC_ES_Startup '2'
///交易开始初始化
#define THOST_FTDC_ES_Initialize '3'
///交易完成初始化
#define THOST_FTDC_ES_Initialized '4'
///收市开始
#define THOST_FTDC_ES_Close '5'
///收市完成
#define THOST_FTDC_ES_Closed '6'
///结算
#define THOST_FTDC_ES_Settlement '7'
typedef char TThostFtdcSystemStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementStatusType是一个结算状态类型
/////////////////////////////////////////////////////////////////////////
///初始
#define THOST_FTDC_STS_Initialize '0'
///结算中
#define THOST_FTDC_STS_Settlementing '1'
///已结算
#define THOST_FTDC_STS_Settlemented '2'
///结算完成
#define THOST_FTDC_STS_Finished '3'
typedef char TThostFtdcSettlementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntTypeType是一个限定值类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntFromType是一个限定值下限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntFromType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcRangeIntToType是一个限定值上限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRangeIntToType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionIDType是一个功能代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionIDType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionValueCodeType是一个功能编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionValueCodeType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionNameType是一个功能名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcRoleIDType是一个角色编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRoleIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcRoleNameType是一个角色名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRoleNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcDescriptionType是一个描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDescriptionType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombineIDType是一个组合编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombineIDType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombineTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombineTypeType[25];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorTypeType是一个投资者类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CT_Person '0'
///法人
#define THOST_FTDC_CT_Company '1'
///投资基金
#define THOST_FTDC_CT_Fund '2'
///特殊法人
#define THOST_FTDC_CT_SpecialOrgan '3'
///资管户
#define THOST_FTDC_CT_Asset '4'
typedef char TThostFtdcInvestorTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerTypeType是一个经纪公司类型类型
/////////////////////////////////////////////////////////////////////////
///交易会员
#define THOST_FTDC_BT_Trade '0'
///交易结算会员
#define THOST_FTDC_BT_TradeSettle '1'
typedef char TThostFtdcBrokerTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskLevelType是一个风险等级类型
/////////////////////////////////////////////////////////////////////////
///低风险客户
#define THOST_FTDC_FAS_Low '1'
///普通客户
#define THOST_FTDC_FAS_Normal '2'
///关注客户
#define THOST_FTDC_FAS_Focus '3'
///风险客户
#define THOST_FTDC_FAS_Risk '4'
typedef char TThostFtdcRiskLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFeeAcceptStyleType是一个手续费收取方式类型
/////////////////////////////////////////////////////////////////////////
///按交易收取
#define THOST_FTDC_FAS_ByTrade '1'
///按交割收取
#define THOST_FTDC_FAS_ByDeliv '2'
///不收
#define THOST_FTDC_FAS_None '3'
///按指定手续费收取
#define THOST_FTDC_FAS_FixFee '4'
typedef char TThostFtdcFeeAcceptStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordTypeType是一个密码类型类型
/////////////////////////////////////////////////////////////////////////
///交易密码
#define THOST_FTDC_PWDT_Trade '1'
///资金密码
#define THOST_FTDC_PWDT_Account '2'
typedef char TThostFtdcPasswordTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAlgorithmType是一个盈亏算法类型
/////////////////////////////////////////////////////////////////////////
///浮盈浮亏都计算
#define THOST_FTDC_AG_All '1'
///浮盈不计,浮亏计
#define THOST_FTDC_AG_OnlyLost '2'
///浮盈计,浮亏不计
#define THOST_FTDC_AG_OnlyGain '3'
///浮盈浮亏都不计算
#define THOST_FTDC_AG_None '4'
typedef char TThostFtdcAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIncludeCloseProfitType是一个是否包含平仓盈利类型
/////////////////////////////////////////////////////////////////////////
///包含平仓盈利
#define THOST_FTDC_ICP_Include '0'
///不包含平仓盈利
#define THOST_FTDC_ICP_NotInclude '2'
typedef char TThostFtdcIncludeCloseProfitType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAllWithoutTradeType是一个是否受可提比例限制类型
/////////////////////////////////////////////////////////////////////////
///无仓无成交不受可提比例限制
#define THOST_FTDC_AWT_Enable '0'
///受可提比例限制
#define THOST_FTDC_AWT_Disable '2'
///无仓不受可提比例限制
#define THOST_FTDC_AWT_NoHoldEnable '3'
typedef char TThostFtdcAllWithoutTradeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommentType是一个盈亏算法说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommentType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcVersionType是一个版本号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcVersionType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeCodeType是一个交易代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeDateType是一个交易日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeDateType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeTimeType是一个交易时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeTimeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSerialType是一个发起方流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeSerialType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSerialNoType是一个发起方流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradeSerialNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureIDType是一个期货公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankIDType是一个银行代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankBrchIDType是一个银行分中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankBrchIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankBranchIDType是一个分中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankBranchIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperNoType是一个交易柜员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperNoType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcDeviceIDType是一个渠道标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDeviceIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcRecordNumType是一个记录数类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRecordNumType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccountType是一个期货资金账号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccountType[22];
/////////////////////////////////////////////////////////////////////////
///TFtdcFuturePwdFlagType是一个资金密码核对标志类型
/////////////////////////////////////////////////////////////////////////
///不核对
#define THOST_FTDC_FPWD_UnCheck '0'
///核对
#define THOST_FTDC_FPWD_Check '1'
typedef char TThostFtdcFuturePwdFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferTypeType是一个银期转账类型类型
/////////////////////////////////////////////////////////////////////////
///银行转期货
#define THOST_FTDC_TT_BankToFuture '0'
///期货转银行
#define THOST_FTDC_TT_FutureToBank '1'
typedef char TThostFtdcTransferTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccPwdType是一个期货资金密码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccPwdType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyCodeType是一个币种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyCodeType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcRetCodeType是一个响应代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRetCodeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcRetInfoType是一个响应信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRetInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeAmtType是一个银行总余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTradeAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcUseAmtType是一个银行可用余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUseAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcFetchAmtType是一个银行可取余额类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFetchAmtType[20];
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferValidFlagType是一个转账有效标志类型
/////////////////////////////////////////////////////////////////////////
///无效或失败
#define THOST_FTDC_TVF_Invalid '0'
///有效
#define THOST_FTDC_TVF_Valid '1'
///冲正
#define THOST_FTDC_TVF_Reverse '2'
typedef char TThostFtdcTransferValidFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCertCodeType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCertCodeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcReasonType是一个事由类型
/////////////////////////////////////////////////////////////////////////
///错单
#define THOST_FTDC_RN_CD '0'
///资金在途
#define THOST_FTDC_RN_ZT '1'
///其它
#define THOST_FTDC_RN_QT '2'
typedef char TThostFtdcReasonType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundProjectIDType是一个资金项目编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFundProjectIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcSexType是一个性别类型
/////////////////////////////////////////////////////////////////////////
///未知
#define THOST_FTDC_SEX_None '0'
///男
#define THOST_FTDC_SEX_Man '1'
///女
#define THOST_FTDC_SEX_Woman '2'
typedef char TThostFtdcSexType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProfessionType是一个职业类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProfessionType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcNationalType是一个国籍类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNationalType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcProvinceType是一个省类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProvinceType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcRegionType是一个区类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRegionType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcCountryType是一个国家类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCountryType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcLicenseNOType是一个营业执照类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLicenseNOType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcCompanyTypeType是一个企业性质类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCompanyTypeType[16];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessScopeType是一个经营范围类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessScopeType[1001];
/////////////////////////////////////////////////////////////////////////
///TFtdcCapitalCurrencyType是一个注册资本币种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCapitalCurrencyType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserTypeType是一个用户类型类型
/////////////////////////////////////////////////////////////////////////
///投资者
#define THOST_FTDC_UT_Investor '0'
///操作员
#define THOST_FTDC_UT_Operator '1'
///管理员
#define THOST_FTDC_UT_SuperUser '2'
typedef char TThostFtdcUserTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchIDType是一个营业部编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTypeType是一个费率类型类型
/////////////////////////////////////////////////////////////////////////
///保证金率
#define THOST_FTDC_RATETYPE_MarginRate '2'
typedef char TThostFtdcRateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNoteTypeType是一个通知类型类型
/////////////////////////////////////////////////////////////////////////
///交易结算单
#define THOST_FTDC_NOTETYPE_TradeSettleBill '1'
///交易结算月报
#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2'
///追加保证金通知书
#define THOST_FTDC_NOTETYPE_CallMarginNotes '3'
///强行平仓通知书
#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4'
///成交通知书
#define THOST_FTDC_NOTETYPE_TradeNotes '5'
///交割通知书
#define THOST_FTDC_NOTETYPE_DelivNotes '6'
typedef char TThostFtdcNoteTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementStyleType是一个结算单方式类型
/////////////////////////////////////////////////////////////////////////
///逐日盯市
#define THOST_FTDC_SBS_Day '1'
///逐笔对冲
#define THOST_FTDC_SBS_Volume '2'
typedef char TThostFtdcSettlementStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerDNSType是一个域名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBrokerDNSType[256];
/////////////////////////////////////////////////////////////////////////
///TFtdcSentenceType是一个语句类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSentenceType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettlementBillTypeType是一个结算单类型类型
/////////////////////////////////////////////////////////////////////////
///日报
#define THOST_FTDC_ST_Day '0'
///月报
#define THOST_FTDC_ST_Month '1'
typedef char TThostFtdcSettlementBillTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserRightTypeType是一个客户权限类型类型
/////////////////////////////////////////////////////////////////////////
///登录
#define THOST_FTDC_URT_Logon '1'
///银期转帐
#define THOST_FTDC_URT_Transfer '2'
///邮寄结算单
#define THOST_FTDC_URT_EMail '3'
///传真结算单
#define THOST_FTDC_URT_Fax '4'
///条件单
#define THOST_FTDC_URT_ConditionOrder '5'
typedef char TThostFtdcUserRightTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginPriceTypeType是一个保证金价格类型类型
/////////////////////////////////////////////////////////////////////////
///昨结算价
#define THOST_FTDC_MPT_PreSettlementPrice '1'
///最新价
#define THOST_FTDC_MPT_SettlementPrice '2'
///成交均价
#define THOST_FTDC_MPT_AveragePrice '3'
///开仓价
#define THOST_FTDC_MPT_OpenPrice '4'
typedef char TThostFtdcMarginPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBillGenStatusType是一个结算单生成状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_BGS_None '0'
///生成中
#define THOST_FTDC_BGS_NoGenerated '1'
///已生成
#define THOST_FTDC_BGS_Generated '2'
typedef char TThostFtdcBillGenStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAlgoTypeType是一个算法类型类型
/////////////////////////////////////////////////////////////////////////
///持仓处理算法
#define THOST_FTDC_AT_HandlePositionAlgo '1'
///寻找保证金率算法
#define THOST_FTDC_AT_FindMarginRateAlgo '2'
typedef char TThostFtdcAlgoTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandlePositionAlgoIDType是一个持仓处理算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_HPA_Base '1'
///大连商品交易所
#define THOST_FTDC_HPA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_HPA_CZCE '3'
typedef char TThostFtdcHandlePositionAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFindMarginRateAlgoIDType是一个寻找保证金率算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_FMRA_Base '1'
///大连商品交易所
#define THOST_FTDC_FMRA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_FMRA_CZCE '3'
typedef char TThostFtdcFindMarginRateAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandleTradingAccountAlgoIDType是一个资金处理算法编号类型
/////////////////////////////////////////////////////////////////////////
///基本
#define THOST_FTDC_HTAA_Base '1'
///大连商品交易所
#define THOST_FTDC_HTAA_DCE '2'
///郑州商品交易所
#define THOST_FTDC_HTAA_CZCE '3'
typedef char TThostFtdcHandleTradingAccountAlgoIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPersonTypeType是一个联系人类型类型
/////////////////////////////////////////////////////////////////////////
///指定下单人
#define THOST_FTDC_PST_Order '1'
///开户授权人
#define THOST_FTDC_PST_Open '2'
///资金调拨人
#define THOST_FTDC_PST_Fund '3'
///结算单确认人
#define THOST_FTDC_PST_Settlement '4'
///法人
#define THOST_FTDC_PST_Company '5'
///法人代表
#define THOST_FTDC_PST_Corporation '6'
///投资者联系人
#define THOST_FTDC_PST_LinkMan '7'
///分户管理资产负责人
#define THOST_FTDC_PST_Ledger '8'
///托(保)管人
#define THOST_FTDC_PST_Trustee '9'
///托(保)管机构法人代表
#define THOST_FTDC_PST_TrusteeCorporation 'A'
///托(保)管机构开户授权人
#define THOST_FTDC_PST_TrusteeOpen 'B'
///托(保)管机构联系人
#define THOST_FTDC_PST_TrusteeContact 'C'
///境外自然人参考证件
#define THOST_FTDC_PST_ForeignerRefer 'D'
///法人代表参考证件
#define THOST_FTDC_PST_CorporationRefer 'E'
typedef char TThostFtdcPersonTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryInvestorRangeType是一个查询范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_QIR_All '1'
///查询分类
#define THOST_FTDC_QIR_Group '2'
///单一投资者
#define THOST_FTDC_QIR_Single '3'
typedef char TThostFtdcQueryInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorRiskStatusType是一个投资者风险状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_IRS_Normal '1'
///警告
#define THOST_FTDC_IRS_Warn '2'
///追保
#define THOST_FTDC_IRS_Call '3'
///强平
#define THOST_FTDC_IRS_Force '4'
///异常
#define THOST_FTDC_IRS_Exception '5'
typedef char TThostFtdcInvestorRiskStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLegIDType是一个单腿编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLegIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLegMultipleType是一个单腿乘数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLegMultipleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcImplyLevelType是一个派生层数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcImplyLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClearAccountType是一个结算账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearAccountType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganNOType是一个结算账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganNOType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearbarchIDType是一个结算账户联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearbarchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserEventTypeType是一个用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///登录
#define THOST_FTDC_UET_Login '1'
///登出
#define THOST_FTDC_UET_Logout '2'
///CTP校验通过
#define THOST_FTDC_UET_Trading '3'
///CTP校验失败
#define THOST_FTDC_UET_TradingError '4'
///修改密码
#define THOST_FTDC_UET_UpdatePassword '5'
///客户端认证
#define THOST_FTDC_UET_Authenticate '6'
///终端信息上报
#define THOST_FTDC_UET_SubmitSysInfo '7'
///转账
#define THOST_FTDC_UET_Transfer '8'
///其他
#define THOST_FTDC_UET_Other '9'
///修改资金密码
#define THOST_FTDC_UET_UpdateTradingAccountPassword 'a'
typedef char TThostFtdcUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserEventInfoType是一个用户事件信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserEventInfoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcCloseStyleType是一个平仓方式类型
/////////////////////////////////////////////////////////////////////////
///先开先平
#define THOST_FTDC_ICS_Close '0'
///先平今再平昨
#define THOST_FTDC_ICS_CloseToday '1'
typedef char TThostFtdcCloseStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStatModeType是一个统计方式类型
/////////////////////////////////////////////////////////////////////////
///----
#define THOST_FTDC_SM_Non '0'
///按合约统计
#define THOST_FTDC_SM_Instrument '1'
///按产品统计
#define THOST_FTDC_SM_Product '2'
///按投资者统计
#define THOST_FTDC_SM_Investor '3'
typedef char TThostFtdcStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderStatusType是一个预埋单状态类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_PAOS_NotSend '1'
///已发送
#define THOST_FTDC_PAOS_Send '2'
///已删除
#define THOST_FTDC_PAOS_Deleted '3'
typedef char TThostFtdcParkedOrderStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderIDType是一个预埋报单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParkedOrderIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcParkedOrderActionIDType是一个预埋撤单编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParkedOrderActionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcVirDealStatusType是一个处理状态类型
/////////////////////////////////////////////////////////////////////////
///正在处理
#define THOST_FTDC_VDS_Dealing '1'
///处理成功
#define THOST_FTDC_VDS_DeaclSucceed '2'
typedef char TThostFtdcVirDealStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrgSystemIDType是一个原有系统代码类型
/////////////////////////////////////////////////////////////////////////
///综合交易平台
#define THOST_FTDC_ORGS_Standard '0'
///易盛系统
#define THOST_FTDC_ORGS_ESunny '1'
///金仕达V6系统
#define THOST_FTDC_ORGS_KingStarV6 '2'
typedef char TThostFtdcOrgSystemIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirTradeStatusType是一个交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常处理中
#define THOST_FTDC_VTS_NaturalDeal '0'
///成功结束
#define THOST_FTDC_VTS_SucceedEnd '1'
///失败结束
#define THOST_FTDC_VTS_FailedEND '2'
///异常中
#define THOST_FTDC_VTS_Exception '3'
///已人工异常处理
#define THOST_FTDC_VTS_ManualDeal '4'
///通讯异常 ,请人工处理
#define THOST_FTDC_VTS_MesException '5'
///系统出错,请人工处理
#define THOST_FTDC_VTS_SysException '6'
typedef char TThostFtdcVirTradeStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirBankAccTypeType是一个银行帐户类型类型
/////////////////////////////////////////////////////////////////////////
///存折
#define THOST_FTDC_VBAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_VBAT_BankCard '2'
///信用卡
#define THOST_FTDC_VBAT_CreditCard '3'
typedef char TThostFtdcVirBankAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementStatusType是一个银行帐户类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_VMS_Natural '0'
///销户
#define THOST_FTDC_VMS_Canceled '9'
typedef char TThostFtdcVirementStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementAvailAbilityType是一个有效标志类型
/////////////////////////////////////////////////////////////////////////
///未确认
#define THOST_FTDC_VAA_NoAvailAbility '0'
///有效
#define THOST_FTDC_VAA_AvailAbility '1'
///冲正
#define THOST_FTDC_VAA_Repeal '2'
typedef char TThostFtdcVirementAvailAbilityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcVirementTradeCodeType是一个交易代码类型
/////////////////////////////////////////////////////////////////////////
///银行发起银行资金转期货
#define THOST_FTDC_VTC_BankBankToFuture '102001'
///银行发起期货资金转银行
#define THOST_FTDC_VTC_BankFutureToBank '102002'
///期货发起银行资金转期货
#define THOST_FTDC_VTC_FutureBankToFuture '202001'
///期货发起期货资金转银行
#define THOST_FTDC_VTC_FutureFutureToBank '202002'
typedef char TThostFtdcVirementTradeCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoTypeNameType是一个影像类型名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoTypeNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoTypeIDType是一个影像类型代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoTypeIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcPhotoNameType是一个影像名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPhotoNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcTopicIDType是一个主题代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTopicIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReportTypeIDType是一个交易报告类型标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReportTypeIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCharacterIDType是一个交易特征代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCharacterIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLParamIDType是一个参数代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLParamIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInvestorTypeType是一个投资者类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInvestorTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLIdCardTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLIdCardTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradeDirectType是一个资金进出方向类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradeDirectType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradeModelType是一个资金进出方式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradeModelType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLOpParamValueType是一个业务参数代码值类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAMLOpParamValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCustomerCardTypeType是一个客户身份证件/证明文件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCustomerCardTypeType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionNameType是一个金融机构网点名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLDistrictIDType是一个金融机构网点所在地区行政区划代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLDistrictIDType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLRelationShipType是一个金融机构网点与大额交易的关系类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLRelationShipType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionTypeType是一个金融机构网点代码类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLInstitutionIDType是一个金融机构网点代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLInstitutionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLAccountTypeType是一个账户类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLAccountTypeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTradingTypeType是一个交易方式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTradingTypeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLTransactClassType是一个涉外收支交易分类与代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLTransactClassType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCapitalIOType是一个资金收付标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCapitalIOType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSiteType是一个交易地点类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSiteType[10];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCapitalPurposeType是一个资金用途类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLCapitalPurposeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLReportTypeType是一个报文类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLReportTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSerialNoType是一个编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSerialNoType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLStatusType是一个状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLStatusType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLGenStatusType是一个Aml生成方式类型
/////////////////////////////////////////////////////////////////////////
///程序生成
#define THOST_FTDC_GEN_Program '0'
///人工生成
#define THOST_FTDC_GEN_HandWork '1'
typedef char TThostFtdcAMLGenStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLSeqCodeType是一个业务标识号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLSeqCodeType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLFileNameType是一个AML文件名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLFileNameType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLMoneyType是一个反洗钱资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAMLMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLFileAmountType是一个反洗钱资金类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcAMLFileAmountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCKeyType是一个密钥类型(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCFMMCKeyType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCTokenType是一个令牌类型(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCFMMCTokenType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCKeyKindType是一个动态密钥类别(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
///主动请求更新
#define THOST_FTDC_CFMMCKK_REQUEST 'R'
///CFMMC自动更新
#define THOST_FTDC_CFMMCKK_AUTO 'A'
///CFMMC手动更新
#define THOST_FTDC_CFMMCKK_MANUAL 'M'
typedef char TThostFtdcCFMMCKeyKindType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLReportNameType是一个报文名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAMLReportNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcIndividualNameType是一个个人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIndividualNameType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyIDType是一个币种代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcCustNumberType是一个客户编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCustNumberType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganCodeType是一个机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganCodeType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganNameType是一个机构名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcSuperOrganCodeType是一个上级机构编码,即期货公司总部、银行总行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSuperOrganCodeType[12];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubBranchIDType是一个分支机构类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSubBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcSubBranchNameType是一个分支机构名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSubBranchNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchNetCodeType是一个机构网点号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchNetCodeType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcBranchNetNameType是一个机构网点名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBranchNetNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganFlagType是一个机构标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrganFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankCodingForFutureType是一个银行对期货公司的编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankCodingForFutureType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankReturnCodeType是一个银行对返回码的定义类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankReturnCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcPlateReturnCodeType是一个银期转帐平台对返回码的定义类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPlateReturnCodeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankSubBranchIDType是一个银行分支机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankSubBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureBranchIDType是一个期货分支机构编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureBranchIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcReturnCodeType是一个返回代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReturnCodeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcOperatorCodeType是一个操作员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOperatorCodeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearDepIDType是一个机构结算帐户机构号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearDepIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearBrchIDType是一个机构结算帐户联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearBrchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcClearNameType是一个机构结算帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClearNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountNameType是一个银行帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountNameType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvDepIDType是一个机构投资人账号机构号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvDepIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvBrchIDType是一个机构投资人联行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvBrchIDType[6];
/////////////////////////////////////////////////////////////////////////
///TFtdcMessageFormatVersionType是一个信息格式版本类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMessageFormatVersionType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcDigestType是一个摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDigestType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthenticDataType是一个认证数据类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthenticDataType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcPasswordKeyType是一个密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPasswordKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccountNameType是一个期货帐户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureAccountNameType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcMobilePhoneType是一个手机类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcMobilePhoneType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureMainKeyType是一个期货公司主密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureMainKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureWorkKeyType是一个期货公司工作密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureWorkKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureTransKeyType是一个期货公司传输密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFutureTransKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankMainKeyType是一个银行主密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankMainKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankWorkKeyType是一个银行工作密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankWorkKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankTransKeyType是一个银行传输密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankTransKeyType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankServerDescriptionType是一个银行服务器描述信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankServerDescriptionType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddInfoType是一个附加信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcDescrInfoForReturnCodeType是一个返回码描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDescrInfoForReturnCodeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcCountryCodeType是一个国家代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCountryCodeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSerialType是一个流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPlateSerialType是一个平台流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPlateSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankSerialType是一个银行流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankSerialType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCorrectSerialType是一个被冲正交易流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCorrectSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureSerialType是一个期货公司流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFutureSerialType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplicationIDType是一个应用标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcApplicationIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankProxyIDType是一个银行代理标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBankProxyIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTCoreIDType是一个银期转帐核心系统标识类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBTCoreIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServerPortType是一个服务端口号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServerPortType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRepealedTimesType是一个已经冲正次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRepealedTimesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRepealTimeIntervalType是一个冲正时间间隔类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRepealTimeIntervalType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTotalTimesType是一个每日累计转帐次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTotalTimesType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTRequestIDType是一个请求ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBTRequestIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTIDType是一个交易ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeAmountType是一个交易金额(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcTradeAmountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCustFeeType是一个应收客户费用(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCustFeeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureFeeType是一个应收期货公司费用(元)类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcFutureFeeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSingleMaxAmtType是一个单笔最高限额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSingleMaxAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSingleMinAmtType是一个单笔最低限额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSingleMinAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTotalAmtType是一个每日累计转帐额度类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcTotalAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCertificationTypeType是一个证件类型类型
/////////////////////////////////////////////////////////////////////////
///身份证
#define THOST_FTDC_CFT_IDCard '0'
///护照
#define THOST_FTDC_CFT_Passport '1'
///军官证
#define THOST_FTDC_CFT_OfficerIDCard '2'
///士兵证
#define THOST_FTDC_CFT_SoldierIDCard '3'
///回乡证
#define THOST_FTDC_CFT_HomeComingCard '4'
///户口簿
#define THOST_FTDC_CFT_HouseholdRegister '5'
///营业执照号
#define THOST_FTDC_CFT_LicenseNo '6'
///组织机构代码证
#define THOST_FTDC_CFT_InstitutionCodeCard '7'
///临时营业执照号
#define THOST_FTDC_CFT_TempLicenseNo '8'
///民办非企业登记证书
#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9'
///其他证件
#define THOST_FTDC_CFT_OtherCard 'x'
///主管部门批文
#define THOST_FTDC_CFT_SuperDepAgree 'a'
typedef char TThostFtdcCertificationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileBusinessCodeType是一个文件业务功能类型
/////////////////////////////////////////////////////////////////////////
///其他
#define THOST_FTDC_FBC_Others '0'
///转账交易明细对账
#define THOST_FTDC_FBC_TransferDetails '1'
///客户账户状态对账
#define THOST_FTDC_FBC_CustAccStatus '2'
///账户类交易明细对账
#define THOST_FTDC_FBC_AccountTradeDetails '3'
///期货账户信息变更明细对账
#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4'
///客户资金台账余额明细对账
#define THOST_FTDC_FBC_CustMoneyDetail '5'
///客户销户结息明细对账
#define THOST_FTDC_FBC_CustCancelAccountInfo '6'
///客户资金余额对账结果
#define THOST_FTDC_FBC_CustMoneyResult '7'
///其它对账异常结果文件
#define THOST_FTDC_FBC_OthersExceptionResult '8'
///客户结息净额明细
#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9'
///客户资金交收明细
#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a'
///法人存管银行资金交收汇总
#define THOST_FTDC_FBC_CorporationMoneyTotal 'b'
///主体间资金交收汇总
#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c'
///总分平衡监管数据
#define THOST_FTDC_FBC_MainPartMonitorData 'd'
///存管银行备付金余额
#define THOST_FTDC_FBC_PreparationMoney 'e'
///协办存管银行资金监管数据
#define THOST_FTDC_FBC_BankMoneyMonitorData 'f'
typedef char TThostFtdcFileBusinessCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCashExchangeCodeType是一个汇钞标志类型
/////////////////////////////////////////////////////////////////////////
///汇
#define THOST_FTDC_CEC_Exchange '1'
///钞
#define THOST_FTDC_CEC_Cash '2'
typedef char TThostFtdcCashExchangeCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcYesNoIndicatorType是一个是或否标识类型
/////////////////////////////////////////////////////////////////////////
///是
#define THOST_FTDC_YNI_Yes '0'
///否
#define THOST_FTDC_YNI_No '1'
typedef char TThostFtdcYesNoIndicatorType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBanlanceTypeType是一个余额类型类型
/////////////////////////////////////////////////////////////////////////
///当前余额
#define THOST_FTDC_BLT_CurrentMoney '0'
///可用余额
#define THOST_FTDC_BLT_UsableMoney '1'
///可取余额
#define THOST_FTDC_BLT_FetchableMoney '2'
///冻结余额
#define THOST_FTDC_BLT_FreezeMoney '3'
typedef char TThostFtdcBanlanceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcGenderType是一个性别类型
/////////////////////////////////////////////////////////////////////////
///未知状态
#define THOST_FTDC_GD_Unknown '0'
///男
#define THOST_FTDC_GD_Male '1'
///女
#define THOST_FTDC_GD_Female '2'
typedef char TThostFtdcGenderType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFeePayFlagType是一个费用支付标志类型
/////////////////////////////////////////////////////////////////////////
///由受益方支付费用
#define THOST_FTDC_FPF_BEN '0'
///由发送方支付费用
#define THOST_FTDC_FPF_OUR '1'
///由发送方支付发起的费用,受益方支付接受的费用
#define THOST_FTDC_FPF_SHA '2'
typedef char TThostFtdcFeePayFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPassWordKeyTypeType是一个密钥类型类型
/////////////////////////////////////////////////////////////////////////
///交换密钥
#define THOST_FTDC_PWKT_ExchangeKey '0'
///密码密钥
#define THOST_FTDC_PWKT_PassWordKey '1'
///MAC密钥
#define THOST_FTDC_PWKT_MACKey '2'
///报文密钥
#define THOST_FTDC_PWKT_MessageKey '3'
typedef char TThostFtdcPassWordKeyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTPassWordTypeType是一个密码类型类型
/////////////////////////////////////////////////////////////////////////
///查询
#define THOST_FTDC_PWT_Query '0'
///取款
#define THOST_FTDC_PWT_Fetch '1'
///转帐
#define THOST_FTDC_PWT_Transfer '2'
///交易
#define THOST_FTDC_PWT_Trade '3'
typedef char TThostFtdcFBTPassWordTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTEncryModeType是一个加密方式类型
/////////////////////////////////////////////////////////////////////////
///不加密
#define THOST_FTDC_EM_NoEncry '0'
///DES
#define THOST_FTDC_EM_DES '1'
///3DES
#define THOST_FTDC_EM_3DES '2'
typedef char TThostFtdcFBTEncryModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankRepealFlagType是一个银行冲正标志类型
/////////////////////////////////////////////////////////////////////////
///银行无需自动冲正
#define THOST_FTDC_BRF_BankNotNeedRepeal '0'
///银行待自动冲正
#define THOST_FTDC_BRF_BankWaitingRepeal '1'
///银行已自动冲正
#define THOST_FTDC_BRF_BankBeenRepealed '2'
typedef char TThostFtdcBankRepealFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerRepealFlagType是一个期商冲正标志类型
/////////////////////////////////////////////////////////////////////////
///期商无需自动冲正
#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0'
///期商待自动冲正
#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1'
///期商已自动冲正
#define THOST_FTDC_BRORF_BrokerBeenRepealed '2'
typedef char TThostFtdcBrokerRepealFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstitutionTypeType是一个机构类别类型
/////////////////////////////////////////////////////////////////////////
///银行
#define THOST_FTDC_TS_Bank '0'
///期商
#define THOST_FTDC_TS_Future '1'
///券商
#define THOST_FTDC_TS_Store '2'
typedef char TThostFtdcInstitutionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLastFragmentType是一个最后分片标志类型
/////////////////////////////////////////////////////////////////////////
///是最后分片
#define THOST_FTDC_LF_Yes '0'
///不是最后分片
#define THOST_FTDC_LF_No '1'
typedef char TThostFtdcLastFragmentType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccStatusType是一个银行账户状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_BAS_Normal '0'
///冻结
#define THOST_FTDC_BAS_Freeze '1'
///挂失
#define THOST_FTDC_BAS_ReportLoss '2'
typedef char TThostFtdcBankAccStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMoneyAccountStatusType是一个资金账户状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_MAS_Normal '0'
///销户
#define THOST_FTDC_MAS_Cancel '1'
typedef char TThostFtdcMoneyAccountStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcManageStatusType是一个存管状态类型
/////////////////////////////////////////////////////////////////////////
///指定存管
#define THOST_FTDC_MSS_Point '0'
///预指定
#define THOST_FTDC_MSS_PrePoint '1'
///撤销指定
#define THOST_FTDC_MSS_CancelPoint '2'
typedef char TThostFtdcManageStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemTypeType是一个应用系统类型类型
/////////////////////////////////////////////////////////////////////////
///银期转帐
#define THOST_FTDC_SYT_FutureBankTransfer '0'
///银证转帐
#define THOST_FTDC_SYT_StockBankTransfer '1'
///第三方存管
#define THOST_FTDC_SYT_TheThirdPartStore '2'
typedef char TThostFtdcSystemTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTxnEndFlagType是一个银期转帐划转结果标志类型
/////////////////////////////////////////////////////////////////////////
///正常处理中
#define THOST_FTDC_TEF_NormalProcessing '0'
///成功结束
#define THOST_FTDC_TEF_Success '1'
///失败结束
#define THOST_FTDC_TEF_Failed '2'
///异常中
#define THOST_FTDC_TEF_Abnormal '3'
///已人工异常处理
#define THOST_FTDC_TEF_ManualProcessedForException '4'
///通讯异常 ,请人工处理
#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5'
///系统出错,请人工处理
#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6'
typedef char TThostFtdcTxnEndFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessStatusType是一个银期转帐服务处理状态类型
/////////////////////////////////////////////////////////////////////////
///未处理
#define THOST_FTDC_PSS_NotProcess '0'
///开始处理
#define THOST_FTDC_PSS_StartProcess '1'
///处理完成
#define THOST_FTDC_PSS_Finished '2'
typedef char TThostFtdcProcessStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCustTypeType是一个客户类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CUSTT_Person '0'
///机构户
#define THOST_FTDC_CUSTT_Institution '1'
typedef char TThostFtdcCustTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTTransferDirectionType是一个银期转帐方向类型
/////////////////////////////////////////////////////////////////////////
///入金,银行转期货
#define THOST_FTDC_FBTTD_FromBankToFuture '1'
///出金,期货转银行
#define THOST_FTDC_FBTTD_FromFutureToBank '2'
typedef char TThostFtdcFBTTransferDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenOrDestroyType是一个开销户类别类型
/////////////////////////////////////////////////////////////////////////
///开户
#define THOST_FTDC_OOD_Open '1'
///销户
#define THOST_FTDC_OOD_Destroy '0'
typedef char TThostFtdcOpenOrDestroyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAvailabilityFlagType是一个有效标志类型
/////////////////////////////////////////////////////////////////////////
///未确认
#define THOST_FTDC_AVAF_Invalid '0'
///有效
#define THOST_FTDC_AVAF_Valid '1'
///冲正
#define THOST_FTDC_AVAF_Repeal '2'
typedef char TThostFtdcAvailabilityFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
///银行代理
#define THOST_FTDC_OT_Bank '1'
///交易前置
#define THOST_FTDC_OT_Future '2'
///银期转帐平台管理
#define THOST_FTDC_OT_PlateForm '9'
typedef char TThostFtdcOrganTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganLevelType是一个机构级别类型
/////////////////////////////////////////////////////////////////////////
///银行总行或期商总部
#define THOST_FTDC_OL_HeadQuarters '1'
///银行分中心或期货公司营业部
#define THOST_FTDC_OL_Branch '2'
typedef char TThostFtdcOrganLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProtocalIDType是一个协议类型类型
/////////////////////////////////////////////////////////////////////////
///期商协议
#define THOST_FTDC_PID_FutureProtocal '0'
///工行协议
#define THOST_FTDC_PID_ICBCProtocal '1'
///农行协议
#define THOST_FTDC_PID_ABCProtocal '2'
///中国银行协议
#define THOST_FTDC_PID_CBCProtocal '3'
///建行协议
#define THOST_FTDC_PID_CCBProtocal '4'
///交行协议
#define THOST_FTDC_PID_BOCOMProtocal '5'
///银期转帐平台协议
#define THOST_FTDC_PID_FBTPlateFormProtocal 'X'
typedef char TThostFtdcProtocalIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcConnectModeType是一个套接字连接方式类型
/////////////////////////////////////////////////////////////////////////
///短连接
#define THOST_FTDC_CM_ShortConnect '0'
///长连接
#define THOST_FTDC_CM_LongConnect '1'
typedef char TThostFtdcConnectModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncModeType是一个套接字通信方式类型
/////////////////////////////////////////////////////////////////////////
///异步
#define THOST_FTDC_SRM_ASync '0'
///同步
#define THOST_FTDC_SRM_Sync '1'
typedef char TThostFtdcSyncModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccTypeType是一个银行帐号类型类型
/////////////////////////////////////////////////////////////////////////
///银行存折
#define THOST_FTDC_BAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_BAT_SavingCard '2'
///信用卡
#define THOST_FTDC_BAT_CreditCard '3'
typedef char TThostFtdcBankAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureAccTypeType是一个期货公司帐号类型类型
/////////////////////////////////////////////////////////////////////////
///银行存折
#define THOST_FTDC_FAT_BankBook '1'
///储蓄卡
#define THOST_FTDC_FAT_SavingCard '2'
///信用卡
#define THOST_FTDC_FAT_CreditCard '3'
typedef char TThostFtdcFutureAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrganStatusType是一个接入机构状态类型
/////////////////////////////////////////////////////////////////////////
///启用
#define THOST_FTDC_OS_Ready '0'
///签到
#define THOST_FTDC_OS_CheckIn '1'
///签退
#define THOST_FTDC_OS_CheckOut '2'
///对帐文件到达
#define THOST_FTDC_OS_CheckFileArrived '3'
///对帐
#define THOST_FTDC_OS_CheckDetail '4'
///日终清理
#define THOST_FTDC_OS_DayEndClean '5'
///注销
#define THOST_FTDC_OS_Invalid '9'
typedef char TThostFtdcOrganStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCCBFeeModeType是一个建行收费模式类型
/////////////////////////////////////////////////////////////////////////
///按金额扣收
#define THOST_FTDC_CCBFM_ByAmount '1'
///按月扣收
#define THOST_FTDC_CCBFM_ByMonth '2'
typedef char TThostFtdcCCBFeeModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommApiTypeType是一个通讯API类型类型
/////////////////////////////////////////////////////////////////////////
///客户端
#define THOST_FTDC_CAPIT_Client '1'
///服务端
#define THOST_FTDC_CAPIT_Server '2'
///交易系统的UserApi
#define THOST_FTDC_CAPIT_UserApi '3'
typedef char TThostFtdcCommApiTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceIDType是一个服务编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServiceIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceLineNoType是一个服务线路编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcServiceLineNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcServiceNameType是一个服务名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcServiceNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcLinkStatusType是一个连接状态类型
/////////////////////////////////////////////////////////////////////////
///已经连接
#define THOST_FTDC_LS_Connected '1'
///没有连接
#define THOST_FTDC_LS_Disconnected '2'
typedef char TThostFtdcLinkStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommApiPointerType是一个通讯API指针类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommApiPointerType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPwdFlagType是一个密码核对标志类型
/////////////////////////////////////////////////////////////////////////
///不核对
#define THOST_FTDC_BPWDF_NoCheck '0'
///明文核对
#define THOST_FTDC_BPWDF_BlankCheck '1'
///密文核对
#define THOST_FTDC_BPWDF_EncryptCheck '2'
typedef char TThostFtdcPwdFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSecuAccTypeType是一个期货帐号类型类型
/////////////////////////////////////////////////////////////////////////
///资金帐号
#define THOST_FTDC_SAT_AccountID '1'
///资金卡号
#define THOST_FTDC_SAT_CardID '2'
///上海股东帐号
#define THOST_FTDC_SAT_SHStockholderID '3'
///深圳股东帐号
#define THOST_FTDC_SAT_SZStockholderID '4'
typedef char TThostFtdcSecuAccTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTransferStatusType是一个转账交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_TRFS_Normal '0'
///被冲正
#define THOST_FTDC_TRFS_Repealed '1'
typedef char TThostFtdcTransferStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSponsorTypeType是一个发起方类型
/////////////////////////////////////////////////////////////////////////
///期商
#define THOST_FTDC_SPTYPE_Broker '0'
///银行
#define THOST_FTDC_SPTYPE_Bank '1'
typedef char TThostFtdcSponsorTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReqRspTypeType是一个请求响应类别类型
/////////////////////////////////////////////////////////////////////////
///请求
#define THOST_FTDC_REQRSP_Request '0'
///响应
#define THOST_FTDC_REQRSP_Response '1'
typedef char TThostFtdcReqRspTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTUserEventTypeType是一个银期转帐用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///签到
#define THOST_FTDC_FBTUET_SignIn '0'
///银行转期货
#define THOST_FTDC_FBTUET_FromBankToFuture '1'
///期货转银行
#define THOST_FTDC_FBTUET_FromFutureToBank '2'
///开户
#define THOST_FTDC_FBTUET_OpenAccount '3'
///销户
#define THOST_FTDC_FBTUET_CancelAccount '4'
///变更银行账户
#define THOST_FTDC_FBTUET_ChangeAccount '5'
///冲正银行转期货
#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6'
///冲正期货转银行
#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7'
///查询银行账户
#define THOST_FTDC_FBTUET_QueryBankAccount '8'
///查询期货账户
#define THOST_FTDC_FBTUET_QueryFutureAccount '9'
///签退
#define THOST_FTDC_FBTUET_SignOut 'A'
///密钥同步
#define THOST_FTDC_FBTUET_SyncKey 'B'
///预约开户
#define THOST_FTDC_FBTUET_ReserveOpenAccount 'C'
///撤销预约开户
#define THOST_FTDC_FBTUET_CancelReserveOpenAccount 'D'
///预约开户确认
#define THOST_FTDC_FBTUET_ReserveOpenAccountConfirm 'E'
///其他
#define THOST_FTDC_FBTUET_Other 'Z'
typedef char TThostFtdcFBTUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBankIDByBankType是一个银行自己的编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankIDByBankType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankOperNoType是一个银行操作员号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankOperNoType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankCustNoType是一个银行客户号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankCustNoType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBOPSeqNoType是一个递增的序列号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDBOPSeqNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTableNameType是一个FBT表名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTableNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcPKNameType是一个FBT表操作主键名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPKNameType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcPKValueType是一个FBT表操作主键值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPKValueType[501];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBOperationType是一个记录操作类型类型
/////////////////////////////////////////////////////////////////////////
///插入
#define THOST_FTDC_DBOP_Insert '0'
///更新
#define THOST_FTDC_DBOP_Update '1'
///删除
#define THOST_FTDC_DBOP_Delete '2'
typedef char TThostFtdcDBOperationType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncFlagType是一个同步标记类型
/////////////////////////////////////////////////////////////////////////
///已同步
#define THOST_FTDC_SYNF_Yes '0'
///未同步
#define THOST_FTDC_SYNF_No '1'
typedef char TThostFtdcSyncFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTargetIDType是一个同步目标编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTargetIDType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncTypeType是一个同步类型类型
/////////////////////////////////////////////////////////////////////////
///一次同步
#define THOST_FTDC_SYNT_OneOffSync '0'
///定时同步
#define THOST_FTDC_SYNT_TimerSync '1'
///定时完全同步
#define THOST_FTDC_SYNT_TimerFullSync '2'
typedef char TThostFtdcSyncTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBETimeType是一个各种换汇时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBETimeType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankNoType是一个换汇银行行号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBECertNoType是一个换汇凭证号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBECertNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcExDirectionType是一个换汇方向类型
/////////////////////////////////////////////////////////////////////////
///结汇
#define THOST_FTDC_FBEDIR_Settlement '0'
///售汇
#define THOST_FTDC_FBEDIR_Sale '1'
typedef char TThostFtdcExDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankAccountType是一个换汇银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankAccountType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBankAccountNameType是一个换汇银行账户名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBankAccountNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEAmtType是一个各种换汇金额类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcFBEAmtType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBusinessTypeType是一个换汇业务类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBusinessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEPostScriptType是一个换汇附言类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEPostScriptType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBERemarkType是一个换汇备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBERemarkType[71];
/////////////////////////////////////////////////////////////////////////
///TFtdcExRateType是一个换汇汇率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcExRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEResultFlagType是一个换汇成功标志类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_FBERES_Success '0'
///账户余额不足
#define THOST_FTDC_FBERES_InsufficientBalance '1'
///交易结果未知
#define THOST_FTDC_FBERES_UnknownTrading '8'
///失败
#define THOST_FTDC_FBERES_Fail 'x'
typedef char TThostFtdcFBEResultFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBERtnMsgType是一个换汇返回信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBERtnMsgType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEExtendMsgType是一个换汇扩展信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEExtendMsgType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBusinessSerialType是一个换汇记账流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBusinessSerialType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBESystemSerialType是一个换汇流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBESystemSerialType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBETotalExCntType是一个换汇交易总笔数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcFBETotalExCntType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEExchStatusType是一个换汇交易状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_FBEES_Normal '0'
///交易重发
#define THOST_FTDC_FBEES_ReExchange '1'
typedef char TThostFtdcFBEExchStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEFileFlagType是一个换汇文件标志类型
/////////////////////////////////////////////////////////////////////////
///数据包
#define THOST_FTDC_FBEFG_DataPackage '0'
///文件
#define THOST_FTDC_FBEFG_File '1'
typedef char TThostFtdcFBEFileFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEAlreadyTradeType是一个换汇已交易标志类型
/////////////////////////////////////////////////////////////////////////
///未交易
#define THOST_FTDC_FBEAT_NotTrade '0'
///已交易
#define THOST_FTDC_FBEAT_Trade '1'
typedef char TThostFtdcFBEAlreadyTradeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEOpenBankType是一个换汇账户开户行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEOpenBankType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEUserEventTypeType是一个银期换汇用户事件类型类型
/////////////////////////////////////////////////////////////////////////
///签到
#define THOST_FTDC_FBEUET_SignIn '0'
///换汇
#define THOST_FTDC_FBEUET_Exchange '1'
///换汇重发
#define THOST_FTDC_FBEUET_ReExchange '2'
///银行账户查询
#define THOST_FTDC_FBEUET_QueryBankAccount '3'
///换汇明细查询
#define THOST_FTDC_FBEUET_QueryExchDetial '4'
///换汇汇总查询
#define THOST_FTDC_FBEUET_QueryExchSummary '5'
///换汇汇率查询
#define THOST_FTDC_FBEUET_QueryExchRate '6'
///对账文件通知
#define THOST_FTDC_FBEUET_CheckBankAccount '7'
///签退
#define THOST_FTDC_FBEUET_SignOut '8'
///其他
#define THOST_FTDC_FBEUET_Other 'Z'
typedef char TThostFtdcFBEUserEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEFileNameType是一个换汇相关文件名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEFileNameType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEBatchSerialType是一个换汇批次号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFBEBatchSerialType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcFBEReqFlagType是一个换汇发送标志类型
/////////////////////////////////////////////////////////////////////////
///未处理
#define THOST_FTDC_FBERF_UnProcessed '0'
///等待发送
#define THOST_FTDC_FBERF_WaitSend '1'
///发送成功
#define THOST_FTDC_FBERF_SendSuccess '2'
///发送失败
#define THOST_FTDC_FBERF_SendFailed '3'
///等待重发
#define THOST_FTDC_FBERF_WaitReSend '4'
typedef char TThostFtdcFBEReqFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNotifyClassType是一个风险通知类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_NC_NOERROR '0'
///警示
#define THOST_FTDC_NC_Warn '1'
///追保
#define THOST_FTDC_NC_Call '2'
///强平
#define THOST_FTDC_NC_Force '3'
///穿仓
#define THOST_FTDC_NC_CHUANCANG '4'
///异常
#define THOST_FTDC_NC_Exception '5'
typedef char TThostFtdcNotifyClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNofityInfoType是一个客户风险通知消息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRiskNofityInfoType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseSceneIdType是一个强平场景编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcForceCloseSceneIdType[24];
/////////////////////////////////////////////////////////////////////////
///TFtdcForceCloseTypeType是一个强平单类型类型
/////////////////////////////////////////////////////////////////////////
///手工强平
#define THOST_FTDC_FCT_Manual '0'
///单一投资者辅助强平
#define THOST_FTDC_FCT_Single '1'
///批量投资者辅助强平
#define THOST_FTDC_FCT_Group '2'
typedef char TThostFtdcForceCloseTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentIDsType是一个多个产品代码,用+分隔,如cu+zn类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInstrumentIDsType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNotifyMethodType是一个风险通知途径类型
/////////////////////////////////////////////////////////////////////////
///系统通知
#define THOST_FTDC_RNM_System '0'
///短信通知
#define THOST_FTDC_RNM_SMS '1'
///邮件通知
#define THOST_FTDC_RNM_EMail '2'
///人工通知
#define THOST_FTDC_RNM_Manual '3'
typedef char TThostFtdcRiskNotifyMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskNotifyStatusType是一个风险通知状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_RNS_NotGen '0'
///已生成未发送
#define THOST_FTDC_RNS_Generated '1'
///发送失败
#define THOST_FTDC_RNS_SendError '2'
///已发送未接收
#define THOST_FTDC_RNS_SendOk '3'
///已接收未确认
#define THOST_FTDC_RNS_Received '4'
///已确认
#define THOST_FTDC_RNS_Confirmed '5'
typedef char TThostFtdcRiskNotifyStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskUserEventType是一个风控用户操作事件类型
/////////////////////////////////////////////////////////////////////////
///导出数据
#define THOST_FTDC_RUE_ExportData '0'
typedef char TThostFtdcRiskUserEventType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParamIDType是一个参数代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcParamNameType是一个参数名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParamNameType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcParamValueType是一个参数值类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcParamValueType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcConditionalOrderSortTypeType是一个条件单索引条件类型
/////////////////////////////////////////////////////////////////////////
///使用最新价升序
#define THOST_FTDC_COST_LastPriceAsc '0'
///使用最新价降序
#define THOST_FTDC_COST_LastPriceDesc '1'
///使用卖价升序
#define THOST_FTDC_COST_AskPriceAsc '2'
///使用卖价降序
#define THOST_FTDC_COST_AskPriceDesc '3'
///使用买价升序
#define THOST_FTDC_COST_BidPriceAsc '4'
///使用买价降序
#define THOST_FTDC_COST_BidPriceDesc '5'
typedef char TThostFtdcConditionalOrderSortTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSendTypeType是一个报送状态类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_UOAST_NoSend '0'
///已发送
#define THOST_FTDC_UOAST_Sended '1'
///已生成
#define THOST_FTDC_UOAST_Generated '2'
///报送失败
#define THOST_FTDC_UOAST_SendFail '3'
///接收成功
#define THOST_FTDC_UOAST_Success '4'
///接收失败
#define THOST_FTDC_UOAST_Fail '5'
///取消报送
#define THOST_FTDC_UOAST_Cancel '6'
typedef char TThostFtdcSendTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientIDStatusType是一个交易编码状态类型
/////////////////////////////////////////////////////////////////////////
///未申请
#define THOST_FTDC_UOACS_NoApply '1'
///已提交申请
#define THOST_FTDC_UOACS_Submited '2'
///已发送申请
#define THOST_FTDC_UOACS_Sended '3'
///完成
#define THOST_FTDC_UOACS_Success '4'
///拒绝
#define THOST_FTDC_UOACS_Refuse '5'
///已撤销编码
#define THOST_FTDC_UOACS_Cancel '6'
typedef char TThostFtdcClientIDStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIndustryIDType是一个行业编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIndustryIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionIDType是一个特有信息编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcQuestionIDType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionContentType是一个特有信息说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcQuestionContentType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionIDType是一个选项编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOptionIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionContentType是一个选项说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOptionContentType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcQuestionTypeType是一个特有信息类型类型
/////////////////////////////////////////////////////////////////////////
///单选
#define THOST_FTDC_QT_Radio '1'
///多选
#define THOST_FTDC_QT_Option '2'
///填空
#define THOST_FTDC_QT_Blank '3'
typedef char TThostFtdcQuestionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessIDType是一个业务流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSeqNoType是一个流水号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSeqNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAProcessStatusType是一个流程状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAProcessStatusType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcProcessTypeType是一个流程功能类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProcessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessTypeType是一个业务类型类型
/////////////////////////////////////////////////////////////////////////
///请求
#define THOST_FTDC_BT_Request '1'
///应答
#define THOST_FTDC_BT_Response '2'
///通知
#define THOST_FTDC_BT_Notice '3'
typedef char TThostFtdcBusinessTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCfmmcReturnCodeType是一个监控中心返回码类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_CRC_Success '0'
///该客户已经有流程在处理中
#define THOST_FTDC_CRC_Working '1'
///监控中客户资料检查失败
#define THOST_FTDC_CRC_InfoFail '2'
///监控中实名制检查失败
#define THOST_FTDC_CRC_IDCardFail '3'
///其他错误
#define THOST_FTDC_CRC_OtherFail '4'
typedef char TThostFtdcCfmmcReturnCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExReturnCodeType是一个交易所返回码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcExReturnCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientTypeType是一个客户类型类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_CfMMCCT_All '0'
///个人
#define THOST_FTDC_CfMMCCT_Person '1'
///单位
#define THOST_FTDC_CfMMCCT_Company '2'
///其他
#define THOST_FTDC_CfMMCCT_Other '3'
///特殊法人
#define THOST_FTDC_CfMMCCT_SpecialOrgan '4'
///资管户
#define THOST_FTDC_CfMMCCT_Asset '5'
typedef char TThostFtdcClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeIDTypeType是一个交易所编号类型
/////////////////////////////////////////////////////////////////////////
///上海期货交易所
#define THOST_FTDC_EIDT_SHFE 'S'
///郑州商品交易所
#define THOST_FTDC_EIDT_CZCE 'Z'
///大连商品交易所
#define THOST_FTDC_EIDT_DCE 'D'
///中国金融期货交易所
#define THOST_FTDC_EIDT_CFFEX 'J'
///上海国际能源交易中心股份有限公司
#define THOST_FTDC_EIDT_INE 'N'
typedef char TThostFtdcExchangeIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExClientIDTypeType是一个交易编码类型类型
/////////////////////////////////////////////////////////////////////////
///套保
#define THOST_FTDC_ECIDT_Hedge '1'
///套利
#define THOST_FTDC_ECIDT_Arbitrage '2'
///投机
#define THOST_FTDC_ECIDT_Speculation '3'
typedef char TThostFtdcExClientIDTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientClassifyType是一个客户分类码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientClassifyType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAOrganTypeType是一个单位性质类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAOrganTypeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOACountryCodeType是一个国家代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOACountryCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcAreaCodeType是一个区号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAreaCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcFuturesIDType是一个监控中心为客户分配的代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFuturesIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffmcDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffmcDateType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffmcTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffmcTimeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcNocIDType是一个组织机构代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNocIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcUpdateFlagType是一个更新状态类型
/////////////////////////////////////////////////////////////////////////
///未更新
#define THOST_FTDC_UF_NoUpdate '0'
///更新全部信息成功
#define THOST_FTDC_UF_Success '1'
///更新全部信息失败
#define THOST_FTDC_UF_Fail '2'
///更新交易编码成功
#define THOST_FTDC_UF_TCSuccess '3'
///更新交易编码失败
#define THOST_FTDC_UF_TCFail '4'
///已丢弃
#define THOST_FTDC_UF_Cancel '5'
typedef char TThostFtdcUpdateFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyOperateIDType是一个申请动作类型
/////////////////////////////////////////////////////////////////////////
///开户
#define THOST_FTDC_AOID_OpenInvestor '1'
///修改身份信息
#define THOST_FTDC_AOID_ModifyIDCard '2'
///修改一般信息
#define THOST_FTDC_AOID_ModifyNoIDCard '3'
///申请交易编码
#define THOST_FTDC_AOID_ApplyTradingCode '4'
///撤销交易编码
#define THOST_FTDC_AOID_CancelTradingCode '5'
///销户
#define THOST_FTDC_AOID_CancelInvestor '6'
///账户休眠
#define THOST_FTDC_AOID_FreezeAccount '8'
///激活休眠账户
#define THOST_FTDC_AOID_ActiveFreezeAccount '9'
typedef char TThostFtdcApplyOperateIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyStatusIDType是一个申请状态类型
/////////////////////////////////////////////////////////////////////////
///未补全
#define THOST_FTDC_ASID_NoComplete '1'
///已提交
#define THOST_FTDC_ASID_Submited '2'
///已审核
#define THOST_FTDC_ASID_Checked '3'
///已拒绝
#define THOST_FTDC_ASID_Refused '4'
///已删除
#define THOST_FTDC_ASID_Deleted '5'
typedef char TThostFtdcApplyStatusIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSendMethodType是一个发送方式类型
/////////////////////////////////////////////////////////////////////////
///文件发送
#define THOST_FTDC_UOASM_ByAPI '1'
///电子发送
#define THOST_FTDC_UOASM_ByFile '2'
typedef char TThostFtdcSendMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEventTypeType是一个业务操作类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcEventTypeType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcEventModeType是一个操作方法类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_EvM_ADD '1'
///修改
#define THOST_FTDC_EvM_UPDATE '2'
///删除
#define THOST_FTDC_EvM_DELETE '3'
///复核
#define THOST_FTDC_EvM_CHECK '4'
///复制
#define THOST_FTDC_EvM_COPY '5'
///注销
#define THOST_FTDC_EvM_CANCEL '6'
///冲销
#define THOST_FTDC_EvM_Reverse '7'
typedef char TThostFtdcEventModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAAutoSendType是一个统一开户申请自动发送类型
/////////////////////////////////////////////////////////////////////////
///自动发送并接收
#define THOST_FTDC_UOAA_ASR '1'
///自动发送,不自动接收
#define THOST_FTDC_UOAA_ASNR '2'
///不自动发送,自动接收
#define THOST_FTDC_UOAA_NSAR '3'
///不自动发送,也不自动接收
#define THOST_FTDC_UOAA_NSR '4'
typedef char TThostFtdcUOAAutoSendType;
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryDepthType是一个查询深度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcQueryDepthType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataCenterIDType是一个数据中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDataCenterIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFlowIDType是一个流程ID类型
/////////////////////////////////////////////////////////////////////////
///投资者对应投资者组设置
#define THOST_FTDC_EvM_InvestorGroupFlow '1'
///投资者手续费率设置
#define THOST_FTDC_EvM_InvestorRate '2'
///投资者手续费率模板关系设置
#define THOST_FTDC_EvM_InvestorCommRateModel '3'
typedef char TThostFtdcFlowIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckLevelType是一个复核级别类型
/////////////////////////////////////////////////////////////////////////
///零级复核
#define THOST_FTDC_CL_Zero '0'
///一级复核
#define THOST_FTDC_CL_One '1'
///二级复核
#define THOST_FTDC_CL_Two '2'
typedef char TThostFtdcCheckLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckNoType是一个操作次数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCheckNoType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckStatusType是一个复核级别类型
/////////////////////////////////////////////////////////////////////////
///未复核
#define THOST_FTDC_CHS_Init '0'
///复核中
#define THOST_FTDC_CHS_Checking '1'
///已复核
#define THOST_FTDC_CHS_Checked '2'
///拒绝
#define THOST_FTDC_CHS_Refuse '3'
///作废
#define THOST_FTDC_CHS_Cancel '4'
typedef char TThostFtdcCheckStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUsedStatusType是一个生效状态类型
/////////////////////////////////////////////////////////////////////////
///未生效
#define THOST_FTDC_CHU_Unused '0'
///已生效
#define THOST_FTDC_CHU_Used '1'
///生效失败
#define THOST_FTDC_CHU_Fail '2'
typedef char TThostFtdcUsedStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTemplateNameType是一个模型名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRateTemplateNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyStringType是一个用于查询的投资属性字段类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPropertyStringType[2049];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAcountOriginType是一个账户来源类型
/////////////////////////////////////////////////////////////////////////
///手工录入
#define THOST_FTDC_BAO_ByAccProperty '0'
///银期转账
#define THOST_FTDC_BAO_ByFBTransfer '1'
typedef char TThostFtdcBankAcountOriginType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMonthBillTradeSumType是一个结算单月报成交汇总方式类型
/////////////////////////////////////////////////////////////////////////
///同日同合约
#define THOST_FTDC_MBTS_ByInstrument '0'
///同日同合约同价格
#define THOST_FTDC_MBTS_ByDayInsPrc '1'
///同合约
#define THOST_FTDC_MBTS_ByDayIns '2'
typedef char TThostFtdcMonthBillTradeSumType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFBTTradeCodeEnumType是一个银期交易代码枚举类型
/////////////////////////////////////////////////////////////////////////
///银行发起银行转期货
#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001'
///期货发起银行转期货
#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001'
///银行发起期货转银行
#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002'
///期货发起期货转银行
#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002'
typedef char TThostFtdcFBTTradeCodeEnumType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateTemplateIDType是一个模型代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRateTemplateIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskRateType是一个风险度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRiskRateType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcTimestampType是一个时间戳类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTimestampType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDRuleNameType是一个号段规则名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDRuleNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorIDRuleExprType是一个号段规则表达式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorIDRuleExprType[513];
/////////////////////////////////////////////////////////////////////////
///TFtdcLastDriftType是一个上次OTP漂移值类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLastDriftType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLastSuccessType是一个上次OTP成功值类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcLastSuccessType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthKeyType是一个令牌密钥类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthKeyType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcSerialNumberType是一个序列号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSerialNumberType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPTypeType是一个动态令牌类型类型
/////////////////////////////////////////////////////////////////////////
///无动态令牌
#define THOST_FTDC_OTP_NONE '0'
///时间令牌
#define THOST_FTDC_OTP_TOTP '1'
typedef char TThostFtdcOTPTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPVendorsIDType是一个动态令牌提供商类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTPVendorsIDType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPVendorsNameType是一个动态令牌提供商名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTPVendorsNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcOTPStatusType是一个动态令牌状态类型
/////////////////////////////////////////////////////////////////////////
///未使用
#define THOST_FTDC_OTPS_Unused '0'
///已使用
#define THOST_FTDC_OTPS_Used '1'
///注销
#define THOST_FTDC_OTPS_Disuse '2'
typedef char TThostFtdcOTPStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBrokerUserTypeType是一个经济公司用户类型类型
/////////////////////////////////////////////////////////////////////////
///投资者
#define THOST_FTDC_BUT_Investor '1'
///操作员
#define THOST_FTDC_BUT_BrokerUser '2'
typedef char TThostFtdcBrokerUserTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFutureTypeType是一个期货类型类型
/////////////////////////////////////////////////////////////////////////
///商品期货
#define THOST_FTDC_FUTT_Commodity '1'
///金融期货
#define THOST_FTDC_FUTT_Financial '2'
typedef char TThostFtdcFutureTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundEventTypeType是一个资金管理操作类型类型
/////////////////////////////////////////////////////////////////////////
///转账限额
#define THOST_FTDC_FET_Restriction '0'
///当日转账限额
#define THOST_FTDC_FET_TodayRestriction '1'
///期商流水
#define THOST_FTDC_FET_Transfer '2'
///资金冻结
#define THOST_FTDC_FET_Credit '3'
///投资者可提资金比例
#define THOST_FTDC_FET_InvestorWithdrawAlm '4'
///单个银行帐户转账限额
#define THOST_FTDC_FET_BankRestriction '5'
///银期签约账户
#define THOST_FTDC_FET_Accountregister '6'
///交易所出入金
#define THOST_FTDC_FET_ExchangeFundIO '7'
///投资者出入金
#define THOST_FTDC_FET_InvestorFundIO '8'
typedef char TThostFtdcFundEventTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountSourceTypeType是一个资金账户来源类型
/////////////////////////////////////////////////////////////////////////
///银期同步
#define THOST_FTDC_AST_FBTransfer '0'
///手工录入
#define THOST_FTDC_AST_ManualEntry '1'
typedef char TThostFtdcAccountSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCodeSourceTypeType是一个交易编码来源类型
/////////////////////////////////////////////////////////////////////////
///统一开户(已规范)
#define THOST_FTDC_CST_UnifyAccount '0'
///手工录入(未规范)
#define THOST_FTDC_CST_ManualEntry '1'
typedef char TThostFtdcCodeSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserRangeType是一个操作员范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_UR_All '0'
///单一操作员
#define THOST_FTDC_UR_Single '1'
typedef char TThostFtdcUserRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeSpanType是一个时间跨度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcTimeSpanType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcImportSequenceIDType是一个动态令牌导入批次编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcImportSequenceIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcByGroupType是一个交易统计表按客户统计方式类型
/////////////////////////////////////////////////////////////////////////
///按投资者统计
#define THOST_FTDC_BG_Investor '2'
///按类统计
#define THOST_FTDC_BG_Group '1'
typedef char TThostFtdcByGroupType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSumStatModeType是一个交易统计表按范围统计方式类型
/////////////////////////////////////////////////////////////////////////
///按合约统计
#define THOST_FTDC_TSSM_Instrument '1'
///按产品统计
#define THOST_FTDC_TSSM_Product '2'
///按交易所统计
#define THOST_FTDC_TSSM_Exchange '3'
typedef char TThostFtdcTradeSumStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcComTypeType是一个组合成交类型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcComTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductIDType是一个产品标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductNameType是一个产品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserProductMemoType是一个产品说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUserProductMemoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCCancelFlagType是一个新增或变更标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCCancelFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCDateType是一个日期类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCDateType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCInvestorNameType是一个客户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCInvestorNameType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOpenInvestorNameType是一个客户名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOpenInvestorNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCInvestorIDType是一个客户代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCInvestorIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCIdentifiedCardNoType是一个证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCIdentifiedCardNoType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCClientIDType是一个交易编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCClientIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCBankFlagType是一个银行标识类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCBankFlagType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCBankAccountType是一个银行账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCBankAccountType[23];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOpenNameType是一个开户人类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOpenNameType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMemoType是一个说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMemoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTimeType是一个时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTimeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTradeIDType是一个成交流水号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTradeIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCExchangeInstIDType是一个合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCExchangeInstIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMortgageNameType是一个质押品名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMortgageNameType[7];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCReasonType是一个事由类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCReasonType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcIsSettlementType是一个是否为非结算会员类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIsSettlementType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCPriceType是一个价格类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCPriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCOptionsTypeType是一个期权类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCOptionsTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCStrikePriceType是一个执行价类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCSRCStrikePriceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTargetProductIDType是一个标的品种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTargetProductIDType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCTargetInstrIDType是一个标的合约类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCTargetInstrIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommModelNameType是一个手续费率模板名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommModelNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommModelMemoType是一个手续费率模板备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCommModelMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcExprSetModeType是一个日期表达式设置类型类型
/////////////////////////////////////////////////////////////////////////
///相对已有规则设置
#define THOST_FTDC_ESM_Relative '1'
///典型设置
#define THOST_FTDC_ESM_Typical '2'
typedef char TThostFtdcExprSetModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRateInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///公司标准
#define THOST_FTDC_RIR_All '1'
///模板
#define THOST_FTDC_RIR_Model '2'
///单一投资者
#define THOST_FTDC_RIR_Single '3'
typedef char TThostFtdcRateInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAgentBrokerIDType是一个代理经纪公司代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAgentBrokerIDType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcDRIdentityIDType是一个交易中心代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDRIdentityIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDRIdentityNameType是一个交易中心名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDRIdentityNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcDBLinkIDType是一个DBLink标识号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDBLinkIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDataStatusType是一个主次用系统数据同步状态类型
/////////////////////////////////////////////////////////////////////////
///未同步
#define THOST_FTDC_SDS_Initialize '0'
///同步中
#define THOST_FTDC_SDS_Settlementing '1'
///已同步
#define THOST_FTDC_SDS_Settlemented '2'
typedef char TThostFtdcSyncDataStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeSourceType是一个成交来源类型
/////////////////////////////////////////////////////////////////////////
///来自交易所普通回报
#define THOST_FTDC_TSRC_NORMAL '0'
///来自查询
#define THOST_FTDC_TSRC_QUERY '1'
typedef char TThostFtdcTradeSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFlexStatModeType是一个产品合约统计方式类型
/////////////////////////////////////////////////////////////////////////
///产品统计
#define THOST_FTDC_FSM_Product '1'
///交易所统计
#define THOST_FTDC_FSM_Exchange '2'
///统计所有
#define THOST_FTDC_FSM_All '3'
typedef char TThostFtdcFlexStatModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcByInvestorRangeType是一个投资者范围统计方式类型
/////////////////////////////////////////////////////////////////////////
///属性统计
#define THOST_FTDC_BIR_Property '1'
///统计所有
#define THOST_FTDC_BIR_All '2'
typedef char TThostFtdcByInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSRiskRateType是一个风险度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSRiskRateType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcSequenceNo12Type是一个序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSequenceNo12Type;
/////////////////////////////////////////////////////////////////////////
///TFtdcPropertyInvestorRangeType是一个投资者范围类型
/////////////////////////////////////////////////////////////////////////
///所有
#define THOST_FTDC_PIR_All '1'
///投资者属性
#define THOST_FTDC_PIR_Property '2'
///单一投资者
#define THOST_FTDC_PIR_Single '3'
typedef char TThostFtdcPropertyInvestorRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileStatusType是一个文件状态类型
/////////////////////////////////////////////////////////////////////////
///未生成
#define THOST_FTDC_FIS_NoCreate '0'
///已生成
#define THOST_FTDC_FIS_Created '1'
///生成失败
#define THOST_FTDC_FIS_Failed '2'
typedef char TThostFtdcFileStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFileGenStyleType是一个文件生成方式类型
/////////////////////////////////////////////////////////////////////////
///下发
#define THOST_FTDC_FGS_FileTransmit '0'
///生成
#define THOST_FTDC_FGS_FileGen '1'
typedef char TThostFtdcFileGenStyleType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysOperModeType是一个系统日志操作方法类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_SoM_Add '1'
///修改
#define THOST_FTDC_SoM_Update '2'
///删除
#define THOST_FTDC_SoM_Delete '3'
///复制
#define THOST_FTDC_SoM_Copy '4'
///激活
#define THOST_FTDC_SoM_AcTive '5'
///注销
#define THOST_FTDC_SoM_CanCel '6'
///重置
#define THOST_FTDC_SoM_ReSet '7'
typedef char TThostFtdcSysOperModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysOperTypeType是一个系统日志操作类型类型
/////////////////////////////////////////////////////////////////////////
///修改操作员密码
#define THOST_FTDC_SoT_UpdatePassword '0'
///操作员组织架构关系
#define THOST_FTDC_SoT_UserDepartment '1'
///角色管理
#define THOST_FTDC_SoT_RoleManager '2'
///角色功能设置
#define THOST_FTDC_SoT_RoleFunction '3'
///基础参数设置
#define THOST_FTDC_SoT_BaseParam '4'
///设置操作员
#define THOST_FTDC_SoT_SetUserID '5'
///用户角色设置
#define THOST_FTDC_SoT_SetUserRole '6'
///用户IP限制
#define THOST_FTDC_SoT_UserIpRestriction '7'
///组织架构管理
#define THOST_FTDC_SoT_DepartmentManager '8'
///组织架构向查询分类复制
#define THOST_FTDC_SoT_DepartmentCopy '9'
///交易编码管理
#define THOST_FTDC_SoT_Tradingcode 'A'
///投资者状态维护
#define THOST_FTDC_SoT_InvestorStatus 'B'
///投资者权限管理
#define THOST_FTDC_SoT_InvestorAuthority 'C'
///属性设置
#define THOST_FTDC_SoT_PropertySet 'D'
///重置投资者密码
#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E'
///投资者个性信息维护
#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F'
typedef char TThostFtdcSysOperTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCDataQueyTypeType是一个上报数据查询类型类型
/////////////////////////////////////////////////////////////////////////
///查询当前交易日报送的数据
#define THOST_FTDC_CSRCQ_Current '0'
///查询历史报送的代理经纪公司的数据
#define THOST_FTDC_CSRCQ_History '1'
typedef char TThostFtdcCSRCDataQueyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFreezeStatusType是一个休眠状态类型
/////////////////////////////////////////////////////////////////////////
///活跃
#define THOST_FTDC_FRS_Normal '1'
///休眠
#define THOST_FTDC_FRS_Freeze '0'
typedef char TThostFtdcFreezeStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStandardStatusType是一个规范状态类型
/////////////////////////////////////////////////////////////////////////
///已规范
#define THOST_FTDC_STST_Standard '0'
///未规范
#define THOST_FTDC_STST_NonStandard '1'
typedef char TThostFtdcStandardStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCFreezeStatusType是一个休眠状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCFreezeStatusType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcRightParamTypeType是一个配置类型类型
/////////////////////////////////////////////////////////////////////////
///休眠户
#define THOST_FTDC_RPT_Freeze '1'
///激活休眠户
#define THOST_FTDC_RPT_FreezeActive '2'
///开仓权限限制
#define THOST_FTDC_RPT_OpenLimit '3'
///解除开仓权限限制
#define THOST_FTDC_RPT_RelieveOpenLimit '4'
typedef char TThostFtdcRightParamTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRightTemplateIDType是一个模板代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRightTemplateIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcRightTemplateNameType是一个模板名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRightTemplateNameType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcDataStatusType是一个反洗钱审核表数据状态类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_AMLDS_Normal '0'
///已删除
#define THOST_FTDC_AMLDS_Deleted '1'
typedef char TThostFtdcDataStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAMLCheckStatusType是一个审核状态类型
/////////////////////////////////////////////////////////////////////////
///未复核
#define THOST_FTDC_AMLCHS_Init '0'
///复核中
#define THOST_FTDC_AMLCHS_Checking '1'
///已复核
#define THOST_FTDC_AMLCHS_Checked '2'
///拒绝上报
#define THOST_FTDC_AMLCHS_RefuseReport '3'
typedef char TThostFtdcAMLCheckStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlDateTypeType是一个日期类型类型
/////////////////////////////////////////////////////////////////////////
///检查日期
#define THOST_FTDC_AMLDT_DrawDay '0'
///发生日期
#define THOST_FTDC_AMLDT_TouchDay '1'
typedef char TThostFtdcAmlDateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlCheckLevelType是一个审核级别类型
/////////////////////////////////////////////////////////////////////////
///零级审核
#define THOST_FTDC_AMLCL_CheckLevel0 '0'
///一级审核
#define THOST_FTDC_AMLCL_CheckLevel1 '1'
///二级审核
#define THOST_FTDC_AMLCL_CheckLevel2 '2'
///三级审核
#define THOST_FTDC_AMLCL_CheckLevel3 '3'
typedef char TThostFtdcAmlCheckLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmlCheckFlowType是一个反洗钱数据抽取审核流程类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAmlCheckFlowType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcDataTypeType是一个数据类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDataTypeType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcExportFileTypeType是一个导出文件类型类型
/////////////////////////////////////////////////////////////////////////
///CSV
#define THOST_FTDC_EFT_CSV '0'
///Excel
#define THOST_FTDC_EFT_EXCEL '1'
///DBF
#define THOST_FTDC_EFT_DBF '2'
typedef char TThostFtdcExportFileTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerTypeType是一个结算配置类型类型
/////////////////////////////////////////////////////////////////////////
///结算前准备
#define THOST_FTDC_SMT_Before '1'
///结算
#define THOST_FTDC_SMT_Settlement '2'
///结算后核对
#define THOST_FTDC_SMT_After '3'
///结算后处理
#define THOST_FTDC_SMT_Settlemented '4'
typedef char TThostFtdcSettleManagerTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerIDType是一个结算配置代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettleManagerIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerNameType是一个结算配置名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSettleManagerNameType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerLevelType是一个结算配置等级类型
/////////////////////////////////////////////////////////////////////////
///必要
#define THOST_FTDC_SML_Must '1'
///警告
#define THOST_FTDC_SML_Alarm '2'
///提示
#define THOST_FTDC_SML_Prompt '3'
///不检查
#define THOST_FTDC_SML_Ignore '4'
typedef char TThostFtdcSettleManagerLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettleManagerGroupType是一个模块分组类型
/////////////////////////////////////////////////////////////////////////
///交易所核对
#define THOST_FTDC_SMG_Exhcange '1'
///内部核对
#define THOST_FTDC_SMG_ASP '2'
///上报数据核对
#define THOST_FTDC_SMG_CSRC '3'
typedef char TThostFtdcSettleManagerGroupType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckResultMemoType是一个核对结果说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCheckResultMemoType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcFunctionUrlType是一个功能链接类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcFunctionUrlType[1025];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthInfoType是一个客户端认证信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthInfoType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthCodeType是一个客户端认证码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAuthCodeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcLimitUseTypeType是一个保值额度使用类型类型
/////////////////////////////////////////////////////////////////////////
///可重复使用
#define THOST_FTDC_LUT_Repeatable '1'
///不可重复使用
#define THOST_FTDC_LUT_Unrepeatable '2'
typedef char TThostFtdcLimitUseTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDataResourceType是一个数据来源类型
/////////////////////////////////////////////////////////////////////////
///本系统
#define THOST_FTDC_DAR_Settle '1'
///交易所
#define THOST_FTDC_DAR_Exchange '2'
///报送数据
#define THOST_FTDC_DAR_CSRC '3'
typedef char TThostFtdcDataResourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginTypeType是一个保证金类型类型
/////////////////////////////////////////////////////////////////////////
///交易所保证金率
#define THOST_FTDC_MGT_ExchMarginRate '0'
///投资者保证金率
#define THOST_FTDC_MGT_InstrMarginRate '1'
///投资者交易保证金率
#define THOST_FTDC_MGT_InstrMarginRateTrade '2'
typedef char TThostFtdcMarginTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActiveTypeType是一个生效类型类型
/////////////////////////////////////////////////////////////////////////
///仅当日生效
#define THOST_FTDC_ACT_Intraday '1'
///长期生效
#define THOST_FTDC_ACT_Long '2'
typedef char TThostFtdcActiveTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMarginRateTypeType是一个冲突保证金率类型类型
/////////////////////////////////////////////////////////////////////////
///交易所保证金率
#define THOST_FTDC_MRT_Exchange '1'
///投资者保证金率
#define THOST_FTDC_MRT_Investor '2'
///投资者交易保证金率
#define THOST_FTDC_MRT_InvestorTrade '3'
typedef char TThostFtdcMarginRateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBackUpStatusType是一个备份数据状态类型
/////////////////////////////////////////////////////////////////////////
///未生成备份数据
#define THOST_FTDC_BUS_UnBak '0'
///备份数据生成中
#define THOST_FTDC_BUS_BakUp '1'
///已生成备份数据
#define THOST_FTDC_BUS_BakUped '2'
///备份数据失败
#define THOST_FTDC_BUS_BakFail '3'
typedef char TThostFtdcBackUpStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInitSettlementType是一个结算初始化状态类型
/////////////////////////////////////////////////////////////////////////
///结算初始化未开始
#define THOST_FTDC_SIS_UnInitialize '0'
///结算初始化中
#define THOST_FTDC_SIS_Initialize '1'
///结算初始化完成
#define THOST_FTDC_SIS_Initialized '2'
typedef char TThostFtdcInitSettlementType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReportStatusType是一个报表数据生成状态类型
/////////////////////////////////////////////////////////////////////////
///未生成报表数据
#define THOST_FTDC_SRS_NoCreate '0'
///报表数据生成中
#define THOST_FTDC_SRS_Create '1'
///已生成报表数据
#define THOST_FTDC_SRS_Created '2'
///生成报表数据失败
#define THOST_FTDC_SRS_CreateFail '3'
typedef char TThostFtdcReportStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSaveStatusType是一个数据归档状态类型
/////////////////////////////////////////////////////////////////////////
///归档未完成
#define THOST_FTDC_SSS_UnSaveData '0'
///归档完成
#define THOST_FTDC_SSS_SaveDatad '1'
typedef char TThostFtdcSaveStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSettArchiveStatusType是一个结算确认数据归档状态类型
/////////////////////////////////////////////////////////////////////////
///未归档数据
#define THOST_FTDC_SAS_UnArchived '0'
///数据归档中
#define THOST_FTDC_SAS_Archiving '1'
///已归档数据
#define THOST_FTDC_SAS_Archived '2'
///归档数据失败
#define THOST_FTDC_SAS_ArchiveFail '3'
typedef char TThostFtdcSettArchiveStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCTPTypeType是一个CTP交易系统类型类型
/////////////////////////////////////////////////////////////////////////
///未知类型
#define THOST_FTDC_CTPT_Unkown '0'
///主中心
#define THOST_FTDC_CTPT_MainCenter '1'
///备中心
#define THOST_FTDC_CTPT_BackUp '2'
typedef char TThostFtdcCTPTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcToolIDType是一个工具代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcToolIDType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcToolNameType是一个工具名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcToolNameType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcCloseDealTypeType是一个平仓处理类型类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_CDT_Normal '0'
///投机平仓优先
#define THOST_FTDC_CDT_SpecFirst '1'
typedef char TThostFtdcCloseDealTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMortgageFundUseRangeType是一个货币质押资金可用范围类型
/////////////////////////////////////////////////////////////////////////
///不能使用
#define THOST_FTDC_MFUR_None '0'
///用于保证金
#define THOST_FTDC_MFUR_Margin '1'
///用于手续费、盈亏、保证金
#define THOST_FTDC_MFUR_All '2'
///人民币方案3
#define THOST_FTDC_MFUR_CNY3 '3'
typedef char TThostFtdcMortgageFundUseRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyUnitType是一个币种单位数量类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcCurrencyUnitType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExchangeRateType是一个汇率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcExchangeRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpecProductTypeType是一个特殊产品类型类型
/////////////////////////////////////////////////////////////////////////
///郑商所套保产品
#define THOST_FTDC_SPT_CzceHedge '1'
///货币质押产品
#define THOST_FTDC_SPT_IneForeignCurrency '2'
///大连短线开平仓产品
#define THOST_FTDC_SPT_DceOpenClose '3'
typedef char TThostFtdcSpecProductTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortgageTypeType是一个货币质押类型类型
/////////////////////////////////////////////////////////////////////////
///质押
#define THOST_FTDC_FMT_Mortgage '1'
///解质
#define THOST_FTDC_FMT_Redemption '2'
typedef char TThostFtdcFundMortgageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAccountSettlementParamIDType是一个投资者账户结算参数代码类型
/////////////////////////////////////////////////////////////////////////
///基础保证金
#define THOST_FTDC_ASPI_BaseMargin '1'
///最低权益标准
#define THOST_FTDC_ASPI_LowestInterest '2'
typedef char TThostFtdcAccountSettlementParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencyNameType是一个币种名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencyNameType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySignType是一个币种符号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencySignType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortDirectionType是一个货币质押方向类型
/////////////////////////////////////////////////////////////////////////
///货币质入
#define THOST_FTDC_FMD_In '1'
///货币质出
#define THOST_FTDC_FMD_Out '2'
typedef char TThostFtdcFundMortDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessClassType是一个换汇类别类型
/////////////////////////////////////////////////////////////////////////
///盈利
#define THOST_FTDC_BT_Profit '0'
///亏损
#define THOST_FTDC_BT_Loss '1'
///其他
#define THOST_FTDC_BT_Other 'Z'
typedef char TThostFtdcBusinessClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSwapSourceTypeType是一个换汇数据来源类型
/////////////////////////////////////////////////////////////////////////
///手工
#define THOST_FTDC_SST_Manual '0'
///自动生成
#define THOST_FTDC_SST_Automatic '1'
typedef char TThostFtdcSwapSourceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrExDirectionType是一个换汇类型类型
/////////////////////////////////////////////////////////////////////////
///结汇
#define THOST_FTDC_CED_Settlement '0'
///售汇
#define THOST_FTDC_CED_Sale '1'
typedef char TThostFtdcCurrExDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySwapStatusType是一个申请状态类型
/////////////////////////////////////////////////////////////////////////
///已录入
#define THOST_FTDC_CSS_Entry '1'
///已审核
#define THOST_FTDC_CSS_Approve '2'
///已拒绝
#define THOST_FTDC_CSS_Refuse '3'
///已撤销
#define THOST_FTDC_CSS_Revoke '4'
///已发送
#define THOST_FTDC_CSS_Send '5'
///换汇成功
#define THOST_FTDC_CSS_Success '6'
///换汇失败
#define THOST_FTDC_CSS_Failure '7'
typedef char TThostFtdcCurrencySwapStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrExchCertNoType是一个凭证号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrExchCertNoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcBatchSerialNoType是一个批次号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBatchSerialNoType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcReqFlagType是一个换汇发送标志类型
/////////////////////////////////////////////////////////////////////////
///未发送
#define THOST_FTDC_REQF_NoSend '0'
///发送成功
#define THOST_FTDC_REQF_SendSuccess '1'
///发送失败
#define THOST_FTDC_REQF_SendFailed '2'
///等待重发
#define THOST_FTDC_REQF_WaitReSend '3'
typedef char TThostFtdcReqFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcResFlagType是一个换汇返回成功标志类型
/////////////////////////////////////////////////////////////////////////
///成功
#define THOST_FTDC_RESF_Success '0'
///账户余额不足
#define THOST_FTDC_RESF_InsuffiCient '1'
///交易结果未知
#define THOST_FTDC_RESF_UnKnown '8'
typedef char TThostFtdcResFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPageControlType是一个换汇页面控制类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPageControlType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcRecordCountType是一个记录数类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRecordCountType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrencySwapMemoType是一个换汇需确认信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCurrencySwapMemoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcExStatusType是一个修改状态类型
/////////////////////////////////////////////////////////////////////////
///修改前
#define THOST_FTDC_EXS_Before '0'
///修改后
#define THOST_FTDC_EXS_After '1'
typedef char TThostFtdcExStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientRegionType是一个开户客户地域类型
/////////////////////////////////////////////////////////////////////////
///国内客户
#define THOST_FTDC_CR_Domestic '1'
///港澳台客户
#define THOST_FTDC_CR_GMT '2'
///国外客户
#define THOST_FTDC_CR_Foreign '3'
typedef char TThostFtdcClientRegionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWorkPlaceType是一个工作单位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWorkPlaceType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBusinessPeriodType是一个经营期限类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBusinessPeriodType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcWebSiteType是一个网址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWebSiteType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAIdCardTypeType是一个统一开户证件类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAIdCardTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcClientModeType是一个开户模式类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientModeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestorFullNameType是一个投资者全称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestorFullNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOABrokerIDType是一个境外中介机构ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOABrokerIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAZipCodeType是一个邮政编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAZipCodeType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAEMailType是一个电子邮箱类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOAEMailType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcOldCityType是一个城市类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOldCityType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcCorporateIdentifiedCardNoType是一个法人代表证件号码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCorporateIdentifiedCardNoType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcHasBoardType是一个是否有董事会类型
/////////////////////////////////////////////////////////////////////////
///没有
#define THOST_FTDC_HB_No '0'
///有
#define THOST_FTDC_HB_Yes '1'
typedef char TThostFtdcHasBoardType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStartModeType是一个启动模式类型
/////////////////////////////////////////////////////////////////////////
///正常
#define THOST_FTDC_SM_Normal '1'
///应急
#define THOST_FTDC_SM_Emerge '2'
///恢复
#define THOST_FTDC_SM_Restore '3'
typedef char TThostFtdcStartModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTemplateTypeType是一个模型类型类型
/////////////////////////////////////////////////////////////////////////
///全量
#define THOST_FTDC_TPT_Full '1'
///增量
#define THOST_FTDC_TPT_Increment '2'
///备份
#define THOST_FTDC_TPT_BackUp '3'
typedef char TThostFtdcTemplateTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLoginModeType是一个登录模式类型
/////////////////////////////////////////////////////////////////////////
///交易
#define THOST_FTDC_LM_Trade '0'
///转账
#define THOST_FTDC_LM_Transfer '1'
typedef char TThostFtdcLoginModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPromptTypeType是一个日历提示类型类型
/////////////////////////////////////////////////////////////////////////
///合约上下市
#define THOST_FTDC_CPT_Instrument '1'
///保证金分段生效
#define THOST_FTDC_CPT_Margin '2'
typedef char TThostFtdcPromptTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLedgerManageIDType是一个分户管理资产编码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLedgerManageIDType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestVarietyType是一个投资品种类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestVarietyType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcBankAccountTypeType是一个账户类别类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBankAccountTypeType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcLedgerManageBankType是一个开户银行类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLedgerManageBankType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffexDepartmentNameType是一个开户营业部类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffexDepartmentNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcCffexDepartmentCodeType是一个营业部代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCffexDepartmentCodeType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcHasTrusteeType是一个是否有托管人类型
/////////////////////////////////////////////////////////////////////////
///有
#define THOST_FTDC_HT_Yes '1'
///没有
#define THOST_FTDC_HT_No '0'
typedef char TThostFtdcHasTrusteeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCMemo1Type是一个说明类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCMemo1Type[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrCFullNameType是一个代理资产管理业务的期货公司全称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrCFullNameType[101];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrApprovalNOType是一个资产管理业务批文号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrApprovalNOType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrMgrNameType是一个资产管理业务负责人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAssetmgrMgrNameType[401];
/////////////////////////////////////////////////////////////////////////
///TFtdcAmTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
///银行
#define THOST_FTDC_AMT_Bank '1'
///证券公司
#define THOST_FTDC_AMT_Securities '2'
///基金公司
#define THOST_FTDC_AMT_Fund '3'
///保险公司
#define THOST_FTDC_AMT_Insurance '4'
///信托公司
#define THOST_FTDC_AMT_Trust '5'
///其他
#define THOST_FTDC_AMT_Other '9'
typedef char TThostFtdcAmTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCAmTypeType是一个机构类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCAmTypeType[5];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCFundIOTypeType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///出入金
#define THOST_FTDC_CFIOT_FundIO '0'
///银期换汇
#define THOST_FTDC_CFIOT_SwapCurrency '1'
typedef char TThostFtdcCSRCFundIOTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCusAccountTypeType是一个结算账户类型类型
/////////////////////////////////////////////////////////////////////////
///期货结算账户
#define THOST_FTDC_CAT_Futures '1'
///纯期货资管业务下的资管结算账户
#define THOST_FTDC_CAT_AssetmgrFuture '2'
///综合类资管业务下的期货资管托管账户
#define THOST_FTDC_CAT_AssetmgrTrustee '3'
///综合类资管业务下的资金中转账户
#define THOST_FTDC_CAT_AssetmgrTransfer '4'
typedef char TThostFtdcCusAccountTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCNationalType是一个国籍类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCNationalType[4];
/////////////////////////////////////////////////////////////////////////
///TFtdcCSRCSecAgentIDType是一个二级代理ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCSRCSecAgentIDType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcLanguageTypeType是一个通知语言类型类型
/////////////////////////////////////////////////////////////////////////
///中文
#define THOST_FTDC_LT_Chinese '1'
///英文
#define THOST_FTDC_LT_English '2'
typedef char TThostFtdcLanguageTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAmAccountType是一个投资账户类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAmAccountType[23];
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrClientTypeType是一个资产管理客户类型类型
/////////////////////////////////////////////////////////////////////////
///个人资管客户
#define THOST_FTDC_AMCT_Person '1'
///单位资管客户
#define THOST_FTDC_AMCT_Organ '2'
///特殊单位资管客户
#define THOST_FTDC_AMCT_SpecialOrgan '4'
typedef char TThostFtdcAssetmgrClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAssetmgrTypeType是一个投资类型类型
/////////////////////////////////////////////////////////////////////////
///期货类
#define THOST_FTDC_ASST_Futures '3'
///综合类
#define THOST_FTDC_ASST_SpecialOrgan '4'
typedef char TThostFtdcAssetmgrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOMType是一个计量单位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcUOMType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEInstLifePhaseType是一个上期所合约生命周期状态类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSHFEInstLifePhaseType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEProductClassType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSHFEProductClassType[11];
/////////////////////////////////////////////////////////////////////////
///TFtdcPriceDecimalType是一个价格小数位类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcPriceDecimalType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcInTheMoneyFlagType是一个平值期权标志类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInTheMoneyFlagType[2];
/////////////////////////////////////////////////////////////////////////
///TFtdcCheckInstrTypeType是一个合约比较类型类型
/////////////////////////////////////////////////////////////////////////
///合约交易所不存在
#define THOST_FTDC_CIT_HasExch '0'
///合约本系统不存在
#define THOST_FTDC_CIT_HasATP '1'
///合约比较不一致
#define THOST_FTDC_CIT_HasDiff '2'
typedef char TThostFtdcCheckInstrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeliveryTypeType是一个交割类型类型
/////////////////////////////////////////////////////////////////////////
///手工交割
#define THOST_FTDC_DT_HandDeliv '1'
///到期交割
#define THOST_FTDC_DT_PersonDeliv '2'
typedef char TThostFtdcDeliveryTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBigMoneyType是一个资金类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcBigMoneyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMaxMarginSideAlgorithmType是一个大额单边保证金算法类型
/////////////////////////////////////////////////////////////////////////
///不使用大额单边保证金算法
#define THOST_FTDC_MMSA_NO '0'
///使用大额单边保证金算法
#define THOST_FTDC_MMSA_YES '1'
typedef char TThostFtdcMaxMarginSideAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDAClientTypeType是一个资产管理客户类型类型
/////////////////////////////////////////////////////////////////////////
///自然人
#define THOST_FTDC_CACT_Person '0'
///法人
#define THOST_FTDC_CACT_Company '1'
///其他
#define THOST_FTDC_CACT_Other '2'
typedef char TThostFtdcDAClientTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinInstrIDType是一个套利合约代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombinInstrIDType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinSettlePriceType是一个各腿结算价类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCombinSettlePriceType[61];
/////////////////////////////////////////////////////////////////////////
///TFtdcDCEPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcDCEPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradeGroupIDType是一个成交组号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcTradeGroupIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIsCheckPrepaType是一个是否校验开户可用资金类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcIsCheckPrepaType;
/////////////////////////////////////////////////////////////////////////
///TFtdcUOAAssetmgrTypeType是一个投资类型类型
/////////////////////////////////////////////////////////////////////////
///期货类
#define THOST_FTDC_UOAAT_Futures '1'
///综合类
#define THOST_FTDC_UOAAT_SpecialOrgan '2'
typedef char TThostFtdcUOAAssetmgrTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDirectionEnType是一个买卖方向类型
/////////////////////////////////////////////////////////////////////////
///Buy
#define THOST_FTDC_DEN_Buy '0'
///Sell
#define THOST_FTDC_DEN_Sell '1'
typedef char TThostFtdcDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetFlagEnType是一个开平标志类型
/////////////////////////////////////////////////////////////////////////
///Position Opening
#define THOST_FTDC_OFEN_Open '0'
///Position Close
#define THOST_FTDC_OFEN_Close '1'
///Forced Liquidation
#define THOST_FTDC_OFEN_ForceClose '2'
///Close Today
#define THOST_FTDC_OFEN_CloseToday '3'
///Close Prev.
#define THOST_FTDC_OFEN_CloseYesterday '4'
///Forced Reduction
#define THOST_FTDC_OFEN_ForceOff '5'
///Local Forced Liquidation
#define THOST_FTDC_OFEN_LocalForceClose '6'
typedef char TThostFtdcOffsetFlagEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeFlagEnType是一个投机套保标志类型
/////////////////////////////////////////////////////////////////////////
///Speculation
#define THOST_FTDC_HFEN_Speculation '1'
///Arbitrage
#define THOST_FTDC_HFEN_Arbitrage '2'
///Hedge
#define THOST_FTDC_HFEN_Hedge '3'
typedef char TThostFtdcHedgeFlagEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundIOTypeEnType是一个出入金类型类型
/////////////////////////////////////////////////////////////////////////
///Deposit/Withdrawal
#define THOST_FTDC_FIOTEN_FundIO '1'
///Bank-Futures Transfer
#define THOST_FTDC_FIOTEN_Transfer '2'
///Bank-Futures FX Exchange
#define THOST_FTDC_FIOTEN_SwapCurrency '3'
typedef char TThostFtdcFundIOTypeEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundTypeEnType是一个资金类型类型
/////////////////////////////////////////////////////////////////////////
///Bank Deposit
#define THOST_FTDC_FTEN_Deposite '1'
///Payment/Fee
#define THOST_FTDC_FTEN_ItemFund '2'
///Brokerage Adj
#define THOST_FTDC_FTEN_Company '3'
///Internal Transfer
#define THOST_FTDC_FTEN_InnerTransfer '4'
typedef char TThostFtdcFundTypeEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundDirectionEnType是一个出入金方向类型
/////////////////////////////////////////////////////////////////////////
///Deposit
#define THOST_FTDC_FDEN_In '1'
///Withdrawal
#define THOST_FTDC_FDEN_Out '2'
typedef char TThostFtdcFundDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcFundMortDirectionEnType是一个货币质押方向类型
/////////////////////////////////////////////////////////////////////////
///Pledge
#define THOST_FTDC_FMDEN_In '1'
///Redemption
#define THOST_FTDC_FMDEN_Out '2'
typedef char TThostFtdcFundMortDirectionEnType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSwapBusinessTypeType是一个换汇业务种类类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSwapBusinessTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionsTypeType是一个期权类型类型
/////////////////////////////////////////////////////////////////////////
///看涨
#define THOST_FTDC_CP_CallOptions '1'
///看跌
#define THOST_FTDC_CP_PutOptions '2'
typedef char TThostFtdcOptionsTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeModeType是一个执行方式类型
/////////////////////////////////////////////////////////////////////////
///欧式
#define THOST_FTDC_STM_Continental '0'
///美式
#define THOST_FTDC_STM_American '1'
///百慕大
#define THOST_FTDC_STM_Bermuda '2'
typedef char TThostFtdcStrikeModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeTypeType是一个执行类型类型
/////////////////////////////////////////////////////////////////////////
///自身对冲
#define THOST_FTDC_STT_Hedge '0'
///匹配执行
#define THOST_FTDC_STT_Match '1'
typedef char TThostFtdcStrikeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcApplyTypeType是一个中金所期权放弃执行申请类型类型
/////////////////////////////////////////////////////////////////////////
///不执行数量
#define THOST_FTDC_APPT_NotStrikeNum '4'
typedef char TThostFtdcApplyTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcGiveUpDataSourceType是一个放弃执行申请数据来源类型
/////////////////////////////////////////////////////////////////////////
///系统生成
#define THOST_FTDC_GUDS_Gen '0'
///手工添加
#define THOST_FTDC_GUDS_Hand '1'
typedef char TThostFtdcGiveUpDataSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderSysIDType是一个执行宣告系统编号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcExecOrderSysIDType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcExecResultType是一个执行结果类型
/////////////////////////////////////////////////////////////////////////
///没有执行
#define THOST_FTDC_OER_NoExec 'n'
///已经取消
#define THOST_FTDC_OER_Canceled 'c'
///执行成功
#define THOST_FTDC_OER_OK '0'
///期权持仓不够
#define THOST_FTDC_OER_NoPosition '1'
///资金不够
#define THOST_FTDC_OER_NoDeposit '2'
///会员不存在
#define THOST_FTDC_OER_NoParticipant '3'
///客户不存在
#define THOST_FTDC_OER_NoClient '4'
///合约不存在
#define THOST_FTDC_OER_NoInstrument '6'
///没有执行权限
#define THOST_FTDC_OER_NoRight '7'
///不合理的数量
#define THOST_FTDC_OER_InvalidVolume '8'
///没有足够的历史成交
#define THOST_FTDC_OER_NoEnoughHistoryTrade '9'
///未知
#define THOST_FTDC_OER_Unknown 'a'
typedef char TThostFtdcExecResultType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeSequenceType是一个执行序号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcStrikeSequenceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeTimeType是一个执行时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcStrikeTimeType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcCombinationTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
///期货组合
#define THOST_FTDC_COMBT_Future '0'
///垂直价差BUL
#define THOST_FTDC_COMBT_BUL '1'
///垂直价差BER
#define THOST_FTDC_COMBT_BER '2'
///跨式组合
#define THOST_FTDC_COMBT_STD '3'
///宽跨式组合
#define THOST_FTDC_COMBT_STG '4'
///备兑组合
#define THOST_FTDC_COMBT_PRT '5'
///时间价差组合
#define THOST_FTDC_COMBT_CAS '6'
///期权对锁组合
#define THOST_FTDC_COMBT_OPL '7'
///买备兑组合
#define THOST_FTDC_COMBT_BFO '8'
///买入期权垂直价差组合
#define THOST_FTDC_COMBT_BLS '9'
///卖出期权垂直价差组合
#define THOST_FTDC_COMBT_BES 'a'
typedef char TThostFtdcCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDceCombinationTypeType是一个组合类型类型
/////////////////////////////////////////////////////////////////////////
///期货对锁组合
#define THOST_FTDC_DCECOMBT_SPL '0'
///期权对锁组合
#define THOST_FTDC_DCECOMBT_OPL '1'
///期货跨期组合
#define THOST_FTDC_DCECOMBT_SP '2'
///期货跨品种组合
#define THOST_FTDC_DCECOMBT_SPC '3'
///买入期权垂直价差组合
#define THOST_FTDC_DCECOMBT_BLS '4'
///卖出期权垂直价差组合
#define THOST_FTDC_DCECOMBT_BES '5'
///期权日历价差组合
#define THOST_FTDC_DCECOMBT_CAS '6'
///期权跨式组合
#define THOST_FTDC_DCECOMBT_STD '7'
///期权宽跨式组合
#define THOST_FTDC_DCECOMBT_STG '8'
///买入期货期权组合
#define THOST_FTDC_DCECOMBT_BFO '9'
///卖出期货期权组合
#define THOST_FTDC_DCECOMBT_SFO 'a'
typedef char TThostFtdcDceCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOptionRoyaltyPriceTypeType是一个期权权利金价格类型类型
/////////////////////////////////////////////////////////////////////////
///昨结算价
#define THOST_FTDC_ORPT_PreSettlementPrice '1'
///开仓价
#define THOST_FTDC_ORPT_OpenPrice '4'
///最新价与昨结算价较大值
#define THOST_FTDC_ORPT_MaxPreSettlementPrice '5'
typedef char TThostFtdcOptionRoyaltyPriceTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBalanceAlgorithmType是一个权益算法类型
/////////////////////////////////////////////////////////////////////////
///不计算期权市值盈亏
#define THOST_FTDC_BLAG_Default '1'
///计算期权市值亏损
#define THOST_FTDC_BLAG_IncludeOptValLost '2'
typedef char TThostFtdcBalanceAlgorithmType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionTypeType是一个执行类型类型
/////////////////////////////////////////////////////////////////////////
///执行
#define THOST_FTDC_ACTP_Exec '1'
///放弃
#define THOST_FTDC_ACTP_Abandon '2'
typedef char TThostFtdcActionTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcForQuoteStatusType是一个询价状态类型
/////////////////////////////////////////////////////////////////////////
///已经提交
#define THOST_FTDC_FQST_Submitted 'a'
///已经接受
#define THOST_FTDC_FQST_Accepted 'b'
///已经被拒绝
#define THOST_FTDC_FQST_Rejected 'c'
typedef char TThostFtdcForQuoteStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcValueMethodType是一个取值方式类型
/////////////////////////////////////////////////////////////////////////
///按绝对值
#define THOST_FTDC_VM_Absolute '0'
///按比率
#define THOST_FTDC_VM_Ratio '1'
typedef char TThostFtdcValueMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderPositionFlagType是一个期权行权后是否保留期货头寸的标记类型
/////////////////////////////////////////////////////////////////////////
///保留
#define THOST_FTDC_EOPF_Reserve '0'
///不保留
#define THOST_FTDC_EOPF_UnReserve '1'
typedef char TThostFtdcExecOrderPositionFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcExecOrderCloseFlagType是一个期权行权后生成的头寸是否自动平仓类型
/////////////////////////////////////////////////////////////////////////
///自动平仓
#define THOST_FTDC_EOCF_AutoClose '0'
///免于自动平仓
#define THOST_FTDC_EOCF_NotToClose '1'
typedef char TThostFtdcExecOrderCloseFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductTypeType是一个产品类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_PTE_Futures '1'
///期权
#define THOST_FTDC_PTE_Options '2'
typedef char TThostFtdcProductTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCZCEUploadFileNameType是一个郑商所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{8}_zz_\d{4}
#define THOST_FTDC_CUFN_CUFN_O 'O'
///^\d{8}成交表
#define THOST_FTDC_CUFN_CUFN_T 'T'
///^\d{8}单腿持仓表new
#define THOST_FTDC_CUFN_CUFN_P 'P'
///^\d{8}非平仓了结表
#define THOST_FTDC_CUFN_CUFN_N 'N'
///^\d{8}平仓表
#define THOST_FTDC_CUFN_CUFN_L 'L'
///^\d{8}资金表
#define THOST_FTDC_CUFN_CUFN_F 'F'
///^\d{8}组合持仓表
#define THOST_FTDC_CUFN_CUFN_C 'C'
///^\d{8}保证金参数表
#define THOST_FTDC_CUFN_CUFN_M 'M'
typedef char TThostFtdcCZCEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDCEUploadFileNameType是一个大商所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{8}_dl_\d{3}
#define THOST_FTDC_DUFN_DUFN_O 'O'
///^\d{8}_成交表
#define THOST_FTDC_DUFN_DUFN_T 'T'
///^\d{8}_持仓表
#define THOST_FTDC_DUFN_DUFN_P 'P'
///^\d{8}_资金结算表
#define THOST_FTDC_DUFN_DUFN_F 'F'
///^\d{8}_优惠组合持仓明细表
#define THOST_FTDC_DUFN_DUFN_C 'C'
///^\d{8}_持仓明细表
#define THOST_FTDC_DUFN_DUFN_D 'D'
///^\d{8}_保证金参数表
#define THOST_FTDC_DUFN_DUFN_M 'M'
///^\d{8}_期权执行表
#define THOST_FTDC_DUFN_DUFN_S 'S'
typedef char TThostFtdcDCEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSHFEUploadFileNameType是一个上期所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{4}_\d{8}_\d{8}_DailyFundChg
#define THOST_FTDC_SUFN_SUFN_O 'O'
///^\d{4}_\d{8}_\d{8}_Trade
#define THOST_FTDC_SUFN_SUFN_T 'T'
///^\d{4}_\d{8}_\d{8}_SettlementDetail
#define THOST_FTDC_SUFN_SUFN_P 'P'
///^\d{4}_\d{8}_\d{8}_Capital
#define THOST_FTDC_SUFN_SUFN_F 'F'
typedef char TThostFtdcSHFEUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCFFEXUploadFileNameType是一个中金所结算文件名类型
/////////////////////////////////////////////////////////////////////////
///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade
#define THOST_FTDC_CFUFN_SUFN_T 'T'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail
#define THOST_FTDC_CFUFN_SUFN_P 'P'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital
#define THOST_FTDC_CFUFN_SUFN_F 'F'
///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec
#define THOST_FTDC_CFUFN_SUFN_S 'S'
typedef char TThostFtdcCFFEXUploadFileNameType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCombDirectionType是一个组合指令方向类型
/////////////////////////////////////////////////////////////////////////
///申请组合
#define THOST_FTDC_CMDR_Comb '0'
///申请拆分
#define THOST_FTDC_CMDR_UnComb '1'
///操作员删组合单
#define THOST_FTDC_CMDR_DelComb '2'
typedef char TThostFtdcCombDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStrikeOffsetTypeType是一个行权偏移类型类型
/////////////////////////////////////////////////////////////////////////
///实值额
#define THOST_FTDC_STOV_RealValue '1'
///盈利额
#define THOST_FTDC_STOV_ProfitValue '2'
///实值比例
#define THOST_FTDC_STOV_RealRatio '3'
///盈利比例
#define THOST_FTDC_STOV_ProfitRatio '4'
typedef char TThostFtdcStrikeOffsetTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReserveOpenAccStasType是一个预约开户状态类型
/////////////////////////////////////////////////////////////////////////
///等待处理中
#define THOST_FTDC_ROAST_Processing '0'
///已撤销
#define THOST_FTDC_ROAST_Cancelled '1'
///已开户
#define THOST_FTDC_ROAST_Opened '2'
///无效请求
#define THOST_FTDC_ROAST_Invalid '3'
typedef char TThostFtdcReserveOpenAccStasType;
/////////////////////////////////////////////////////////////////////////
///TFtdcLoginRemarkType是一个登录备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLoginRemarkType[36];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvestUnitIDType是一个投资单元代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcInvestUnitIDType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcBulletinIDType是一个公告编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcBulletinIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcNewsTypeType是一个公告类型类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNewsTypeType[3];
/////////////////////////////////////////////////////////////////////////
///TFtdcNewsUrgencyType是一个紧急程度类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNewsUrgencyType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAbstractType是一个消息摘要类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAbstractType[81];
/////////////////////////////////////////////////////////////////////////
///TFtdcComeFromType是一个消息来源类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcComeFromType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcURLLinkType是一个WEB地址类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcURLLinkType[201];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongIndividualNameType是一个长个人姓名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongIndividualNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcLongFBEBankAccountNameType是一个长换汇银行账户名类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcLongFBEBankAccountNameType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcDateTimeType是一个日期时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcDateTimeType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcWeakPasswordSourceType是一个弱密码来源类型
/////////////////////////////////////////////////////////////////////////
///弱密码库
#define THOST_FTDC_WPSR_Lib '1'
///手工录入
#define THOST_FTDC_WPSR_Manual '2'
typedef char TThostFtdcWeakPasswordSourceType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRandomStringType是一个随机串类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRandomStringType[17];
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderMemoType是一个报单回显字段类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOrderMemoType[13];
/////////////////////////////////////////////////////////////////////////
///TFtdcOptSelfCloseFlagType是一个期权行权的头寸是否自对冲类型
/////////////////////////////////////////////////////////////////////////
///自对冲期权仓位
#define THOST_FTDC_OSCF_CloseSelfOptionPosition '1'
///保留期权仓位
#define THOST_FTDC_OSCF_ReserveOptionPosition '2'
///自对冲卖方履约后的期货仓位
#define THOST_FTDC_OSCF_SellCloseSelfFuturePosition '3'
///保留卖方履约后的期货仓位
#define THOST_FTDC_OSCF_ReserveFuturePosition '4'
typedef char TThostFtdcOptSelfCloseFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcBizTypeType是一个业务类型类型
/////////////////////////////////////////////////////////////////////////
///期货
#define THOST_FTDC_BZTP_Future '1'
///证券
#define THOST_FTDC_BZTP_Stock '2'
typedef char TThostFtdcBizTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAppTypeType是一个用户App类型类型
/////////////////////////////////////////////////////////////////////////
///直连的投资者
#define THOST_FTDC_APP_TYPE_Investor '1'
///为每个投资者都创建连接的中继
#define THOST_FTDC_APP_TYPE_InvestorRelay '2'
///所有投资者共享一个操作员连接的中继
#define THOST_FTDC_APP_TYPE_OperatorRelay '3'
///未知
#define THOST_FTDC_APP_TYPE_UnKnown '4'
typedef char TThostFtdcAppTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAppIDType是一个App代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAppIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSystemInfoLenType是一个系统信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSystemInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdditionalInfoLenType是一个补充信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcAdditionalInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClientSystemInfoType是一个交易终端系统信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcClientSystemInfoType[273];
/////////////////////////////////////////////////////////////////////////
///TFtdcAdditionalInfoType是一个系统外部信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAdditionalInfoType[261];
/////////////////////////////////////////////////////////////////////////
///TFtdcBase64ClientSystemInfoType是一个base64交易终端系统信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBase64ClientSystemInfoType[365];
/////////////////////////////////////////////////////////////////////////
///TFtdcBase64AdditionalInfoType是一个base64系统外部信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcBase64AdditionalInfoType[349];
/////////////////////////////////////////////////////////////////////////
///TFtdcCurrentAuthMethodType是一个当前可用的认证模式,0代表无需认证模式 A从低位开始最后一位代表图片验证码,倒数第二位代表动态口令,倒数第三位代表短信验证码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCurrentAuthMethodType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCaptchaInfoLenType是一个图片验证信息长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCaptchaInfoLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCaptchaInfoType是一个图片验证信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCaptchaInfoType[2561];
/////////////////////////////////////////////////////////////////////////
///TFtdcUserTextSeqType是一个用户短信验证码的编号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcUserTextSeqType;
/////////////////////////////////////////////////////////////////////////
///TFtdcHandshakeDataType是一个握手数据内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcHandshakeDataType[301];
/////////////////////////////////////////////////////////////////////////
///TFtdcHandshakeDataLenType是一个握手数据内容长度类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcHandshakeDataLenType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCryptoKeyVersionType是一个api与front通信密钥版本号类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCryptoKeyVersionType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcRsaKeyVersionType是一个公钥版本号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRsaKeyVersionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSoftwareProviderIDType是一个交易软件商ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSoftwareProviderIDType[22];
/////////////////////////////////////////////////////////////////////////
///TFtdcCollectTimeType是一个信息采集时间类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCollectTimeType[21];
/////////////////////////////////////////////////////////////////////////
///TFtdcQueryFreqType是一个查询频率类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcQueryFreqType;
/////////////////////////////////////////////////////////////////////////
///TFtdcResponseValueType是一个应答类型类型
/////////////////////////////////////////////////////////////////////////
///检查成功
#define THOST_FTDC_RV_Right '0'
///检查失败
#define THOST_FTDC_RV_Refuse '1'
typedef char TThostFtdcResponseValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTCTradeTypeType是一个OTC成交类型类型
/////////////////////////////////////////////////////////////////////////
///大宗交易
#define THOST_FTDC_OTC_TRDT_Block '0'
///期转现
#define THOST_FTDC_OTC_TRDT_EFP '1'
typedef char TThostFtdcOTCTradeTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcMatchTypeType是一个期现风险匹配方式类型
/////////////////////////////////////////////////////////////////////////
///基点价值
#define THOST_FTDC_OTC_MT_DV01 '1'
///面值
#define THOST_FTDC_OTC_MT_ParValue '2'
typedef char TThostFtdcMatchTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOTCTraderIDType是一个OTC交易员代码类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcOTCTraderIDType[31];
/////////////////////////////////////////////////////////////////////////
///TFtdcRiskValueType是一个期货风险值类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcRiskValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcIDBNameType是一个握手数据内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIDBNameType[100];
/////////////////////////////////////////////////////////////////////////
///TFtdcDiscountRatioType是一个折扣率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcDiscountRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAuthTypeType是一个用户终端认证方式类型
/////////////////////////////////////////////////////////////////////////
///白名单校验
#define THOST_FTDC_AU_WHITE '0'
///黑名单校验
#define THOST_FTDC_AU_BLACK '1'
typedef char TThostFtdcAuthTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcClassTypeType是一个合约分类方式类型
/////////////////////////////////////////////////////////////////////////
///所有合约
#define THOST_FTDC_INS_ALL '0'
///期货、即期、期转现、Tas、金属指数合约
#define THOST_FTDC_INS_FUTURE '1'
///期货、现货期权合约
#define THOST_FTDC_INS_OPTION '2'
///组合合约
#define THOST_FTDC_INS_COMB '3'
typedef char TThostFtdcClassTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTradingTypeType是一个合约交易状态分类方式类型
/////////////////////////////////////////////////////////////////////////
///所有状态
#define THOST_FTDC_TD_ALL '0'
///交易
#define THOST_FTDC_TD_TRADE '1'
///非交易
#define THOST_FTDC_TD_UNTRADE '2'
typedef char TThostFtdcTradingTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductStatusType是一个产品状态类型
/////////////////////////////////////////////////////////////////////////
///可交易
#define THOST_FTDC_PS_tradeable '1'
///不可交易
#define THOST_FTDC_PS_untradeable '2'
typedef char TThostFtdcProductStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDeltaStatusType是一个追平状态类型
/////////////////////////////////////////////////////////////////////////
///交易可读
#define THOST_FTDC_SDS_Readable '1'
///交易在读
#define THOST_FTDC_SDS_Reading '2'
///交易读取完成
#define THOST_FTDC_SDS_Readend '3'
///追平失败 交易本地状态结算不存在
#define THOST_FTDC_SDS_OptErr 'e'
typedef char TThostFtdcSyncDeltaStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcActionDirectionType是一个操作标志类型
/////////////////////////////////////////////////////////////////////////
///增加
#define THOST_FTDC_ACD_Add '1'
///删除
#define THOST_FTDC_ACD_Del '2'
///更新
#define THOST_FTDC_ACD_Upd '3'
typedef char TThostFtdcActionDirectionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderCancelAlgType是一个撤单时选择席位算法类型
/////////////////////////////////////////////////////////////////////////
///轮询席位撤单
#define THOST_FTDC_OAC_Balance '1'
///优先原报单席位撤单
#define THOST_FTDC_OAC_OrigFirst '2'
typedef char TThostFtdcOrderCancelAlgType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSyncDescriptionType是一个追平描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSyncDescriptionType[257];
/////////////////////////////////////////////////////////////////////////
///TFtdcCommonIntType是一个通用int类型类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommonIntType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSysVersionType是一个系统版本类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSysVersionType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcOpenLimitControlLevelType是一个开仓量限制粒度类型
/////////////////////////////////////////////////////////////////////////
///不控制
#define THOST_FTDC_PLCL_None '0'
///产品级别
#define THOST_FTDC_PLCL_Product '1'
///合约级别
#define THOST_FTDC_PLCL_Inst '2'
typedef char TThostFtdcOpenLimitControlLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOrderFreqControlLevelType是一个报单频率控制粒度类型
/////////////////////////////////////////////////////////////////////////
///不控制
#define THOST_FTDC_OFCL_None '0'
///产品级别
#define THOST_FTDC_OFCL_Product '1'
///合约级别
#define THOST_FTDC_OFCL_Inst '2'
typedef char TThostFtdcOrderFreqControlLevelType;
/////////////////////////////////////////////////////////////////////////
///TFtdcEnumBoolType是一个枚举bool类型类型
/////////////////////////////////////////////////////////////////////////
///false
#define THOST_FTDC_EBL_False '0'
///true
#define THOST_FTDC_EBL_True '1'
typedef char TThostFtdcEnumBoolType;
/////////////////////////////////////////////////////////////////////////
///TFtdcTimeRangeType是一个期货合约阶段标识类型
/////////////////////////////////////////////////////////////////////////
///一般月份
#define THOST_FTDC_ETR_USUAL '1'
///交割月前一个月上半月
#define THOST_FTDC_ETR_FNSP '2'
///交割月前一个月下半月
#define THOST_FTDC_ETR_BNSP '3'
///交割月份
#define THOST_FTDC_ETR_SPOT '4'
typedef char TThostFtdcTimeRangeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcDeltaType是一个Delta类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcDeltaType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSpreadIdType是一个抵扣组优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcSpreadIdType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfolioType是一个新型组保算法类型
/////////////////////////////////////////////////////////////////////////
///不使用新型组保算法
#define THOST_FTDC_EPF_None '0'
///SPBM算法
#define THOST_FTDC_EPF_SPBM '1'
///RULE算法
#define THOST_FTDC_EPF_RULE '2'
///SPMM算法
#define THOST_FTDC_EPF_SPMM '3'
///RCAMS算法
#define THOST_FTDC_EPF_RCAMS '4'
typedef char TThostFtdcPortfolioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfolioDefIDType是一个SPBM组合套餐ID类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPortfolioDefIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamIDType是一个可提参数代码类型
/////////////////////////////////////////////////////////////////////////
///权利金收支是否可提 1 代表可提 0 不可提
#define THOST_FTDC_WDPID_CashIn 'C'
typedef char TThostFtdcWithDrawParamIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamValueType是一个可提控制参数内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWithDrawParamValueType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInvstTradingRightType是一个投资者交易权限类型
/////////////////////////////////////////////////////////////////////////
///只能平仓
#define THOST_FTDC_ITR_CloseOnly '1'
///不能交易
#define THOST_FTDC_ITR_Forbidden '2'
typedef char TThostFtdcInvstTradingRightType;
/////////////////////////////////////////////////////////////////////////
///TFtdcThostFunctionCodeType是一个Thost终端功能代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcThostFunctionCodeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMDiscountRatioType是一个SPMM折扣率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSPMMDiscountRatioType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelDescType是一个SPMM模板描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelDescType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelIDType是一个SPMM模板ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelIDType[33];
/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMProductIDType是一个SPMM商品群商品组ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMProductIDType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcInstMarginCalIDType是一个SPMM合约保证金算法类型
/////////////////////////////////////////////////////////////////////////
///标准算法收取双边
#define THOST_FTDC_IMID_BothSide '1'
///单向大边
#define THOST_FTDC_IMID_MMSA '2'
///新组保SPMM
#define THOST_FTDC_IMID_SPMM '3'
typedef char TThostFtdcInstMarginCalIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProductIDType是一个产品ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductIDType[41];
/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeRateType是一个HedgeRate类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcHedgeRateType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRCAMSPriorityType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAdjustValueType是一个空头期权风险调整标准类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAdjustValueType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSCombinationTypeType是一个RCAMS组合类型类型
/////////////////////////////////////////////////////////////////////////
///牛市看涨价差组合
#define THOST_FTDC_ERComb_BUC '0'
///熊市看涨价差组合
#define THOST_FTDC_ERComb_BEC '1'
///熊市看跌价差组合
#define THOST_FTDC_ERComb_BEP '2'
///牛市看跌价差组合
#define THOST_FTDC_ERComb_BUP '3'
///日历价差组合
#define THOST_FTDC_ERComb_CAS '4'
typedef char TThostFtdcRCAMSCombinationTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcRuleIdType是一个策略id类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRuleIdType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcPortfTypeType是一个新组保算法启用类型类型
/////////////////////////////////////////////////////////////////////////
///使用初版交易所算法
#define THOST_FTDC_EET_None '0'
///SPBM算法V1.1.0_附加保证金调整
#define THOST_FTDC_EET_SPBM_AddOnHedge '1'
typedef char TThostFtdcPortfTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentClassType是一个合约类型类型
/////////////////////////////////////////////////////////////////////////
///一般月份合约
#define THOST_FTDC_EIC_Usual '1'
///临近交割合约
#define THOST_FTDC_EIC_Delivery '2'
///非组合合约
#define THOST_FTDC_EIC_NonComb '3'
typedef char TThostFtdcInstrumentClassType;
/////////////////////////////////////////////////////////////////////////
///TFtdcCommodityGroupIDType是一个商品群号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommodityGroupIDType;
/////////////////////////////////////////////////////////////////////////
///TFtdcStdPositionType是一个标准持仓类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcStdPositionType;
/////////////////////////////////////////////////////////////////////////
///TFtdcProdChangeFlagType是一个品种记录改变状态类型
/////////////////////////////////////////////////////////////////////////
///持仓量和冻结量均无变化
#define THOST_FTDC_PCF_None '0'
///持仓量无变化,冻结量有变化
#define THOST_FTDC_PCF_OnlyFrozen '1'
///持仓量有变化
#define THOST_FTDC_PCF_PositionChange '2'
typedef char TThostFtdcProdChangeFlagType;
/////////////////////////////////////////////////////////////////////////
///TFtdcPwdRcdSrcType是一个历史密码来源类型
/////////////////////////////////////////////////////////////////////////
///来源于Sync初始化数据
#define THOST_FTDC_PRS_Init '0'
///来源于实时上场数据
#define THOST_FTDC_PRS_Sync '1'
///来源于用户修改
#define THOST_FTDC_PRS_UserUpd '2'
///来源于超户修改,很可能来自主席同步数据
#define THOST_FTDC_PRS_SuperUserUpd '3'
///来源于次席同步的修改
#define THOST_FTDC_PRS_SecUpd '4'
typedef char TThostFtdcPwdRcdSrcType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrSrvModeType是一个地址服务类型类型
/////////////////////////////////////////////////////////////////////////
///交易地址
#define THOST_FTDC_ASM_Trade '0'
///行情地址
#define THOST_FTDC_ASM_MarketData '1'
///其他
#define THOST_FTDC_ASM_Other '2'
typedef char TThostFtdcAddrSrvModeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrVerType是一个地址版本类型
/////////////////////////////////////////////////////////////////////////
///IPV4
#define THOST_FTDC_ADV_V4 '0'
///IPV6
#define THOST_FTDC_ADV_V6 '1'
typedef char TThostFtdcAddrVerType;
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrRemarkType是一个地址备注类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddrRemarkType[161];
/////////////////////////////////////////////////////////////////////////
///TFtdcAddrNameType是一个地址名称类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcAddrNameType[65];
/////////////////////////////////////////////////////////////////////////
///TFtdcIpAddrType是一个服务地址IP类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcIpAddrType[129];
/////////////////////////////////////////////////////////////////////////
///TFtdcTGSessionQryStatusType是一个TGATE会话查询状态类型
/////////////////////////////////////////////////////////////////////////
///查询状态空闲
#define THOST_FTDC_TGQS_QryIdle '1'
///查询状态频繁
#define THOST_FTDC_TGQS_QryBusy '2'
typedef char TThostFtdcTGSessionQryStatusType;
/////////////////////////////////////////////////////////////////////////
///TFtdcOffsetTypeType是一个对冲类型类型
/////////////////////////////////////////////////////////////////////////
///期权对冲
#define THOST_FTDC_OT_OPT_OFFSET '0'
///期货对冲
#define THOST_FTDC_OT_FUT_OFFSET '1'
///行权后期货对冲
#define THOST_FTDC_OT_EXEC_OFFSET '2'
///履约后期货对冲
#define THOST_FTDC_OT_PERFORM_OFFSET '3'
typedef char TThostFtdcOffsetTypeType;
/////////////////////////////////////////////////////////////////////////
///TFtdcSiteType是一个站点类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSiteType[51];
/////////////////////////////////////////////////////////////////////////
///TFtdcNetOperatorType是一个网络运营商类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcNetOperatorType[9];
/////////////////////////////////////////////////////////////////////////
///TFtdcApplySrcType是一个申请来源类型
/////////////////////////////////////////////////////////////////////////
///交易
#define THOST_FTDC_AS_Trade '0'
///会服
#define THOST_FTDC_AS_Member '1'
typedef char TThostFtdcApplySrcType;
/////////////////////////////////////////////////////////////////////////
///TFtdcReserveInfoType是一个预留信息类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcReserveInfoType[65];
#endif
================================================
FILE: native/ctp_bridge/api/win/ThostFtdcUserApiStruct.h
================================================
/////////////////////////////////////////////////////////////////////////
///@system 新一代交易所系统
///@company 上海期货信息技术有限公司
///@file ThostFtdcUserApiStruct.h
///@brief 定义了客户端接口使用的业务数据结构
///@history
///20060106 赵鸿昊 创建该文件
/////////////////////////////////////////////////////////////////////////
#if !defined(THOST_FTDCSTRUCT_H)
#define THOST_FTDCSTRUCT_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ThostFtdcUserApiDataType.h"
///信息分发
struct CThostFtdcDisseminationField
{
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///序列号
TThostFtdcSequenceNoType SequenceNo;
};
///用户登录请求
struct CThostFtdcReqUserLoginField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户登录应答
struct CThostFtdcRspUserLoginField
{
///交易日
TThostFtdcDateType TradingDay;
///登录成功时间
TThostFtdcTimeType LoginTime;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易系统名称
TThostFtdcSystemNameType SystemName;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///能源中心时间
TThostFtdcTimeType INETime;
///后台版本信息
TThostFtdcSysVersionType SysVersion;
///广期所时间
TThostFtdcTimeType GFEXTime;
///当前登录中心号
TThostFtdcDRIdentityIDType LoginDRIdentityID;
///用户所属中心号
TThostFtdcDRIdentityIDType UserDRIdentityID;
///上次登陆时间
TThostFtdcDateTimeType LastLoginTime;
///预留信息
TThostFtdcReserveInfoType ReserveInfo;
};
///用户登出请求
struct CThostFtdcUserLogoutField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///强制交易员退出
struct CThostFtdcForceUserLogoutField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///客户端认证请求
struct CThostFtdcReqAuthenticateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///认证码
TThostFtdcAuthCodeType AuthCode;
///App代码
TThostFtdcAppIDType AppID;
};
///客户端认证响应
struct CThostFtdcRspAuthenticateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///App代码
TThostFtdcAppIDType AppID;
///App类型
TThostFtdcAppTypeType AppType;
};
///客户端认证信息
struct CThostFtdcAuthenticationInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///认证信息
TThostFtdcAuthInfoType AuthInfo;
///是否为认证结果
TThostFtdcBoolType IsResult;
///App代码
TThostFtdcAppIDType AppID;
///App类型
TThostFtdcAppTypeType AppType;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户登录应答2
struct CThostFtdcRspUserLogin2Field
{
///交易日
TThostFtdcDateType TradingDay;
///登录成功时间
TThostFtdcTimeType LoginTime;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易系统名称
TThostFtdcSystemNameType SystemName;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///能源中心时间
TThostFtdcTimeType INETime;
///随机串
TThostFtdcRandomStringType RandomString;
};
///银期转帐报文头
struct CThostFtdcTransferHeaderField
{
///版本号,常量,1.0
TThostFtdcVersionType Version;
///交易代码,必填
TThostFtdcTradeCodeType TradeCode;
///交易日期,必填,格式:yyyymmdd
TThostFtdcTradeDateType TradeDate;
///交易时间,必填,格式:hhmmss
TThostFtdcTradeTimeType TradeTime;
///发起方流水号,N/A
TThostFtdcTradeSerialType TradeSerial;
///期货公司代码,必填
TThostFtdcFutureIDType FutureID;
///银行代码,根据查询银行得到,必填
TThostFtdcBankIDType BankID;
///银行分中心代码,根据查询银行得到,必填
TThostFtdcBankBrchIDType BankBrchID;
///操作员,N/A
TThostFtdcOperNoType OperNo;
///交易设备类型,N/A
TThostFtdcDeviceIDType DeviceID;
///记录数,N/A
TThostFtdcRecordNumType RecordNum;
///会话编号,N/A
TThostFtdcSessionIDType SessionID;
///请求编号,N/A
TThostFtdcRequestIDType RequestID;
};
///银行资金转期货请求,TradeCode=202001
struct CThostFtdcTransferBankToFutureReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///转账金额
TThostFtdcMoneyType TradeAmt;
///客户手续费
TThostFtdcMoneyType CustFee;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///银行资金转期货请求响应
struct CThostFtdcTransferBankToFutureRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///转帐金额
TThostFtdcMoneyType TradeAmt;
///应收客户手续费
TThostFtdcMoneyType CustFee;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///期货资金转银行请求,TradeCode=202002
struct CThostFtdcTransferFutureToBankReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///转账金额
TThostFtdcMoneyType TradeAmt;
///客户手续费
TThostFtdcMoneyType CustFee;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///期货资金转银行请求响应
struct CThostFtdcTransferFutureToBankRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///转帐金额
TThostFtdcMoneyType TradeAmt;
///应收客户手续费
TThostFtdcMoneyType CustFee;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行资金请求,TradeCode=204002
struct CThostFtdcTransferQryBankReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
///密码标志
TThostFtdcFuturePwdFlagType FuturePwdFlag;
///密码
TThostFtdcFutureAccPwdType FutureAccPwd;
///币种:RMB-人民币 USD-美圆 HKD-港元
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行资金请求响应
struct CThostFtdcTransferQryBankRspField
{
///响应代码
TThostFtdcRetCodeType RetCode;
///响应信息
TThostFtdcRetInfoType RetInfo;
///资金账户
TThostFtdcAccountIDType FutureAccount;
///银行余额
TThostFtdcMoneyType TradeAmt;
///银行可用余额
TThostFtdcMoneyType UseAmt;
///银行可取余额
TThostFtdcMoneyType FetchAmt;
///币种
TThostFtdcCurrencyCodeType CurrencyCode;
};
///查询银行交易明细请求,TradeCode=204999
struct CThostFtdcTransferQryDetailReqField
{
///期货资金账户
TThostFtdcAccountIDType FutureAccount;
};
///查询银行交易明细请求响应
struct CThostFtdcTransferQryDetailRspField
{
///交易日期
TThostFtdcDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///交易代码
TThostFtdcTradeCodeType TradeCode;
///期货流水号
TThostFtdcTradeSerialNoType FutureSerial;
///期货公司代码
TThostFtdcFutureIDType FutureID;
///资金帐号
TThostFtdcFutureAccountType FutureAccount;
///银行流水号
TThostFtdcTradeSerialNoType BankSerial;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行账号
TThostFtdcBankAccountType BankAccount;
///证件号码
TThostFtdcCertCodeType CertCode;
///货币代码
TThostFtdcCurrencyCodeType CurrencyCode;
///发生金额
TThostFtdcMoneyType TxAmount;
///有效标志
TThostFtdcTransferValidFlagType Flag;
};
///响应信息
struct CThostFtdcRspInfoField
{
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易所
struct CThostFtdcExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所名称
TThostFtdcExchangeNameType ExchangeName;
///交易所属性
TThostFtdcExchangePropertyType ExchangeProperty;
};
///产品
struct CThostFtdcProductField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///产品名称
TThostFtdcProductNameType ProductName;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品类型
TThostFtdcProductClassType ProductClass;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///市价单最大下单量
TThostFtdcVolumeType MaxMarketOrderVolume;
///市价单最小下单量
TThostFtdcVolumeType MinMarketOrderVolume;
///限价单最大下单量
TThostFtdcVolumeType MaxLimitOrderVolume;
///限价单最小下单量
TThostFtdcVolumeType MinLimitOrderVolume;
///持仓类型
TThostFtdcPositionTypeType PositionType;
///持仓日期类型
TThostFtdcPositionDateTypeType PositionDateType;
///平仓处理类型
TThostFtdcCloseDealTypeType CloseDealType;
///交易币种类型
TThostFtdcCurrencyIDType TradeCurrencyID;
///质押资金可用范围
TThostFtdcMortgageFundUseRangeType MortgageFundUseRange;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///合约基础商品乘数
TThostFtdcUnderlyingMultipleType UnderlyingMultiple;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///交易所产品代码
TThostFtdcInstrumentIDType ExchangeProductID;
///开仓量限制粒度
TThostFtdcOpenLimitControlLevelType OpenLimitControlLevel;
///报单频率控制粒度
TThostFtdcOrderFreqControlLevelType OrderFreqControlLevel;
};
///合约
struct CThostFtdcInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约名称
TThostFtdcInstrumentNameType InstrumentName;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve3;
///产品类型
TThostFtdcProductClassType ProductClass;
///交割年份
TThostFtdcYearType DeliveryYear;
///交割月
TThostFtdcMonthType DeliveryMonth;
///市价单最大下单量
TThostFtdcVolumeType MaxMarketOrderVolume;
///市价单最小下单量
TThostFtdcVolumeType MinMarketOrderVolume;
///限价单最大下单量
TThostFtdcVolumeType MaxLimitOrderVolume;
///限价单最小下单量
TThostFtdcVolumeType MinLimitOrderVolume;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///创建日
TThostFtdcDateType CreateDate;
///上市日
TThostFtdcDateType OpenDate;
///到期日
TThostFtdcDateType ExpireDate;
///开始交割日
TThostFtdcDateType StartDelivDate;
///结束交割日
TThostFtdcDateType EndDelivDate;
///合约生命周期状态
TThostFtdcInstLifePhaseType InstLifePhase;
///当前是否交易
TThostFtdcBoolType IsTrading;
///持仓类型
TThostFtdcPositionTypeType PositionType;
///持仓日期类型
TThostFtdcPositionDateTypeType PositionDateType;
///多头保证金率
TThostFtdcRatioType LongMarginRatio;
///空头保证金率
TThostFtdcRatioType ShortMarginRatio;
///是否使用大额单边保证金算法
TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve4;
///执行价
TThostFtdcPriceType StrikePrice;
///期权类型
TThostFtdcOptionsTypeType OptionsType;
///合约基础商品乘数
TThostFtdcUnderlyingMultipleType UnderlyingMultiple;
///组合类型
TThostFtdcCombinationTypeType CombinationType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///基础商品代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
};
///经纪公司
struct CThostFtdcBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司简称
TThostFtdcBrokerAbbrType BrokerAbbr;
///经纪公司名称
TThostFtdcBrokerNameType BrokerName;
///是否活跃
TThostFtdcBoolType IsActive;
};
///交易所交易员
struct CThostFtdcTraderField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装数量
TThostFtdcInstallCountType InstallCount;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
///交易报盘安装数量
TThostFtdcInstallCountType TradeInstallCount;
///行情报盘安装数量
TThostFtdcInstallCountType MDInstallCount;
};
///投资者
struct CThostFtdcInvestorField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者名称
TThostFtdcPartyNameType InvestorName;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///是否活跃
TThostFtdcBoolType IsActive;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///开户日期
TThostFtdcDateType OpenDate;
///手机
TThostFtdcMobileType Mobile;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///是否频率控制
TThostFtdcEnumBoolType IsOrderFreq;
///是否开仓限制
TThostFtdcEnumBoolType IsOpenVolLimit;
};
///交易编码
struct CThostFtdcTradingCodeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///是否活跃
TThostFtdcBoolType IsActive;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
///营业部编号
TThostFtdcBranchIDType BranchID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///会员编码和经纪公司编码对照表
struct CThostFtdcPartBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///是否活跃
TThostFtdcBoolType IsActive;
};
///管理用户
struct CThostFtdcSuperUserField
{
///用户代码
TThostFtdcUserIDType UserID;
///用户名称
TThostFtdcUserNameType UserName;
///密码
TThostFtdcPasswordType Password;
///是否活跃
TThostFtdcBoolType IsActive;
};
///管理用户功能权限
struct CThostFtdcSuperUserFunctionField
{
///用户代码
TThostFtdcUserIDType UserID;
///功能代码
TThostFtdcFunctionCodeType FunctionCode;
};
///投资者组
struct CThostFtdcInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者分组名称
TThostFtdcInvestorGroupNameType InvestorGroupName;
};
///资金账户
struct CThostFtdcTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///业务类型
TThostFtdcBizTypeType BizType;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///投资者持仓
struct CThostFtdcInvestorPositionField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///合约保证金率
struct CThostFtdcInstrumentMarginRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///合约手续费率
struct CThostFtdcInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///深度行情
struct CThostFtdcDepthMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
///当日均价
TThostFtdcPriceType AveragePrice;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
};
///投资者合约交易权限
struct CThostFtdcInstrumentTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///经纪公司用户
struct CThostFtdcBrokerUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户名称
TThostFtdcUserNameType UserName;
///用户类型
TThostFtdcUserTypeType UserType;
///是否活跃
TThostFtdcBoolType IsActive;
///是否使用令牌
TThostFtdcBoolType IsUsingOTP;
///是否强制终端认证
TThostFtdcBoolType IsAuthForce;
};
///经纪公司用户口令
struct CThostFtdcBrokerUserPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///上次修改时间
TThostFtdcDateTimeType LastUpdateTime;
///上次登陆时间
TThostFtdcDateTimeType LastLoginTime;
///密码过期时间
TThostFtdcDateType ExpireDate;
///弱密码过期时间
TThostFtdcDateType WeakExpireDate;
};
///经纪公司用户功能权限
struct CThostFtdcBrokerUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///经纪公司功能代码
TThostFtdcBrokerFunctionCodeType BrokerFunctionCode;
};
///交易所交易员报盘机
struct CThostFtdcTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所交易员连接状态
TThostFtdcTraderConnectStatusType TraderConnectStatus;
///发出连接请求的日期
TThostFtdcDateType ConnectRequestDate;
///发出连接请求的时间
TThostFtdcTimeType ConnectRequestTime;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///完成连接日期
TThostFtdcDateType ConnectDate;
///完成连接时间
TThostFtdcTimeType ConnectTime;
///启动日期
TThostFtdcDateType StartDate;
///启动时间
TThostFtdcTimeType StartTime;
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///本席位最大成交编号
TThostFtdcTradeIDType MaxTradeID;
///本席位最大报单备拷
TThostFtdcReturnCodeType MaxOrderMessageReference;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
};
///投资者结算结果
struct CThostFtdcSettlementInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///消息正文
TThostFtdcContentType Content;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///合约保证金率调整
struct CThostFtdcInstrumentMarginRateAdjustField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所保证金率
struct CThostFtdcExchangeMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所保证金率调整
struct CThostFtdcExchangeMarginRateAdjustField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///跟随交易所投资者多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///跟随交易所投资者多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///跟随交易所投资者空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///跟随交易所投资者空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///交易所多头保证金率
TThostFtdcRatioType ExchLongMarginRatioByMoney;
///交易所多头保证金费
TThostFtdcMoneyType ExchLongMarginRatioByVolume;
///交易所空头保证金率
TThostFtdcRatioType ExchShortMarginRatioByMoney;
///交易所空头保证金费
TThostFtdcMoneyType ExchShortMarginRatioByVolume;
///不跟随交易所投资者多头保证金率
TThostFtdcRatioType NoLongMarginRatioByMoney;
///不跟随交易所投资者多头保证金费
TThostFtdcMoneyType NoLongMarginRatioByVolume;
///不跟随交易所投资者空头保证金率
TThostFtdcRatioType NoShortMarginRatioByMoney;
///不跟随交易所投资者空头保证金费
TThostFtdcMoneyType NoShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///汇率
struct CThostFtdcExchangeRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源币种单位数量
TThostFtdcCurrencyUnitType FromCurrencyUnit;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
};
///结算引用
struct CThostFtdcSettlementRefField
{
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
};
///当前时间
struct CThostFtdcCurrentTimeField
{
///当前交易日
TThostFtdcDateType CurrDate;
///当前时间
TThostFtdcTimeType CurrTime;
///当前时间(毫秒)
TThostFtdcMillisecType CurrMillisec;
///自然日期
TThostFtdcDateType ActionDay;
};
///通讯阶段
struct CThostFtdcCommPhaseField
{
///交易日
TThostFtdcDateType TradingDay;
///通讯时段编号
TThostFtdcCommPhaseNoType CommPhaseNo;
///系统编号
TThostFtdcSystemIDType SystemID;
};
///登录信息
struct CThostFtdcLoginInfoField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录日期
TThostFtdcDateType LoginDate;
///登录时间
TThostFtdcTimeType LoginTime;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///系统名称
TThostFtdcSystemNameType SystemName;
///密码,已弃用
TThostFtdcPasswordType PasswordDeprecated;
///最大报单引用
TThostFtdcOrderRefType MaxOrderRef;
///上期所时间
TThostFtdcTimeType SHFETime;
///大商所时间
TThostFtdcTimeType DCETime;
///郑商所时间
TThostFtdcTimeType CZCETime;
///中金所时间
TThostFtdcTimeType FFEXTime;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///能源中心时间
TThostFtdcTimeType INETime;
///查询时是否需要流控
TThostFtdcBoolType IsQryControl;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///密码
TThostFtdcPasswordType Password;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///登录信息
struct CThostFtdcLogoutAllField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///系统名称
TThostFtdcSystemNameType SystemName;
};
///前置状态
struct CThostFtdcFrontStatusField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///是否活跃
TThostFtdcBoolType IsActive;
};
///用户口令变更
struct CThostFtdcUserPasswordUpdateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
};
///输入报单
struct CThostFtdcInputOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报单
struct CThostFtdcOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///相关报单
TThostFtdcOrderSysIDType RelativeOrderSysID;
///郑商所成交数量
TThostFtdcVolumeType ZCETotalTradedVolume;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///交易所报单
struct CThostFtdcExchangeOrderField
{
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报单插入失败
struct CThostFtdcExchangeOrderInsertErrorField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///输入报单操作
struct CThostFtdcInputOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报单操作
struct CThostFtdcOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///交易所报单操作
struct CThostFtdcExchangeOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报单操作失败
struct CThostFtdcExchangeOrderActionErrorField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易所成交
struct CThostFtdcExchangeTradeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///买卖方向
TThostFtdcDirectionType Direction;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易角色
TThostFtdcTradingRoleType TradingRole;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///价格
TThostFtdcPriceType Price;
///数量
TThostFtdcVolumeType Volume;
///成交时期
TThostFtdcDateType TradeDate;
///成交时间
TThostFtdcTimeType TradeTime;
///成交类型
TThostFtdcTradeTypeType TradeType;
///成交价来源
TThostFtdcPriceSourceType PriceSource;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///序号
TThostFtdcSequenceNoType SequenceNo;
///成交来源
TThostFtdcTradeSourceType TradeSource;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///成交
struct CThostFtdcTradeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///买卖方向
TThostFtdcDirectionType Direction;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易角色
TThostFtdcTradingRoleType TradingRole;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///价格
TThostFtdcPriceType Price;
///数量
TThostFtdcVolumeType Volume;
///成交时期
TThostFtdcDateType TradeDate;
///成交时间
TThostFtdcTimeType TradeTime;
///成交类型
TThostFtdcTradeTypeType TradeType;
///成交价来源
TThostFtdcPriceSourceType PriceSource;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///序号
TThostFtdcSequenceNoType SequenceNo;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///成交来源
TThostFtdcTradeSourceType TradeSource;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///用户会话
struct CThostFtdcUserSessionField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录日期
TThostFtdcDateType LoginDate;
///登录时间
TThostFtdcTimeType LoginTime;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询最大报单数量
struct CThostFtdcQryMaxOrderVolumeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///最大允许报单数量
TThostFtdcVolumeType MaxVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///投资者结算结果确认信息
struct CThostFtdcSettlementInfoConfirmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///确认日期
TThostFtdcDateType ConfirmDate;
///确认时间
TThostFtdcTimeType ConfirmTime;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///出入金同步
struct CThostFtdcSyncDepositField
{
///出入金流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///入金金额
TThostFtdcMoneyType Deposit;
///是否强制进行
TThostFtdcBoolType IsForce;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///是否是个股期权内转
TThostFtdcBoolType IsFromSopt;
///资金密码
TThostFtdcPasswordType TradingPassword;
///是否二级代理商的内转
TThostFtdcBoolType IsSecAgentTranfer;
};
///货币质押同步
struct CThostFtdcSyncFundMortgageField
{
///货币质押流水号
TThostFtdcDepositSeqNoType MortgageSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///质押金额
TThostFtdcMoneyType MortgageAmount;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
};
///经纪公司同步
struct CThostFtdcBrokerSyncField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///正在同步中的投资者
struct CThostFtdcSyncingInvestorField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者名称
TThostFtdcPartyNameType InvestorName;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///是否活跃
TThostFtdcBoolType IsActive;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///开户日期
TThostFtdcDateType OpenDate;
///手机
TThostFtdcMobileType Mobile;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///是否频率控制
TThostFtdcEnumBoolType IsOrderFreq;
///是否开仓限制
TThostFtdcEnumBoolType IsOpenVolLimit;
};
///正在同步中的交易代码
struct CThostFtdcSyncingTradingCodeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///是否活跃
TThostFtdcBoolType IsActive;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
};
///正在同步中的投资者分组
struct CThostFtdcSyncingInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///投资者分组名称
TThostFtdcInvestorGroupNameType InvestorGroupName;
};
///正在同步中的交易账号
struct CThostFtdcSyncingTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
};
///正在同步中的投资者持仓
struct CThostFtdcSyncingInvestorPositionField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约保证金率
struct CThostFtdcSyncingInstrumentMarginRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约手续费率
struct CThostFtdcSyncingInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///正在同步中的合约交易权限
struct CThostFtdcSyncingInstrumentTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询报单
struct CThostFtdcQryOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询成交
struct CThostFtdcQryTradeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///成交编号
TThostFtdcTradeIDType TradeID;
///开始时间
TThostFtdcTimeType TradeTimeStart;
///结束时间
TThostFtdcTimeType TradeTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询投资者持仓
struct CThostFtdcQryInvestorPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询资金账户
struct CThostFtdcQryTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///业务类型
TThostFtdcBizTypeType BizType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///查询投资者
struct CThostFtdcQryInvestorField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询交易编码
struct CThostFtdcQryTradingCodeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易编码类型
TThostFtdcClientIDTypeType ClientIDType;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询投资者组
struct CThostFtdcQryInvestorGroupField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///查询合约保证金率
struct CThostFtdcQryInstrumentMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询手续费率
struct CThostFtdcQryInstrumentCommissionRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询合约交易权限
struct CThostFtdcQryInstrumentTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司
struct CThostFtdcQryBrokerField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///查询交易员
struct CThostFtdcQryTraderField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询管理用户功能权限
struct CThostFtdcQrySuperUserFunctionField
{
///用户代码
TThostFtdcUserIDType UserID;
};
///查询用户会话
struct CThostFtdcQryUserSessionField
{
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询经纪公司会员代码
struct CThostFtdcQryPartBrokerField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
};
///查询前置状态
struct CThostFtdcQryFrontStatusField
{
///前置编号
TThostFtdcFrontIDType FrontID;
};
///查询交易所报单
struct CThostFtdcQryExchangeOrderField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///查询报单操作
struct CThostFtdcQryOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///查询交易所报单操作
struct CThostFtdcQryExchangeOrderActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询管理用户
struct CThostFtdcQrySuperUserField
{
///用户代码
TThostFtdcUserIDType UserID;
};
///查询交易所
struct CThostFtdcQryExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///查询产品
struct CThostFtdcQryProductField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///产品类型
TThostFtdcProductClassType ProductClass;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询合约
struct CThostFtdcQryInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve3;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询行情
struct CThostFtdcQryDepthMarketDataField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///产品类型
TThostFtdcProductClassType ProductClass;
};
///查询经纪公司用户
struct CThostFtdcQryBrokerUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询经纪公司用户权限
struct CThostFtdcQryBrokerUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///查询交易员报盘机
struct CThostFtdcQryTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询出入金流水
struct CThostFtdcQrySyncDepositField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///出入金流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
};
///查询投资者结算结果
struct CThostFtdcQrySettlementInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易日
TThostFtdcDateType TradingDay;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询交易所保证金率
struct CThostFtdcQryExchangeMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询交易所调整保证金率
struct CThostFtdcQryExchangeMarginRateAdjustField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询汇率
struct CThostFtdcQryExchangeRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
};
///查询货币质押流水
struct CThostFtdcQrySyncFundMortgageField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///货币质押流水号
TThostFtdcDepositSeqNoType MortgageSeqNo;
};
///查询报单
struct CThostFtdcQryHisOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约最小保证金
struct CThostFtdcOptionInstrMiniMarginField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///单位(手)期权合约最小保证金
TThostFtdcMoneyType MinMargin;
///取值方式
TThostFtdcValueMethodType ValueMethod;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约保证金调整系数
struct CThostFtdcOptionInstrMarginAdjustField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约手续费的详细内容
struct CThostFtdcOptionInstrCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权交易成本
struct CThostFtdcOptionInstrTradeCostField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权合约保证金不变部分
TThostFtdcMoneyType FixedMargin;
///期权合约最小保证金
TThostFtdcMoneyType MiniMargin;
///期权合约权利金
TThostFtdcMoneyType Royalty;
///交易所期权合约保证金不变部分
TThostFtdcMoneyType ExchFixedMargin;
///交易所期权合约最小保证金
TThostFtdcMoneyType ExchMiniMargin;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权交易成本查询
struct CThostFtdcQryOptionInstrTradeCostField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权合约报价
TThostFtdcPriceType InputPrice;
///标的价格,填0则用昨结算价
TThostFtdcPriceType UnderlyingPrice;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权手续费率查询
struct CThostFtdcQryOptionInstrCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///股指现货指数
struct CThostFtdcIndexPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///指数现货收盘价
TThostFtdcPriceType ClosePrice;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的执行宣告
struct CThostFtdcInputExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入执行宣告操作
struct CThostFtdcInputExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告
struct CThostFtdcExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///执行宣告提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///执行结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerExecOrderSeq;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告操作
struct CThostFtdcExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///执行类型
TThostFtdcActionTypeType ActionType;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///执行宣告查询
struct CThostFtdcQryExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所执行宣告信息
struct CThostFtdcExchangeExecOrderField
{
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///执行宣告提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///执行宣告编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///执行结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所执行宣告查询
struct CThostFtdcQryExchangeExecOrderField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///执行宣告操作查询
struct CThostFtdcQryExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所执行宣告操作
struct CThostFtdcExchangeExecOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地执行宣告编号
TThostFtdcOrderLocalIDType ExecOrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///执行类型
TThostFtdcActionTypeType ActionType;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///数量
TThostFtdcVolumeType Volume;
///IP地址
TThostFtdcIPAddressType IPAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///交易所执行宣告操作查询
struct CThostFtdcQryExchangeExecOrderActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///错误执行宣告
struct CThostFtdcErrExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///执行类型
TThostFtdcActionTypeType ActionType;
///保留头寸申请的持仓方向
TThostFtdcPosiDirectionType PosiDirection;
///期权行权后是否保留期货头寸的标记,该字段已废弃
TThostFtdcExecOrderPositionFlagType ReservePositionFlag;
///期权行权后生成的头寸是否自动平仓
TThostFtdcExecOrderCloseFlagType CloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误执行宣告
struct CThostFtdcQryErrExecOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误执行宣告操作
struct CThostFtdcErrExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行宣告操作引用
TThostFtdcOrderActionRefType ExecOrderActionRef;
///执行宣告引用
TThostFtdcOrderRefType ExecOrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行宣告操作编号
TThostFtdcExecOrderSysIDType ExecOrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误执行宣告操作
struct CThostFtdcQryErrExecOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///投资者期权合约交易权限
struct CThostFtdcOptionInstrTradingRightField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///买卖方向
TThostFtdcDirectionType Direction;
///交易权限
TThostFtdcTradingRightType TradingRight;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询期权合约交易权限
struct CThostFtdcQryOptionInstrTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的询价
struct CThostFtdcInputForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价引用
TThostFtdcOrderRefType ForQuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///询价
struct CThostFtdcForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价引用
TThostFtdcOrderRefType ForQuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///本地询价编号
TThostFtdcOrderLocalIDType ForQuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///询价状态
TThostFtdcForQuoteStatusType ForQuoteStatus;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司询价编号
TThostFtdcSequenceNoType BrokerForQutoSeq;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///询价查询
struct CThostFtdcQryForQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所询价信息
struct CThostFtdcExchangeForQuoteField
{
///本地询价编号
TThostFtdcOrderLocalIDType ForQuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///询价状态
TThostFtdcForQuoteStatusType ForQuoteStatus;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所询价查询
struct CThostFtdcQryExchangeForQuoteField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///输入的报价
struct CThostFtdcInputQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///衍生卖报单引用
TThostFtdcOrderRefType AskOrderRef;
///衍生买报单引用
TThostFtdcOrderRefType BidOrderRef;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///被顶单编号
TThostFtdcOrderSysIDType ReplaceSysID;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///输入报价操作
struct CThostFtdcInputQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报价操作引用
TThostFtdcOrderActionRefType QuoteActionRef;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价
struct CThostFtdcQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///用户代码
TThostFtdcUserIDType UserID;
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报价提示序号
TThostFtdcSequenceNoType NotifySequence;
///报价提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///报价状态
TThostFtdcOrderStatusType QuoteStatus;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///卖方报单编号
TThostFtdcOrderSysIDType AskOrderSysID;
///买方报单编号
TThostFtdcOrderSysIDType BidOrderSysID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报价编号
TThostFtdcSequenceNoType BrokerQuoteSeq;
///衍生卖报单引用
TThostFtdcOrderRefType AskOrderRef;
///衍生买报单引用
TThostFtdcOrderRefType BidOrderRef;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///被顶单编号
TThostFtdcOrderSysIDType ReplaceSysID;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价操作
struct CThostFtdcQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报价操作引用
TThostFtdcOrderActionRefType QuoteActionRef;
///报价引用
TThostFtdcOrderRefType QuoteRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///报价查询
struct CThostFtdcQryQuoteField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所报价信息
struct CThostFtdcExchangeQuoteField
{
///卖价格
TThostFtdcPriceType AskPrice;
///买价格
TThostFtdcPriceType BidPrice;
///卖数量
TThostFtdcVolumeType AskVolume;
///买数量
TThostFtdcVolumeType BidVolume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///卖开平标志
TThostFtdcOffsetFlagType AskOffsetFlag;
///买开平标志
TThostFtdcOffsetFlagType BidOffsetFlag;
///卖投机套保标志
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报价提示序号
TThostFtdcSequenceNoType NotifySequence;
///报价提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报价编号
TThostFtdcOrderSysIDType QuoteSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///报价状态
TThostFtdcOrderStatusType QuoteStatus;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///卖方报单编号
TThostFtdcOrderSysIDType AskOrderSysID;
///买方报单编号
TThostFtdcOrderSysIDType BidOrderSysID;
///应价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
};
///交易所报价查询
struct CThostFtdcQryExchangeQuoteField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///报价操作查询
struct CThostFtdcQryQuoteActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所报价操作
struct CThostFtdcExchangeQuoteActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报价操作编号
TThostFtdcOrderSysIDType QuoteSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报价编号
TThostFtdcOrderLocalIDType QuoteLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所报价操作查询
struct CThostFtdcQryExchangeQuoteActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///期权合约delta值
struct CThostFtdcOptionInstrDeltaField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///Delta值
TThostFtdcRatioType Delta;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///发给做市商的询价请求
struct CThostFtdcForQuoteRspField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///询价编号
TThostFtdcOrderSysIDType ForQuoteSysID;
///询价时间
TThostFtdcTimeType ForQuoteTime;
///业务日期
TThostFtdcDateType ActionDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前期权合约执行偏移值的详细内容
struct CThostFtdcStrikeOffsetField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///执行偏移值
TThostFtdcMoneyType Offset;
///执行偏移类型
TThostFtdcStrikeOffsetTypeType OffsetType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期权执行偏移值查询
struct CThostFtdcQryStrikeOffsetField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入批量报单操作
struct CThostFtdcInputBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///用户代码
TThostFtdcUserIDType UserID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///批量报单操作
struct CThostFtdcBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所批量报单操作
struct CThostFtdcExchangeBatchOrderActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询批量报单操作
struct CThostFtdcQryBatchOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///组合合约安全系数
struct CThostFtdcCombInstrumentGuardField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///
TThostFtdcRatioType GuarantRatio;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///组合合约安全系数查询
struct CThostFtdcQryCombInstrumentGuardField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///输入的申请组合
struct CThostFtdcInputCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///组合引用
TThostFtdcOrderRefType CombActionRef;
///用户代码
TThostFtdcUserIDType UserID;
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///申请组合
struct CThostFtdcCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///组合引用
TThostFtdcOrderRefType CombActionRef;
///用户代码
TThostFtdcUserIDType UserID;
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///本地申请组合编号
TThostFtdcOrderLocalIDType ActionLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///组合状态
TThostFtdcOrderActionStatusType ActionStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///申请组合查询
struct CThostFtdcQryCombActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所申请组合信息
struct CThostFtdcExchangeCombActionField
{
///买卖方向
TThostFtdcDirectionType Direction;
///数量
TThostFtdcVolumeType Volume;
///组合指令方向
TThostFtdcCombDirectionType CombDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///本地申请组合编号
TThostFtdcOrderLocalIDType ActionLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///组合状态
TThostFtdcOrderActionStatusType ActionStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///交易所申请组合查询
struct CThostFtdcQryExchangeCombActionField
{
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///产品报价汇率
struct CThostFtdcProductExchRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报价币种类型
TThostFtdcCurrencyIDType QuoteCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///产品报价汇率查询
struct CThostFtdcQryProductExchRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///查询询价价差参数
struct CThostFtdcQryForQuoteParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///询价价差参数
struct CThostFtdcForQuoteParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///最新价
TThostFtdcPriceType LastPrice;
///价差
TThostFtdcPriceType PriceInterval;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前做市商期权合约手续费的详细内容
struct CThostFtdcMMOptionInstrCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///做市商期权手续费率查询
struct CThostFtdcQryMMOptionInstrCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///做市商合约手续费率
struct CThostFtdcMMInstrumentCommissionRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询做市商合约手续费率
struct CThostFtdcQryMMInstrumentCommissionRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///当前报单手续费的详细内容
struct CThostFtdcInstrumentOrderCommRateField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///报单手续费
TThostFtdcRatioType OrderCommByVolume;
///撤单手续费
TThostFtdcRatioType OrderActionCommByVolume;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///报单手续费
TThostFtdcRatioType OrderCommByTrade;
///撤单手续费
TThostFtdcRatioType OrderActionCommByTrade;
};
///报单手续费率查询
struct CThostFtdcQryInstrumentOrderCommRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易参数
struct CThostFtdcTradeParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///参数代码
TThostFtdcTradeParamIDType TradeParamID;
///参数代码值
TThostFtdcSettlementParamValueType TradeParamValue;
///备注
TThostFtdcMemoType Memo;
};
///合约保证金率调整
struct CThostFtdcInstrumentMarginRateULField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///期货持仓限制参数
struct CThostFtdcFutureLimitPosiParamField
{
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///当日投机开仓数量限制
TThostFtdcVolumeType SpecOpenVolume;
///当日套利开仓数量限制
TThostFtdcVolumeType ArbiOpenVolume;
///当日投机+套利开仓数量限制
TThostFtdcVolumeType OpenVolume;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///禁止登录IP
struct CThostFtdcLoginForbiddenIPField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///IP列表
struct CThostFtdcIPListField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///是否白名单
TThostFtdcBoolType IsWhite;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入的期权自对冲
struct CThostFtdcInputOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入期权自对冲操作
struct CThostFtdcInputOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期权自对冲操作引用
TThostFtdcOrderActionRefType OptionSelfCloseActionRef;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲
struct CThostFtdcOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///用户代码
TThostFtdcUserIDType UserID;
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///期权自对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///自对冲结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOptionSelfCloseSeq;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲操作
struct CThostFtdcOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期权自对冲操作引用
TThostFtdcOrderActionRefType OptionSelfCloseActionRef;
///期权自对冲引用
TThostFtdcOrderRefType OptionSelfCloseRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲查询
struct CThostFtdcQryOptionSelfCloseField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///开始时间
TThostFtdcTimeType InsertTimeStart;
///结束时间
TThostFtdcTimeType InsertTimeEnd;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///交易所期权自对冲信息
struct CThostFtdcExchangeOptionSelfCloseField
{
///数量
TThostFtdcVolumeType Volume;
///请求编号
TThostFtdcRequestIDType RequestID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///期权自对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///期权自对冲编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///自对冲结果
TThostFtdcExecResultType ExecResult;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///期权自对冲操作查询
struct CThostFtdcQryOptionSelfCloseActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所期权自对冲操作
struct CThostFtdcExchangeOptionSelfCloseActionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///期权自对冲操作编号
TThostFtdcOrderSysIDType OptionSelfCloseSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地期权自对冲编号
TThostFtdcOrderLocalIDType OptionSelfCloseLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///营业部编号
TThostFtdcBranchIDType BranchID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///期权行权的头寸是否自对冲
TThostFtdcOptSelfCloseFlagType OptSelfCloseFlag;
///IP地址
TThostFtdcIPAddressType IPAddress;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///延时换汇同步
struct CThostFtdcSyncDelaySwapField
{
///换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源金额
TThostFtdcMoneyType FromAmount;
///源换汇冻结金额(可用冻结)
TThostFtdcMoneyType FromFrozenSwap;
///源剩余换汇额度(可提冻结)
TThostFtdcMoneyType FromRemainSwap;
///目标币种
TThostFtdcCurrencyIDType ToCurrencyID;
///目标金额
TThostFtdcMoneyType ToAmount;
///是否手工换汇
TThostFtdcBoolType IsManualSwap;
///是否将所有外币的剩余换汇额度设置为0
TThostFtdcBoolType IsAllRemainSetZero;
};
///查询延时换汇同步
struct CThostFtdcQrySyncDelaySwapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///延时换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
};
///投资单元
struct CThostFtdcInvestUnitField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///投资者单元名称
TThostFtdcPartyNameType InvestorUnitName;
///投资者分组代码
TThostFtdcInvestorIDType InvestorGroupID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询投资单元
struct CThostFtdcQryInvestUnitField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///二级代理商资金校验模式
struct CThostFtdcSecAgentCheckModeField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
///是否需要校验自己的资金账户
TThostFtdcBoolType CheckSelfAccount;
};
///二级代理商信息
struct CThostFtdcSecAgentTradeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///二级代理商姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///市场行情
struct CThostFtdcMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///行情基础属性
struct CThostFtdcMarketDataBaseField
{
///交易日
TThostFtdcDateType TradingDay;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///昨虚实度
TThostFtdcRatioType PreDelta;
};
///行情静态属性
struct CThostFtdcMarketDataStaticField
{
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///今收盘
TThostFtdcPriceType ClosePrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///今虚实度
TThostFtdcRatioType CurrDelta;
};
///行情最新成交属性
struct CThostFtdcMarketDataLastMatchField
{
///最新价
TThostFtdcPriceType LastPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
};
///行情最优价属性
struct CThostFtdcMarketDataBestPriceField
{
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
};
///行情申买二、三属性
struct CThostFtdcMarketDataBid23Field
{
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
};
///行情申卖二、三属性
struct CThostFtdcMarketDataAsk23Field
{
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
};
///行情申买四、五属性
struct CThostFtdcMarketDataBid45Field
{
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
};
///行情申卖四、五属性
struct CThostFtdcMarketDataAsk45Field
{
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
};
///行情更新时间属性
struct CThostFtdcMarketDataUpdateTimeField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///业务日期
TThostFtdcDateType ActionDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///行情上下带价
struct CThostFtdcMarketDataBandingPriceField
{
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
};
///行情交易所代码属性
struct CThostFtdcMarketDataExchangeField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///指定的合约
struct CThostFtdcSpecificInstrumentField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///合约状态
struct CThostFtdcInstrumentStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///结算组代码
TThostFtdcSettlementGroupIDType SettlementGroupID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///合约交易状态
TThostFtdcInstrumentStatusType InstrumentStatus;
///交易阶段编号
TThostFtdcTradingSegmentSNType TradingSegmentSN;
///进入本状态时间
TThostFtdcTimeType EnterTime;
///进入本状态原因
TThostFtdcInstStatusEnterReasonType EnterReason;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询合约状态
struct CThostFtdcQryInstrumentStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve1;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
};
///投资者账户
struct CThostFtdcInvestorAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///浮动盈亏算法
struct CThostFtdcPositionProfitAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///盈亏算法
TThostFtdcAlgorithmType Algorithm;
///备注
TThostFtdcMemoType Memo;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///会员资金折扣
struct CThostFtdcDiscountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///资金折扣比例
TThostFtdcRatioType Discount;
};
///查询转帐银行
struct CThostFtdcQryTransferBankField
{
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
};
///转帐银行
struct CThostFtdcTransferBankField
{
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行名称
TThostFtdcBankNameType BankName;
///是否活跃
TThostFtdcBoolType IsActive;
};
///查询投资者持仓明细
struct CThostFtdcQryInvestorPositionDetailField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///投资者持仓明细
struct CThostFtdcInvestorPositionDetailField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///开仓日期
TThostFtdcDateType OpenDate;
///成交编号
TThostFtdcTradeIDType TradeID;
///数量
TThostFtdcVolumeType Volume;
///开仓价
TThostFtdcPriceType OpenPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///成交类型
TThostFtdcTradeTypeType TradeType;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///逐日盯市持仓盈亏
TThostFtdcMoneyType PositionProfitByDate;
///逐笔对冲持仓盈亏
TThostFtdcMoneyType PositionProfitByTrade;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///昨结算价
TThostFtdcPriceType LastSettlementPrice;
///结算价
TThostFtdcPriceType SettlementPrice;
///平仓量
TThostFtdcVolumeType CloseVolume;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///先开先平剩余数量
TThostFtdcVolumeType TimeFirstVolume;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///特殊持仓标志
TThostFtdcSpecPosiTypeType SpecPosiType;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///资金账户口令域
struct CThostFtdcTradingAccountPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///交易所行情报盘机
struct CThostFtdcMDTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所交易员连接状态
TThostFtdcTraderConnectStatusType TraderConnectStatus;
///发出连接请求的日期
TThostFtdcDateType ConnectRequestDate;
///发出连接请求的时间
TThostFtdcTimeType ConnectRequestTime;
///上次报告日期
TThostFtdcDateType LastReportDate;
///上次报告时间
TThostFtdcTimeType LastReportTime;
///完成连接日期
TThostFtdcDateType ConnectDate;
///完成连接时间
TThostFtdcTimeType ConnectTime;
///启动日期
TThostFtdcDateType StartDate;
///启动时间
TThostFtdcTimeType StartTime;
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///本席位最大成交编号
TThostFtdcTradeIDType MaxTradeID;
///本席位最大报单备拷
TThostFtdcReturnCodeType MaxOrderMessageReference;
///撤单时选择席位算法
TThostFtdcOrderCancelAlgType OrderCancelAlg;
};
///查询行情报盘机
struct CThostFtdcQryMDTraderOfferField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
};
///查询客户通知
struct CThostFtdcQryNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///客户通知
struct CThostFtdcNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///消息正文
TThostFtdcContentType Content;
///经纪公司通知内容序列号
TThostFtdcSequenceLabelType SequenceLabel;
};
///用户权限
struct CThostFtdcUserRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///客户权限类型
TThostFtdcUserRightTypeType UserRightType;
///是否禁止
TThostFtdcBoolType IsForbidden;
};
///查询结算信息确认域
struct CThostFtdcQrySettlementInfoConfirmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///装载结算信息
struct CThostFtdcLoadSettlementInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///经纪公司可提资金算法表
struct CThostFtdcBrokerWithdrawAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///可提资金算法
TThostFtdcAlgorithmType WithdrawAlgorithm;
///资金使用率
TThostFtdcRatioType UsingRatio;
///可提是否包含平仓盈利
TThostFtdcIncludeCloseProfitType IncludeCloseProfit;
///本日无仓且无成交客户是否受可提比例限制
TThostFtdcAllWithoutTradeType AllWithoutTrade;
///可用是否包含平仓盈利
TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit;
///是否启用用户事件
TThostFtdcBoolType IsBrokerUserEvent;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///货币质押比率
TThostFtdcRatioType FundMortgageRatio;
///权益算法
TThostFtdcBalanceAlgorithmType BalanceAlgorithm;
};
///资金账户口令变更域
struct CThostFtdcTradingAccountPasswordUpdateV1Field
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
};
///资金账户口令变更域
struct CThostFtdcTradingAccountPasswordUpdateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询组合合约分腿
struct CThostFtdcQryCombinationLegField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///单腿编号
TThostFtdcLegIDType LegID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///查询组合合约分腿
struct CThostFtdcQrySyncStatusField
{
///交易日
TThostFtdcDateType TradingDay;
};
///组合交易合约的单腿
struct CThostFtdcCombinationLegField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///单腿编号
TThostFtdcLegIDType LegID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///派生层数
TThostFtdcImplyLevelType ImplyLevel;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///数据同步状态
struct CThostFtdcSyncStatusField
{
///交易日
TThostFtdcDateType TradingDay;
///数据同步状态
TThostFtdcDataSyncStatusType DataSyncStatus;
};
///查询联系人
struct CThostFtdcQryLinkManField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///联系人
struct CThostFtdcLinkManField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///联系人类型
TThostFtdcPersonTypeType PersonType;
///证件类型
TThostFtdcIdCardTypeType IdentifiedCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///名称
TThostFtdcPartyNameType PersonName;
///联系电话
TThostFtdcTelephoneType Telephone;
///通讯地址
TThostFtdcAddressType Address;
///邮政编码
TThostFtdcZipCodeType ZipCode;
///优先级
TThostFtdcPriorityType Priority;
///开户邮政编码
TThostFtdcUOAZipCodeType UOAZipCode;
///全称
TThostFtdcInvestorFullNameType PersonFullName;
};
///查询经纪公司用户事件
struct CThostFtdcQryBrokerUserEventField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户事件类型
TThostFtdcUserEventTypeType UserEventType;
};
///查询经纪公司用户事件
struct CThostFtdcBrokerUserEventField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户事件类型
TThostFtdcUserEventTypeType UserEventType;
///用户事件序号
TThostFtdcSequenceNoType EventSequenceNo;
///事件发生日期
TThostFtdcDateType EventDate;
///事件发生时间
TThostFtdcTimeType EventTime;
///用户事件信息
TThostFtdcUserEventInfoType UserEventInfo;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易日
TThostFtdcDateType TradingDay;
};
///查询签约银行请求
struct CThostFtdcQryContractBankField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
};
///查询签约银行响应
struct CThostFtdcContractBankField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///银行代码
TThostFtdcBankIDType BankID;
///银行分中心代码
TThostFtdcBankBrchIDType BankBrchID;
///银行名称
TThostFtdcBankNameType BankName;
};
///投资者组合持仓明细
struct CThostFtdcInvestorPositionCombineDetailField
{
///交易日
TThostFtdcDateType TradingDay;
///开仓日期
TThostFtdcDateType OpenDate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///撮合编号
TThostFtdcTradeIDType TradeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///持仓量
TThostFtdcVolumeType TotalAmt;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合持仓合约编码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///预埋单
struct CThostFtdcParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///预埋报单编号
TThostFtdcParkedOrderIDType ParkedOrderID;
///用户类型
TThostFtdcUserTypeType UserType;
///预埋单状态
TThostFtdcParkedOrderStatusType Status;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///输入预埋单操作
struct CThostFtdcParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///预埋撤单单编号
TThostFtdcParkedOrderActionIDType ParkedOrderActionID;
///用户类型
TThostFtdcUserTypeType UserType;
///预埋撤单状态
TThostFtdcParkedOrderStatusType Status;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询预埋单
struct CThostFtdcQryParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询预埋撤单
struct CThostFtdcQryParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///删除预埋单
struct CThostFtdcRemoveParkedOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///预埋报单编号
TThostFtdcParkedOrderIDType ParkedOrderID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///删除预埋撤单
struct CThostFtdcRemoveParkedOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///预埋撤单编号
TThostFtdcParkedOrderActionIDType ParkedOrderActionID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///经纪公司可提资金算法表
struct CThostFtdcInvestorWithdrawAlgorithmField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///可提资金比例
TThostFtdcRatioType UsingRatio;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///货币质押比率
TThostFtdcRatioType FundMortgageRatio;
};
///查询组合持仓明细
struct CThostFtdcQryInvestorPositionCombineDetailField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///组合持仓合约编码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///成交均价
struct CThostFtdcMarketDataAveragePriceField
{
///当日均价
TThostFtdcPriceType AveragePrice;
};
///校验投资者密码
struct CThostFtdcVerifyInvestorPasswordField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///密码
TThostFtdcPasswordType Password;
};
///用户IP
struct CThostFtdcUserIPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///IP地址
TThostFtdcIPAddressType IPAddress;
///IP地址掩码
TThostFtdcIPAddressType IPMask;
};
///用户事件通知信息
struct CThostFtdcTradingNoticeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///发送时间
TThostFtdcTimeType SendTime;
///消息正文
TThostFtdcContentType FieldContent;
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///用户事件通知
struct CThostFtdcTradingNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///序列系列号
TThostFtdcSequenceSeriesType SequenceSeries;
///用户代码
TThostFtdcUserIDType UserID;
///发送时间
TThostFtdcTimeType SendTime;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///消息正文
TThostFtdcContentType FieldContent;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询交易事件通知
struct CThostFtdcQryTradingNoticeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///查询错误报单
struct CThostFtdcQryErrOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误报单
struct CThostFtdcErrOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易编码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///查询错误报单操作
struct CThostFtdcErrorConditionalOrderField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///报单引用
TThostFtdcOrderRefType OrderRef;
///用户代码
TThostFtdcUserIDType UserID;
///报单价格条件
TThostFtdcOrderPriceTypeType OrderPriceType;
///买卖方向
TThostFtdcDirectionType Direction;
///组合开平标志
TThostFtdcCombOffsetFlagType CombOffsetFlag;
///组合投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量
TThostFtdcVolumeType VolumeTotalOriginal;
///有效期类型
TThostFtdcTimeConditionType TimeCondition;
///GTD日期
TThostFtdcDateType GTDDate;
///成交量类型
TThostFtdcVolumeConditionType VolumeCondition;
///最小成交量
TThostFtdcVolumeType MinVolume;
///触发条件
TThostFtdcContingentConditionType ContingentCondition;
///止损价
TThostFtdcPriceType StopPrice;
///强平原因
TThostFtdcForceCloseReasonType ForceCloseReason;
///自动挂起标志
TThostFtdcBoolType IsAutoSuspend;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///请求编号
TThostFtdcRequestIDType RequestID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///保留的无效字段
TThostFtdcOldExchangeInstIDType reserve2;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///报单提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///报单提示序号
TThostFtdcSequenceNoType NotifySequence;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///报单来源
TThostFtdcOrderSourceType OrderSource;
///报单状态
TThostFtdcOrderStatusType OrderStatus;
///报单类型
TThostFtdcOrderTypeType OrderType;
///今成交数量
TThostFtdcVolumeType VolumeTraded;
///剩余数量
TThostFtdcVolumeType VolumeTotal;
///报单日期
TThostFtdcDateType InsertDate;
///委托时间
TThostFtdcTimeType InsertTime;
///激活时间
TThostFtdcTimeType ActiveTime;
///挂起时间
TThostFtdcTimeType SuspendTime;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///最后修改交易所交易员代码
TThostFtdcTraderIDType ActiveTraderID;
///结算会员编号
TThostFtdcParticipantIDType ClearingPartID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///用户强平标志
TThostFtdcBoolType UserForceClose;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOrderSeq;
///相关报单
TThostFtdcOrderSysIDType RelativeOrderSysID;
///郑商所成交数量
TThostFtdcVolumeType ZCETotalTradedVolume;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///互换单标志
TThostFtdcBoolType IsSwapOrder;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///资金账号
TThostFtdcAccountIDType AccountID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve3;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询错误报单操作
struct CThostFtdcQryErrOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///错误报单操作
struct CThostFtdcErrOrderActionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///报单操作引用
TThostFtdcOrderActionRefType OrderActionRef;
///报单引用
TThostFtdcOrderRefType OrderRef;
///请求编号
TThostFtdcRequestIDType RequestID;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///报单编号
TThostFtdcOrderSysIDType OrderSysID;
///操作标志
TThostFtdcActionFlagType ActionFlag;
///价格
TThostFtdcPriceType LimitPrice;
///数量变化
TThostFtdcVolumeType VolumeChange;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///本地报单编号
TThostFtdcOrderLocalIDType OrderLocalID;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///业务单元
TThostFtdcBusinessUnitType BusinessUnit;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///用户代码
TThostFtdcUserIDType UserID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///营业部编号
TThostFtdcBranchIDType BranchID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve2;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///报单回显字段
TThostFtdcOrderMemoType OrderMemo;
///session上请求计数 api自动维护
TThostFtdcSequenceNo12Type SessionReqSeq;
};
///查询交易所状态
struct CThostFtdcQryExchangeSequenceField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///交易所状态
struct CThostFtdcExchangeSequenceField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///序号
TThostFtdcSequenceNoType SequenceNo;
///合约交易状态
TThostFtdcInstrumentStatusType MarketStatus;
};
///根据价格查询最大报单数量
struct CThostFtdcQryMaxOrderVolumeWithPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///开平标志
TThostFtdcOffsetFlagType OffsetFlag;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///最大允许报单数量
TThostFtdcVolumeType MaxVolume;
///报单价格
TThostFtdcPriceType Price;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司交易参数
struct CThostFtdcQryBrokerTradingParamsField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///经纪公司交易参数
struct CThostFtdcBrokerTradingParamsField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保证金价格类型
TThostFtdcMarginPriceTypeType MarginPriceType;
///盈亏算法
TThostFtdcAlgorithmType Algorithm;
///可用是否包含平仓盈利
TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期权权利金价格类型
TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
};
///查询经纪公司交易算法
struct CThostFtdcQryBrokerTradingAlgosField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///经纪公司交易算法
struct CThostFtdcBrokerTradingAlgosField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///持仓处理算法编号
TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID;
///寻找保证金率算法编号
TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID;
///资金处理算法编号
TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询经纪公司资金
struct CThostFtdcQueryBrokerDepositField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
};
///经纪公司资金
struct CThostFtdcBrokerDepositField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///可提资金
TThostFtdcMoneyType Available;
///基本准备金
TThostFtdcMoneyType Reserve;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
};
///查询保证金监管系统经纪公司密钥
struct CThostFtdcQryCFMMCBrokerKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///保证金监管系统经纪公司密钥
struct CThostFtdcCFMMCBrokerKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///密钥生成日期
TThostFtdcDateType CreateDate;
///密钥生成时间
TThostFtdcTimeType CreateTime;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态密钥
TThostFtdcCFMMCKeyType CurrentKey;
///动态密钥类型
TThostFtdcCFMMCKeyKindType KeyKind;
};
///保证金监管系统经纪公司资金账户密钥
struct CThostFtdcCFMMCTradingAccountKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态密钥
TThostFtdcCFMMCKeyType CurrentKey;
};
///请求查询保证金监管系统经纪公司资金账户密钥
struct CThostFtdcQryCFMMCTradingAccountKeyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///用户动态令牌参数
struct CThostFtdcBrokerUserOTPParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///动态令牌提供商
TThostFtdcOTPVendorsIDType OTPVendorsID;
///动态令牌序列号
TThostFtdcSerialNumberType SerialNumber;
///令牌密钥
TThostFtdcAuthKeyType AuthKey;
///漂移值
TThostFtdcLastDriftType LastDrift;
///成功值
TThostFtdcLastSuccessType LastSuccess;
///动态令牌类型
TThostFtdcOTPTypeType OTPType;
};
///手工同步用户动态令牌
struct CThostFtdcManualSyncBrokerUserOTPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///动态令牌类型
TThostFtdcOTPTypeType OTPType;
///第一个动态密码
TThostFtdcPasswordType FirstOTP;
///第二个动态密码
TThostFtdcPasswordType SecondOTP;
};
///投资者手续费率模板
struct CThostFtdcCommRateModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
///模板名称
TThostFtdcCommModelNameType CommModelName;
};
///请求查询投资者手续费率模板
struct CThostFtdcQryCommRateModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///手续费率模板代码
TThostFtdcInvestorIDType CommModelID;
};
///投资者保证金率模板
struct CThostFtdcMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
///模板名称
TThostFtdcCommModelNameType MarginModelName;
};
///请求查询投资者保证金率模板
struct CThostFtdcQryMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///保证金率模板代码
TThostFtdcInvestorIDType MarginModelID;
};
///仓单折抵信息
struct CThostFtdcEWarrantOffsetField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///买卖方向
TThostFtdcDirectionType Direction;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///数量
TThostFtdcVolumeType Volume;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询仓单折抵信息
struct CThostFtdcQryEWarrantOffsetField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///查询投资者品种/跨品种保证金
struct CThostFtdcQryInvestorProductGroupMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///品种/跨品种标示
TThostFtdcInstrumentIDType ProductGroupID;
};
///投资者品种/跨品种保证金
struct CThostFtdcInvestorProductGroupMarginField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///多头冻结的保证金
TThostFtdcMoneyType LongFrozenMargin;
///空头冻结的保证金
TThostFtdcMoneyType ShortFrozenMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///多头保证金
TThostFtdcMoneyType LongUseMargin;
///空头保证金
TThostFtdcMoneyType ShortUseMargin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///交易所多头保证金
TThostFtdcMoneyType LongExchMargin;
///交易所空头保证金
TThostFtdcMoneyType ShortExchMargin;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///折抵总金额
TThostFtdcMoneyType OffsetAmount;
///多头折抵总金额
TThostFtdcMoneyType LongOffsetAmount;
///空头折抵总金额
TThostFtdcMoneyType ShortOffsetAmount;
///交易所折抵总金额
TThostFtdcMoneyType ExchOffsetAmount;
///交易所多头折抵总金额
TThostFtdcMoneyType LongExchOffsetAmount;
///交易所空头折抵总金额
TThostFtdcMoneyType ShortExchOffsetAmount;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///品种/跨品种标示
TThostFtdcInstrumentIDType ProductGroupID;
};
///查询监控中心用户令牌
struct CThostFtdcQueryCFMMCTradingAccountTokenField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
};
///监控中心用户令牌
struct CThostFtdcCFMMCTradingAccountTokenField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///经纪公司统一编码
TThostFtdcParticipantIDType ParticipantID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///密钥编号
TThostFtdcSequenceNoType KeyID;
///动态令牌
TThostFtdcCFMMCTokenType Token;
};
///查询产品组
struct CThostFtdcQryProductGroupField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///投资者品种/跨品种保证金产品组
struct CThostFtdcProductGroupField
{
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve2;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///产品组代码
TThostFtdcInstrumentIDType ProductGroupID;
};
///交易所公告
struct CThostFtdcBulletinField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易日
TThostFtdcDateType TradingDay;
///公告编号
TThostFtdcBulletinIDType BulletinID;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///公告类型
TThostFtdcNewsTypeType NewsType;
///紧急程度
TThostFtdcNewsUrgencyType NewsUrgency;
///发送时间
TThostFtdcTimeType SendTime;
///消息摘要
TThostFtdcAbstractType Abstract;
///消息来源
TThostFtdcComeFromType ComeFrom;
///消息正文
TThostFtdcContentType Content;
///WEB地址
TThostFtdcURLLinkType URLLink;
///市场代码
TThostFtdcMarketIDType MarketID;
};
///查询交易所公告
struct CThostFtdcQryBulletinField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///公告编号
TThostFtdcBulletinIDType BulletinID;
///序列号
TThostFtdcSequenceNoType SequenceNo;
///公告类型
TThostFtdcNewsTypeType NewsType;
///紧急程度
TThostFtdcNewsUrgencyType NewsUrgency;
};
///MulticastInstrument
struct CThostFtdcMulticastInstrumentField
{
///主题号
TThostFtdcInstallIDType TopicID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约编号
TThostFtdcInstallIDType InstrumentNo;
///基准价
TThostFtdcPriceType CodePrice;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///QryMulticastInstrument
struct CThostFtdcQryMulticastInstrumentField
{
///主题号
TThostFtdcInstallIDType TopicID;
///保留的无效字段
TThostFtdcOldInstrumentIDType reserve1;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///App客户端权限分配
struct CThostFtdcAppIDAuthAssignField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///转帐开户请求
struct CThostFtdcReqOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///转帐销户请求
struct CThostFtdcReqCancelAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///变更银行账户请求
struct CThostFtdcReqChangeAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///新银行帐号
TThostFtdcBankAccountType NewBankAccount;
///新银行密码
TThostFtdcPasswordType NewBankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易ID
TThostFtdcTIDType TID;
///摘要
TThostFtdcDigestType Digest;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///转账请求
struct CThostFtdcReqTransferField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银行发起银行资金转期货响应
struct CThostFtdcRspTransferField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///冲正请求
struct CThostFtdcReqRepealField
{
///冲正时间间隔
TThostFtdcRepealTimeIntervalType RepealTimeInterval;
///已经冲正次数
TThostFtdcRepealedTimesType RepealedTimes;
///银行冲正标志
TThostFtdcBankRepealFlagType BankRepealFlag;
///期商冲正标志
TThostFtdcBrokerRepealFlagType BrokerRepealFlag;
///被冲正平台流水号
TThostFtdcPlateSerialType PlateRepealSerial;
///被冲正银行流水号
TThostFtdcBankSerialType BankRepealSerial;
///被冲正期货流水号
TThostFtdcFutureSerialType FutureRepealSerial;
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///冲正响应
struct CThostFtdcRspRepealField
{
///冲正时间间隔
TThostFtdcRepealTimeIntervalType RepealTimeInterval;
///已经冲正次数
TThostFtdcRepealedTimesType RepealedTimes;
///银行冲正标志
TThostFtdcBankRepealFlagType BankRepealFlag;
///期商冲正标志
TThostFtdcBrokerRepealFlagType BrokerRepealFlag;
///被冲正平台流水号
TThostFtdcPlateSerialType PlateRepealSerial;
///被冲正银行流水号
TThostFtdcBankSerialType BankRepealSerial;
///被冲正期货流水号
TThostFtdcFutureSerialType FutureRepealSerial;
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询账户信息请求
struct CThostFtdcReqQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询账户信息响应
struct CThostFtdcRspQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///期商签到签退
struct CThostFtdcFutureSignIOField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///期商签到响应
struct CThostFtdcRspFutureSignInField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///PIN密钥
TThostFtdcPasswordKeyType PinKey;
///MAC密钥
TThostFtdcPasswordKeyType MacKey;
};
///期商签退请求
struct CThostFtdcReqFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///期商签退响应
struct CThostFtdcRspFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///查询指定流水号的交易结果请求
struct CThostFtdcReqQueryTradeResultBySerialField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///流水号
TThostFtdcSerialType Reference;
///本流水号发布者的机构类型
TThostFtdcInstitutionTypeType RefrenceIssureType;
///本流水号发布者机构编码
TThostFtdcOrganCodeType RefrenceIssure;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///摘要
TThostFtdcDigestType Digest;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///查询指定流水号的交易结果响应
struct CThostFtdcRspQueryTradeResultBySerialField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///流水号
TThostFtdcSerialType Reference;
///本流水号发布者的机构类型
TThostFtdcInstitutionTypeType RefrenceIssureType;
///本流水号发布者机构编码
TThostFtdcOrganCodeType RefrenceIssure;
///原始返回代码
TThostFtdcReturnCodeType OriginReturnCode;
///原始返回码描述
TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///摘要
TThostFtdcDigestType Digest;
};
///日终文件就绪请求
struct CThostFtdcReqDayEndFileReadyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///文件业务功能
TThostFtdcFileBusinessCodeType FileBusinessCode;
///摘要
TThostFtdcDigestType Digest;
};
///返回结果
struct CThostFtdcReturnResultField
{
///返回代码
TThostFtdcReturnCodeType ReturnCode;
///返回码描述
TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode;
};
///验证期货资金密码
struct CThostFtdcVerifyFuturePasswordField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///交易ID
TThostFtdcTIDType TID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///验证客户信息
struct CThostFtdcVerifyCustInfoField
{
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///验证期货资金密码和客户信息
struct CThostFtdcVerifyFuturePasswordAndCustInfoField
{
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///验证期货资金密码和客户信息
struct CThostFtdcDepositResultInformField
{
///出入金流水号,该流水号为银期报盘返回的流水号
TThostFtdcDepositSeqNoType DepositSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///入金金额
TThostFtdcMoneyType Deposit;
///请求编号
TThostFtdcRequestIDType RequestID;
///返回代码
TThostFtdcReturnCodeType ReturnCode;
///返回码描述
TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode;
};
///交易核心向银期报盘发出密钥同步请求
struct CThostFtdcReqSyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
};
///交易核心向银期报盘发出密钥同步响应
struct CThostFtdcRspSyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///查询账户信息通知
struct CThostFtdcNotifyQueryAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期转账交易流水表
struct CThostFtdcTransferSerialField
{
///平台流水号
TThostFtdcPlateSerialType PlateSerial;
///交易发起方日期
TThostFtdcTradeDateType TradeDate;
///交易日期
TThostFtdcDateType TradingDay;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///交易代码
TThostFtdcTradeCodeType TradeCode;
///会话编号
TThostFtdcSessionIDType SessionID;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///期货公司编码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///期货公司帐号类型
TThostFtdcFutureAccTypeType FutureAccType;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///交易金额
TThostFtdcTradeAmountType TradeAmount;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///有效标志
TThostFtdcAvailabilityFlagType AvailabilityFlag;
///操作员
TThostFtdcOperatorCodeType OperatorCode;
///新银行帐号
TThostFtdcBankAccountType BankNewAccount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///请求查询转帐流水
struct CThostFtdcQryTransferSerialField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行编码
TThostFtdcBankIDType BankID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///期商签到通知
struct CThostFtdcNotifyFutureSignInField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///PIN密钥
TThostFtdcPasswordKeyType PinKey;
///MAC密钥
TThostFtdcPasswordKeyType MacKey;
};
///期商签退通知
struct CThostFtdcNotifyFutureSignOutField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///摘要
TThostFtdcDigestType Digest;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///交易核心向银期报盘发出密钥同步处理结果的通知
struct CThostFtdcNotifySyncKeyField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///交易核心给银期报盘的消息
TThostFtdcAddInfoType Message;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///请求查询银期签约关系
struct CThostFtdcQryAccountregisterField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///客户开销户信息表
struct CThostFtdcAccountregisterField
{
///交易日期
TThostFtdcTradeDateType TradeDay;
///银行编码
TThostFtdcBankIDType BankID;
///银行分支机构编码
TThostFtdcBankBrchIDType BankBranchID;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///期货公司编码
TThostFtdcBrokerIDType BrokerID;
///期货公司分支机构编码
TThostFtdcFutureBranchIDType BrokerBranchID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///开销户类别
TThostFtdcOpenOrDestroyType OpenOrDestroy;
///签约日期
TThostFtdcTradeDateType RegDate;
///解约日期
TThostFtdcTradeDateType OutDate;
///交易ID
TThostFtdcTIDType TID;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期开户信息
struct CThostFtdcOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期销户信息
struct CThostFtdcCancelAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///汇钞标志
TThostFtdcCashExchangeCodeType CashExchangeCode;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///交易ID
TThostFtdcTIDType TID;
///用户标识
TThostFtdcUserIDType UserID;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///银期变更银行账号信息
struct CThostFtdcChangeAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///新银行帐号
TThostFtdcBankAccountType NewBankAccount;
///新银行密码
TThostFtdcPasswordType NewBankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易ID
TThostFtdcTIDType TID;
///摘要
TThostFtdcDigestType Digest;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
};
///二级代理操作员银期权限
struct CThostFtdcSecAgentACIDMapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///资金账户
TThostFtdcAccountIDType AccountID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
};
///二级代理操作员银期权限查询
struct CThostFtdcQrySecAgentACIDMapField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///资金账户
TThostFtdcAccountIDType AccountID;
///币种
TThostFtdcCurrencyIDType CurrencyID;
};
///灾备中心交易权限
struct CThostFtdcUserRightsAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///经济公司是否有在本标示的交易权限
struct CThostFtdcBrokerUserRightAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///能否交易
TThostFtdcBoolType Tradeable;
};
///灾备交易转换报文
struct CThostFtdcDRTransferField
{
///原交易中心代码
TThostFtdcDRIdentityIDType OrigDRIdentityID;
///目标交易中心代码
TThostFtdcDRIdentityIDType DestDRIdentityID;
///原应用单元代码
TThostFtdcBrokerIDType OrigBrokerID;
///目标易用单元代码
TThostFtdcBrokerIDType DestBrokerID;
};
///Fens用户信息
struct CThostFtdcFensUserInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///登录模式
TThostFtdcLoginModeType LoginMode;
};
///当前银期所属交易中心
struct CThostFtdcCurrTransferIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType IdentityID;
};
///禁止登录用户
struct CThostFtdcLoginForbiddenUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询禁止登录用户
struct CThostFtdcQryLoginForbiddenUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///资金账户基本准备金
struct CThostFtdcTradingAccountReserveField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///基本准备金
TThostFtdcMoneyType Reserve;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询禁止登录IP
struct CThostFtdcQryLoginForbiddenIPField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询IP列表
struct CThostFtdcQryIPListField
{
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询用户下单权限分配表
struct CThostFtdcQryUserRightsAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///银期预约开户确认请求
struct CThostFtdcReserveOpenAccountConfirmField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcLongIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易ID
TThostFtdcTIDType TID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///预约开户银行流水号
TThostFtdcBankSerialType BankReserveOpenSeq;
///预约开户日期
TThostFtdcTradeDateType BookDate;
///预约开户验证密码
TThostFtdcPasswordType BookPsw;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///银期预约开户
struct CThostFtdcReserveOpenAccountField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcLongIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///性别
TThostFtdcGenderType Gender;
///国家代码
TThostFtdcCountryCodeType CountryCode;
///客户类型
TThostFtdcCustTypeType CustType;
///地址
TThostFtdcAddressType Address;
///邮编
TThostFtdcZipCodeType ZipCode;
///电话号码
TThostFtdcTelephoneType Telephone;
///手机
TThostFtdcMobilePhoneType MobilePhone;
///传真
TThostFtdcFaxType Fax;
///电子邮件
TThostFtdcEMailType EMail;
///资金账户状态
TThostFtdcMoneyAccountStatusType MoneyAccountStatus;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///安装编号
TThostFtdcInstallIDType InstallID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///交易ID
TThostFtdcTIDType TID;
///预约开户状态
TThostFtdcReserveOpenAccStasType ReserveOpenAccStas;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
};
///银行账户属性
struct CThostFtdcAccountPropertyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///银行统一标识类型
TThostFtdcBankIDType BankID;
///银行账户
TThostFtdcBankAccountType BankAccount;
///银行账户的开户人名称
TThostFtdcInvestorFullNameType OpenName;
///银行账户的开户行
TThostFtdcOpenBankType OpenBank;
///是否活跃
TThostFtdcBoolType IsActive;
///账户来源
TThostFtdcAccountSourceTypeType AccountSourceType;
///开户日期
TThostFtdcDateType OpenDate;
///注销日期
TThostFtdcDateType CancelDate;
///录入员代码
TThostFtdcOperatorIDType OperatorID;
///录入日期
TThostFtdcDateType OperateDate;
///录入时间
TThostFtdcTimeType OperateTime;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
};
///查询当前交易中心
struct CThostFtdcQryCurrDRIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///当前交易中心
struct CThostFtdcCurrDRIdentityField
{
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///查询二级代理商资金校验模式
struct CThostFtdcQrySecAgentCheckModeField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询二级代理商信息
struct CThostFtdcQrySecAgentTradeInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///境外中介机构资金帐号
TThostFtdcAccountIDType BrokerSecAgentID;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqUserAuthMethodField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///用户发出获取安全安全登陆方法回复
struct CThostFtdcRspUserAuthMethodField
{
///当前可以用的认证模式
TThostFtdcCurrentAuthMethodType UsableAuthMethod;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqGenUserCaptchaField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///生成的图片验证码信息
struct CThostFtdcRspGenUserCaptchaField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///图片信息长度
TThostFtdcCaptchaInfoLenType CaptchaInfoLen;
///图片信息
TThostFtdcCaptchaInfoType CaptchaInfo;
};
///用户发出获取安全安全登陆方法请求
struct CThostFtdcReqGenUserTextField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///短信验证码生成的回复
struct CThostFtdcRspGenUserTextField
{
///短信验证码序号
TThostFtdcUserTextSeqType UserTextSeq;
};
///用户发出带图形验证码的登录请求请求
struct CThostFtdcReqUserLoginWithCaptchaField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///图形验证码的文字内容
TThostFtdcPasswordType Captcha;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户发出带短信验证码的登录请求请求
struct CThostFtdcReqUserLoginWithTextField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///短信验证码文字内容
TThostFtdcPasswordType Text;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///用户发出带动态验证码的登录请求请求
struct CThostFtdcReqUserLoginWithOTPField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///OTP密码
TThostFtdcPasswordType OTPPassword;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
};
///api握手请求
struct CThostFtdcReqApiHandshakeField
{
///api与front通信密钥版本号
TThostFtdcCryptoKeyVersionType CryptoKeyVersion;
};
///front发给api的握手回复
struct CThostFtdcRspApiHandshakeField
{
///握手回复数据长度
TThostFtdcHandshakeDataLenType FrontHandshakeDataLen;
///握手回复数据
TThostFtdcHandshakeDataType FrontHandshakeData;
///API认证是否开启
TThostFtdcBoolType IsApiAuthEnabled;
};
///api给front的验证key的请求
struct CThostFtdcReqVerifyApiKeyField
{
///握手回复数据长度
TThostFtdcHandshakeDataLenType ApiHandshakeDataLen;
///握手回复数据
TThostFtdcHandshakeDataType ApiHandshakeData;
};
///操作员组织架构关系
struct CThostFtdcDepartmentUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///投资者范围
TThostFtdcDepartmentRangeType InvestorRange;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///查询频率,每秒查询比数
struct CThostFtdcQueryFreqField
{
///查询频率
TThostFtdcQueryFreqType QueryFreq;
///FTD频率
TThostFtdcQueryFreqType FTDPkgFreq;
};
///禁止认证IP
struct CThostFtdcAuthForbiddenIPField
{
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///查询禁止认证IP
struct CThostFtdcQryAuthForbiddenIPField
{
///IP地址
TThostFtdcIPAddressType IPAddress;
};
///换汇可提冻结
struct CThostFtdcSyncDelaySwapFrozenField
{
///换汇流水号
TThostFtdcDepositSeqNoType DelaySwapSeqNo;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///源币种
TThostFtdcCurrencyIDType FromCurrencyID;
///源剩余换汇额度(可提冻结)
TThostFtdcMoneyType FromRemainSwap;
///是否手工换汇
TThostFtdcBoolType IsManualSwap;
};
///用户系统信息
struct CThostFtdcUserSystemInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///用户端系统内部信息长度
TThostFtdcSystemInfoLenType ClientSystemInfoLen;
///用户端系统内部信息
TThostFtdcClientSystemInfoType ClientSystemInfo;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///登录成功时间
TThostFtdcTimeType ClientLoginTime;
///App代码
TThostFtdcAppIDType ClientAppID;
///用户公网IP
TThostFtdcIPAddressType ClientPublicIP;
///客户登录备注2
TThostFtdcClientLoginRemarkType ClientLoginRemark;
};
///终端用户绑定信息
struct CThostFtdcAuthUserIDField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///用户代码
TThostFtdcUserIDType UserID;
///校验类型
TThostFtdcAuthTypeType AuthType;
};
///用户IP绑定信息
struct CThostFtdcAuthIPField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///App代码
TThostFtdcAppIDType AppID;
///用户代码
TThostFtdcIPAddressType IPAddress;
};
///查询分类合约
struct CThostFtdcQryClassifiedInstrumentField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///合约交易状态
TThostFtdcTradingTypeType TradingType;
///合约分类类型
TThostFtdcClassTypeType ClassType;
};
///查询组合优惠比例
struct CThostFtdcQryCombPromotionParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///组合优惠比例
struct CThostFtdcCombPromotionParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcCombHedgeFlagType CombHedgeFlag;
///期权组合保证金比例
TThostFtdcDiscountRatioType Xparameter;
};
///国密用户登录请求
struct CThostFtdcReqUserLoginSMField
{
///交易日
TThostFtdcDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///密码
TThostFtdcPasswordType Password;
///用户端产品信息
TThostFtdcProductInfoType UserProductInfo;
///接口端产品信息
TThostFtdcProductInfoType InterfaceProductInfo;
///协议信息
TThostFtdcProtocolInfoType ProtocolInfo;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///动态密码
TThostFtdcPasswordType OneTimePassword;
///保留的无效字段
TThostFtdcOldIPAddressType reserve1;
///登录备注
TThostFtdcLoginRemarkType LoginRemark;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///终端IP地址
TThostFtdcIPAddressType ClientIPAddress;
///经纪公司名称
TThostFtdcBrokerNameType BrokerName;
///认证码
TThostFtdcAuthCodeType AuthCode;
///App代码
TThostFtdcAppIDType AppID;
///PIN码
TThostFtdcPasswordType PIN;
};
///投资者风险结算持仓查询
struct CThostFtdcQryRiskSettleInvstPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///风险结算产品查询
struct CThostFtdcQryRiskSettleProductStatusField
{
///产品代码
TThostFtdcInstrumentIDType ProductID;
};
///投资者风险结算持仓
struct CThostFtdcRiskSettleInvstPositionField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓日期
TThostFtdcPositionDateType PositionDate;
///上日持仓
TThostFtdcVolumeType YdPosition;
///今日持仓
TThostFtdcVolumeType Position;
///多头冻结
TThostFtdcVolumeType LongFrozen;
///空头冻结
TThostFtdcVolumeType ShortFrozen;
///开仓冻结金额
TThostFtdcMoneyType LongFrozenAmount;
///开仓冻结金额
TThostFtdcMoneyType ShortFrozenAmount;
///开仓量
TThostFtdcVolumeType OpenVolume;
///平仓量
TThostFtdcVolumeType CloseVolume;
///开仓金额
TThostFtdcMoneyType OpenAmount;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///持仓成本
TThostFtdcMoneyType PositionCost;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///占用的保证金
TThostFtdcMoneyType UseMargin;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///开仓成本
TThostFtdcMoneyType OpenCost;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///组合成交形成的持仓
TThostFtdcVolumeType CombPosition;
///组合多头冻结
TThostFtdcVolumeType CombLongFrozen;
///组合空头冻结
TThostFtdcVolumeType CombShortFrozen;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///今日持仓
TThostFtdcVolumeType TodayPosition;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///执行冻结
TThostFtdcVolumeType StrikeFrozen;
///执行冻结金额
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///执行冻结的昨仓
TThostFtdcVolumeType YdStrikeFrozen;
///投资单元代码
TThostFtdcInvestUnitIDType InvestUnitID;
///持仓成本差值
TThostFtdcMoneyType PositionCostOffset;
///tas持仓手数
TThostFtdcVolumeType TasPosition;
///tas持仓成本
TThostFtdcMoneyType TasPositionCost;
};
///风险品种
struct CThostFtdcRiskSettleProductStatusField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品编号
TThostFtdcInstrumentIDType ProductID;
///产品结算状态
TThostFtdcProductStatusType ProductStatus;
};
///风险结算追平信息
struct CThostFtdcSyncDeltaInfoField
{
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
///追平状态
TThostFtdcSyncDeltaStatusType SyncDeltaStatus;
///追平描述
TThostFtdcSyncDescriptionType SyncDescription;
///是否只有资金追平
TThostFtdcBoolType IsOnlyTrdDelta;
};
///风险结算追平产品信息
struct CThostFtdcSyncDeltaProductStatusField
{
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///是否允许交易
TThostFtdcProductStatusType ProductStatus;
};
///风险结算追平持仓明细
struct CThostFtdcSyncDeltaInvstPosDtlField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///开仓日期
TThostFtdcDateType OpenDate;
///成交编号
TThostFtdcTradeIDType TradeID;
///数量
TThostFtdcVolumeType Volume;
///开仓价
TThostFtdcPriceType OpenPrice;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///成交类型
TThostFtdcTradeTypeType TradeType;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///逐日盯市平仓盈亏
TThostFtdcMoneyType CloseProfitByDate;
///逐笔对冲平仓盈亏
TThostFtdcMoneyType CloseProfitByTrade;
///逐日盯市持仓盈亏
TThostFtdcMoneyType PositionProfitByDate;
///逐笔对冲持仓盈亏
TThostFtdcMoneyType PositionProfitByTrade;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///昨结算价
TThostFtdcPriceType LastSettlementPrice;
///结算价
TThostFtdcPriceType SettlementPrice;
///平仓量
TThostFtdcVolumeType CloseVolume;
///平仓金额
TThostFtdcMoneyType CloseAmount;
///先开先平剩余数量
TThostFtdcVolumeType TimeFirstVolume;
///特殊持仓标志
TThostFtdcSpecPosiTypeType SpecPosiType;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平组合持仓明细
struct CThostFtdcSyncDeltaInvstPosCombDtlField
{
///交易日
TThostFtdcDateType TradingDay;
///开仓日期
TThostFtdcDateType OpenDate;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合编号
TThostFtdcTradeIDType ComTradeID;
///撮合编号
TThostFtdcTradeIDType TradeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///买卖
TThostFtdcDirectionType Direction;
///持仓量
TThostFtdcVolumeType TotalAmt;
///投资者保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///保证金率
TThostFtdcRatioType MarginRateByMoney;
///保证金率(按手数)
TThostFtdcRatioType MarginRateByVolume;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平资金
struct CThostFtdcSyncDeltaTradingAccountField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///上次质押金额
TThostFtdcMoneyType PreMortgage;
///上次信用额度
TThostFtdcMoneyType PreCredit;
///上次存款额
TThostFtdcMoneyType PreDeposit;
///上次结算准备金
TThostFtdcMoneyType PreBalance;
///上次占用的保证金
TThostFtdcMoneyType PreMargin;
///利息基数
TThostFtdcMoneyType InterestBase;
///利息收入
TThostFtdcMoneyType Interest;
///入金金额
TThostFtdcMoneyType Deposit;
///出金金额
TThostFtdcMoneyType Withdraw;
///冻结的保证金
TThostFtdcMoneyType FrozenMargin;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///当前保证金总额
TThostFtdcMoneyType CurrMargin;
///资金差额
TThostFtdcMoneyType CashIn;
///手续费
TThostFtdcMoneyType Commission;
///平仓盈亏
TThostFtdcMoneyType CloseProfit;
///持仓盈亏
TThostFtdcMoneyType PositionProfit;
///期货结算准备金
TThostFtdcMoneyType Balance;
///可用资金
TThostFtdcMoneyType Available;
///可取资金
TThostFtdcMoneyType WithdrawQuota;
///基本准备金
TThostFtdcMoneyType Reserve;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///信用额度
TThostFtdcMoneyType Credit;
///质押金额
TThostFtdcMoneyType Mortgage;
///交易所保证金
TThostFtdcMoneyType ExchangeMargin;
///投资者交割保证金
TThostFtdcMoneyType DeliveryMargin;
///交易所交割保证金
TThostFtdcMoneyType ExchangeDeliveryMargin;
///保底期货结算准备金
TThostFtdcMoneyType ReserveBalance;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///上次货币质入金额
TThostFtdcMoneyType PreFundMortgageIn;
///上次货币质出金额
TThostFtdcMoneyType PreFundMortgageOut;
///货币质入金额
TThostFtdcMoneyType FundMortgageIn;
///货币质出金额
TThostFtdcMoneyType FundMortgageOut;
///货币质押余额
TThostFtdcMoneyType FundMortgageAvailable;
///可质押货币金额
TThostFtdcMoneyType MortgageableFund;
///特殊产品占用保证金
TThostFtdcMoneyType SpecProductMargin;
///特殊产品冻结保证金
TThostFtdcMoneyType SpecProductFrozenMargin;
///特殊产品手续费
TThostFtdcMoneyType SpecProductCommission;
///特殊产品冻结手续费
TThostFtdcMoneyType SpecProductFrozenCommission;
///特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfit;
///特殊产品平仓盈亏
TThostFtdcMoneyType SpecProductCloseProfit;
///根据持仓盈亏算法计算的特殊产品持仓盈亏
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
///延时换汇冻结金额
TThostFtdcMoneyType FrozenSwap;
///剩余换汇额度
TThostFtdcMoneyType RemainSwap;
///期权市值
TThostFtdcMoneyType OptionValue;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///投资者风险结算总保证金
struct CThostFtdcSyncDeltaInitInvstMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///追平前总风险保证金
TThostFtdcMoneyType LastRiskTotalInvstMargin;
///追平前交易所总风险保证金
TThostFtdcMoneyType LastRiskTotalExchMargin;
///本次追平品种总保证金
TThostFtdcMoneyType ThisSyncInvstMargin;
///本次追平品种交易所总保证金
TThostFtdcMoneyType ThisSyncExchMargin;
///本次未追平品种总保证金
TThostFtdcMoneyType RemainRiskInvstMargin;
///本次未追平品种交易所总保证金
TThostFtdcMoneyType RemainRiskExchMargin;
///追平前总特殊产品风险保证金
TThostFtdcMoneyType LastRiskSpecTotalInvstMargin;
///追平前总特殊产品交易所风险保证金
TThostFtdcMoneyType LastRiskSpecTotalExchMargin;
///本次追平品种特殊产品总保证金
TThostFtdcMoneyType ThisSyncSpecInvstMargin;
///本次追平品种特殊产品交易所总保证金
TThostFtdcMoneyType ThisSyncSpecExchMargin;
///本次未追平品种特殊产品总保证金
TThostFtdcMoneyType RemainRiskSpecInvstMargin;
///本次未追平品种特殊产品交易所总保证金
TThostFtdcMoneyType RemainRiskSpecExchMargin;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平组合优先级
struct CThostFtdcSyncDeltaDceCombInstrumentField
{
///合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///成交组号
TThostFtdcTradeGroupIDType TradeGroupID;
///投机套保标志
TThostFtdcHedgeFlagType CombHedgeFlag;
///组合类型
TThostFtdcDceCombinationTypeType CombinationType;
///买卖
TThostFtdcDirectionType Direction;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///期权组合保证金比例
TThostFtdcDiscountRatioType Xparameter;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者期货保证金率
struct CThostFtdcSyncDeltaInvstMarginRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///是否相对交易所收取
TThostFtdcBoolType IsRelative;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平交易所期货保证金率
struct CThostFtdcSyncDeltaExchMarginRateField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平中金现货期权交易所保证金率
struct CThostFtdcSyncDeltaOptExchMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平中金现货期权投资者保证金率
struct CThostFtdcSyncDeltaOptInvstMarginField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机空头保证金调整系数
TThostFtdcRatioType SShortMarginRatioByMoney;
///投机空头保证金调整系数
TThostFtdcMoneyType SShortMarginRatioByVolume;
///保值空头保证金调整系数
TThostFtdcRatioType HShortMarginRatioByMoney;
///保值空头保证金调整系数
TThostFtdcMoneyType HShortMarginRatioByVolume;
///套利空头保证金调整系数
TThostFtdcRatioType AShortMarginRatioByMoney;
///套利空头保证金调整系数
TThostFtdcMoneyType AShortMarginRatioByVolume;
///是否跟随交易所收取
TThostFtdcBoolType IsRelative;
///做市商空头保证金调整系数
TThostFtdcRatioType MShortMarginRatioByMoney;
///做市商空头保证金调整系数
TThostFtdcMoneyType MShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期权标的调整保证金率
struct CThostFtdcSyncDeltaInvstMarginRateULField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///多头保证金率
TThostFtdcRatioType LongMarginRatioByMoney;
///多头保证金费
TThostFtdcMoneyType LongMarginRatioByVolume;
///空头保证金率
TThostFtdcRatioType ShortMarginRatioByMoney;
///空头保证金费
TThostFtdcMoneyType ShortMarginRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期权手续费率
struct CThostFtdcSyncDeltaOptInvstCommRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///执行手续费率
TThostFtdcRatioType StrikeRatioByMoney;
///执行手续费
TThostFtdcRatioType StrikeRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平期货手续费率
struct CThostFtdcSyncDeltaInvstCommRateField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///开仓手续费率
TThostFtdcRatioType OpenRatioByMoney;
///开仓手续费
TThostFtdcRatioType OpenRatioByVolume;
///平仓手续费率
TThostFtdcRatioType CloseRatioByMoney;
///平仓手续费
TThostFtdcRatioType CloseRatioByVolume;
///平今手续费率
TThostFtdcRatioType CloseTodayRatioByMoney;
///平今手续费
TThostFtdcRatioType CloseTodayRatioByVolume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平交叉汇率
struct CThostFtdcSyncDeltaProductExchRateField
{
///产品代码
TThostFtdcInstrumentIDType ProductID;
///报价币种类型
TThostFtdcCurrencyIDType QuoteCurrencyID;
///汇率
TThostFtdcExchangeRateType ExchangeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平行情
struct CThostFtdcSyncDeltaDepthMarketDataField
{
///交易日
TThostFtdcDateType TradingDay;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///最新价
TThostFtdcPriceType LastPrice;
///上次结算价
TThostFtdcPriceType PreSettlementPrice;
///昨收盘
TThostFtdcPriceType PreClosePrice;
///昨持仓量
TThostFtdcLargeVolumeType PreOpenInterest;
///今开盘
TThostFtdcPriceType OpenPrice;
///最高价
TThostFtdcPriceType HighestPrice;
///最低价
TThostFtdcPriceType LowestPrice;
///数量
TThostFtdcVolumeType Volume;
///成交金额
TThostFtdcMoneyType Turnover;
///持仓量
TThostFtdcLargeVolumeType OpenInterest;
///今收盘
TThostFtdcPriceType ClosePrice;
///本次结算价
TThostFtdcPriceType SettlementPrice;
///涨停板价
TThostFtdcPriceType UpperLimitPrice;
///跌停板价
TThostFtdcPriceType LowerLimitPrice;
///昨虚实度
TThostFtdcRatioType PreDelta;
///今虚实度
TThostFtdcRatioType CurrDelta;
///最后修改时间
TThostFtdcTimeType UpdateTime;
///最后修改毫秒
TThostFtdcMillisecType UpdateMillisec;
///申买价一
TThostFtdcPriceType BidPrice1;
///申买量一
TThostFtdcVolumeType BidVolume1;
///申卖价一
TThostFtdcPriceType AskPrice1;
///申卖量一
TThostFtdcVolumeType AskVolume1;
///申买价二
TThostFtdcPriceType BidPrice2;
///申买量二
TThostFtdcVolumeType BidVolume2;
///申卖价二
TThostFtdcPriceType AskPrice2;
///申卖量二
TThostFtdcVolumeType AskVolume2;
///申买价三
TThostFtdcPriceType BidPrice3;
///申买量三
TThostFtdcVolumeType BidVolume3;
///申卖价三
TThostFtdcPriceType AskPrice3;
///申卖量三
TThostFtdcVolumeType AskVolume3;
///申买价四
TThostFtdcPriceType BidPrice4;
///申买量四
TThostFtdcVolumeType BidVolume4;
///申卖价四
TThostFtdcPriceType AskPrice4;
///申卖量四
TThostFtdcVolumeType AskVolume4;
///申买价五
TThostFtdcPriceType BidPrice5;
///申买量五
TThostFtdcVolumeType BidVolume5;
///申卖价五
TThostFtdcPriceType AskPrice5;
///申卖量五
TThostFtdcVolumeType AskVolume5;
///当日均价
TThostFtdcPriceType AveragePrice;
///业务日期
TThostFtdcDateType ActionDay;
///上带价
TThostFtdcPriceType BandingUpperPrice;
///下带价
TThostFtdcPriceType BandingLowerPrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平现货指数
struct CThostFtdcSyncDeltaIndexPriceField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///指数现货收盘价
TThostFtdcPriceType ClosePrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平仓单折抵
struct CThostFtdcSyncDeltaEWarrantOffsetField
{
///交易日期
TThostFtdcTradeDateType TradingDay;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///数量
TThostFtdcVolumeType Volume;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///SPBM期货合约保证金参数
struct CThostFtdcSPBMFutureParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期货合约因子
TThostFtdcVolumeMultipleType Cvf;
///阶段标识
TThostFtdcTimeRangeType TimeRange;
///品种保证金标准
TThostFtdcRatioType MarginRate;
///期货合约内部对锁仓费率折扣比例
TThostFtdcRatioType LockRateX;
///提高保证金标准
TThostFtdcRatioType AddOnRate;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///期货合约内部对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnLockRateX2;
};
///SPBM期权合约保证金参数
struct CThostFtdcSPBMOptionParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期权合约因子
TThostFtdcVolumeMultipleType Cvf;
///期权冲抵价格
TThostFtdcPriceType DownPrice;
///Delta值
TThostFtdcDeltaType Delta;
///卖方期权风险转换最低值
TThostFtdcDeltaType SlimiDelta;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
};
///SPBM品种内对锁仓折扣参数
struct CThostFtdcSPBMIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///品种内合约间对锁仓费率折扣比例
TThostFtdcRatioType IntraRateY;
///品种内合约间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnIntraRateY2;
};
///SPBM跨品种抵扣参数
struct CThostFtdcSPBMInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRateZ;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///同步SPBM参数结束
struct CThostFtdcSyncSPBMParameterEndField
{
///交易日
TThostFtdcDateType TradingDay;
};
///SPBM期货合约保证金参数查询
struct CThostFtdcQrySPBMFutureParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM期权合约保证金参数查询
struct CThostFtdcQrySPBMOptionParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM品种内对锁仓折扣参数查询
struct CThostFtdcQrySPBMIntraParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///SPBM跨品种抵扣参数查询
struct CThostFtdcQrySPBMInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///组合保证金套餐
struct CThostFtdcSPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///是否启用SPBM
TThostFtdcBoolType IsSPBM;
};
///投资者套餐选择
struct CThostFtdcSPBMInvestorPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
};
///投资者新型组合保证金系数
struct CThostFtdcInvestorPortfMarginRatioField
{
///投资者范围
TThostFtdcInvestorRangeType InvestorRange;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///会员对投资者收取的保证金和交易所对投资者收取的保证金的比例
TThostFtdcRatioType MarginRatio;
///产品群代码
TThostFtdcProductIDType ProductGroupID;
};
///组合保证金套餐查询
struct CThostFtdcQrySPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///投资者套餐选择查询
struct CThostFtdcQrySPBMInvestorPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
};
///投资者新型组合保证金系数查询
struct CThostFtdcQryInvestorPortfMarginRatioField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品群代码
TThostFtdcProductIDType ProductGroupID;
};
///投资者产品SPBM明细
struct CThostFtdcInvestorProdSPBMDetailField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///合约内对锁保证金
TThostFtdcMoneyType IntraInstrMargin;
///买归集保证金
TThostFtdcMoneyType BCollectingMargin;
///卖归集保证金
TThostFtdcMoneyType SCollectingMargin;
///品种内合约间对锁保证金
TThostFtdcMoneyType IntraProdMargin;
///净保证金
TThostFtdcMoneyType NetMargin;
///产品间对锁保证金
TThostFtdcMoneyType InterProdMargin;
///裸保证金
TThostFtdcMoneyType SingleMargin;
///附加保证金
TThostFtdcMoneyType AddOnMargin;
///交割月保证金
TThostFtdcMoneyType DeliveryMargin;
///看涨期权最低风险
TThostFtdcMoneyType CallOptionMinRisk;
///看跌期权最低风险
TThostFtdcMoneyType PutOptionMinRisk;
///卖方期权最低风险
TThostFtdcMoneyType OptionMinRisk;
///买方期权冲抵价值
TThostFtdcMoneyType OptionValueOffset;
///卖方期权权利金
TThostFtdcMoneyType OptionRoyalty;
///价值冲抵
TThostFtdcMoneyType RealOptionValueOffset;
///保证金
TThostFtdcMoneyType Margin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
};
///投资者产品SPBM明细查询
struct CThostFtdcQryInvestorProdSPBMDetailField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///组保交易参数设置
struct CThostFtdcPortfTradeParamSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///新型组保算法
TThostFtdcPortfolioType Portfolio;
///撤单是否验资
TThostFtdcBoolType IsActionVerify;
///平仓是否验资
TThostFtdcBoolType IsCloseVerify;
};
///投资者交易权限设置
struct CThostFtdcInvestorTradingRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///交易权限
TThostFtdcInvstTradingRightType InvstTradingRight;
};
///质押配比参数
struct CThostFtdcMortgageParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///质押配比系数
TThostFtdcRatioType MortgageBalance;
///开仓是否验证质押配比
TThostFtdcBoolType CheckMortgageRatio;
};
///可提控制参数
struct CThostFtdcWithDrawParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///参数代码
TThostFtdcWithDrawParamIDType WithDrawParamID;
///参数代码值
TThostFtdcWithDrawParamValueType WithDrawParamValue;
};
///Thost终端用户功能权限
struct CThostFtdcThostUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///Thost终端功能代码
TThostFtdcThostFunctionCodeType ThostFunctionCode;
};
///Thost终端用户功能权限查询
struct CThostFtdcQryThostUserFunctionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
};
///SPBM附加跨品种抵扣参数
struct CThostFtdcSPBMAddOnInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnInterRateZ2;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///SPBM附加跨品种抵扣参数查询
struct CThostFtdcQrySPBMAddOnInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
};
///投资者商品组SPMM记录查询
struct CThostFtdcQryInvestorCommoditySPMMMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
};
///投资者商品群SPMM记录查询
struct CThostFtdcQryInvestorCommodityGroupSPMMMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///SPMM合约参数查询
struct CThostFtdcQrySPMMInstParamField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///SPMM产品参数查询
struct CThostFtdcQrySPMMProductParamField
{
///产品代码
TThostFtdcSPMMProductIDType ProductID;
};
///投资者商品组SPMM记录
struct CThostFtdcInvestorCommoditySPMMMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///优惠仓位应收保证金
TThostFtdcMoneyType MarginBeforeDiscount;
///不优惠仓位应收保证金
TThostFtdcMoneyType MarginNoDiscount;
///多头实仓风险
TThostFtdcMoneyType LongPosRisk;
///多头开仓冻结风险
TThostFtdcMoneyType LongOpenFrozenRisk;
///多头被平冻结风险
TThostFtdcMoneyType LongCloseFrozenRisk;
///空头实仓风险
TThostFtdcMoneyType ShortPosRisk;
///空头开仓冻结风险
TThostFtdcMoneyType ShortOpenFrozenRisk;
///空头被平冻结风险
TThostFtdcMoneyType ShortCloseFrozenRisk;
///SPMM品种内跨期优惠系数
TThostFtdcSPMMDiscountRatioType IntraCommodityRate;
///SPMM期权优惠系数
TThostFtdcSPMMDiscountRatioType OptionDiscountRate;
///实仓对冲优惠金额
TThostFtdcMoneyType PosDiscount;
///开仓报单对冲优惠金额
TThostFtdcMoneyType OpenFrozenDiscount;
///品种风险净头
TThostFtdcMoneyType NetRisk;
///平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///行权冻结资金
TThostFtdcMoneyType StrikeFrozenMargin;
};
///投资者商品群SPMM记录
struct CThostFtdcInvestorCommodityGroupSPMMMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///优惠仓位应收保证金
TThostFtdcMoneyType MarginBeforeDiscount;
///不优惠仓位应收保证金
TThostFtdcMoneyType MarginNoDiscount;
///多头风险
TThostFtdcMoneyType LongRisk;
///空头风险
TThostFtdcMoneyType ShortRisk;
///商品群平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///SPMM跨品种优惠系数
TThostFtdcSPMMDiscountRatioType InterCommodityRate;
///商品群最小保证金比例
TThostFtdcSPMMDiscountRatioType MiniMarginRatio;
///投资者保证金和交易所保证金的比例
TThostFtdcRatioType AdjustRatio;
///SPMM品种内优惠汇总
TThostFtdcMoneyType IntraCommodityDiscount;
///SPMM跨品种优惠
TThostFtdcMoneyType InterCommodityDiscount;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType InvestorMargin;
///冻结的手续费
TThostFtdcMoneyType FrozenCommission;
///手续费
TThostFtdcMoneyType Commission;
///冻结的资金
TThostFtdcMoneyType FrozenCash;
///资金差额
TThostFtdcMoneyType CashIn;
///行权冻结资金
TThostFtdcMoneyType StrikeFrozenMargin;
};
///SPMM合约参数
struct CThostFtdcSPMMInstParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///SPMM合约保证金算法
TThostFtdcInstMarginCalIDType InstMarginCalID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///SPMM产品参数
struct CThostFtdcSPMMProductParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcSPMMProductIDType ProductID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
};
///席位与交易中心对应关系维护查询
struct CThostFtdcQryTraderAssignField
{
///交易员代码
TThostFtdcTraderIDType TraderID;
};
///席位与交易中心对应关系
struct CThostFtdcTraderAssignField
{
///应用单元代码
TThostFtdcBrokerIDType BrokerID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
};
///投资者申报费阶梯收取设置
struct CThostFtdcInvestorInfoCntSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcProductIDType ProductID;
///是否收取申报费
TThostFtdcBoolType IsCalInfoComm;
///是否限制信息量
TThostFtdcBoolType IsLimitInfoMax;
///信息量限制笔数
TThostFtdcVolumeType InfoMaxLimit;
};
///RCAMS产品组合信息
struct CThostFtdcRCAMSCombProductInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RCAMS同合约风险对冲参数
struct CThostFtdcRCAMSInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///同合约风险对冲比率
TThostFtdcHedgeRateType HedgeRate;
};
///RCAMS品种内风险对冲参数
struct CThostFtdcRCAMSIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///品种内对冲比率
TThostFtdcHedgeRateType HedgeRate;
};
///RCAMS跨品种风险折抵参数
struct CThostFtdcRCAMSInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///折抵率
TThostFtdcHedgeRateType CreditRate;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
};
///RCAMS空头期权风险调整参数
struct CThostFtdcRCAMSShortOptAdjustParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///空头期权风险调整标准
TThostFtdcAdjustValueType AdjustValue;
};
///RCAMS策略组合持仓
struct CThostFtdcRCAMSInvestorCombPositionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///持仓量
TThostFtdcVolumeType TotalAmt;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType Margin;
};
///投资者品种RCAMS保证金
struct CThostFtdcInvestorProdRCAMSMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///品种组合前风险
TThostFtdcMoneyType RiskBeforeDiscount;
///同合约对冲风险
TThostFtdcMoneyType IntraInstrRisk;
///品种买持仓风险
TThostFtdcMoneyType BPosRisk;
///品种卖持仓风险
TThostFtdcMoneyType SPosRisk;
///品种内对冲风险
TThostFtdcMoneyType IntraProdRisk;
///品种净持仓风险
TThostFtdcMoneyType NetRisk;
///品种间对冲风险
TThostFtdcMoneyType InterProdRisk;
///空头期权风险调整
TThostFtdcMoneyType ShortOptRiskAdj;
///空头期权权利金
TThostFtdcMoneyType OptionRoyalty;
///大边组合平仓冻结保证金
TThostFtdcMoneyType MMSACloseFrozenMargin;
///策略组合平仓/行权冻结保证金
TThostFtdcMoneyType CloseCombFrozenMargin;
///平仓/行权冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///大边组合开仓冻结保证金
TThostFtdcMoneyType MMSAOpenFrozenMargin;
///交割月期货开仓冻结保证金
TThostFtdcMoneyType DeliveryOpenFrozenMargin;
///开仓冻结保证金
TThostFtdcMoneyType OpenFrozenMargin;
///投资者冻结保证金
TThostFtdcMoneyType UseFrozenMargin;
///大边组合交易所持仓保证金
TThostFtdcMoneyType MMSAExchMargin;
///交割月期货交易所持仓保证金
TThostFtdcMoneyType DeliveryExchMargin;
///策略组合交易所保证金
TThostFtdcMoneyType CombExchMargin;
///交易所持仓保证金
TThostFtdcMoneyType ExchMargin;
///投资者持仓保证金
TThostFtdcMoneyType UseMargin;
};
///RCAMS产品组合信息查询
struct CThostFtdcQryRCAMSCombProductInfoField
{
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RCAMS同合约风险对冲参数查询
struct CThostFtdcQryRCAMSInstrParameterField
{
///产品代码
TThostFtdcProductIDType ProductID;
};
///RCAMS品种内风险对冲参数查询
struct CThostFtdcQryRCAMSIntraParameterField
{
///产品组合代码
TThostFtdcProductIDType CombProductID;
};
///RCAMS跨品种风险折抵参数查询
struct CThostFtdcQryRCAMSInterParameterField
{
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
};
///RCAMS空头期权风险调整参数查询
struct CThostFtdcQryRCAMSShortOptAdjustParamField
{
///产品组合代码
TThostFtdcProductIDType CombProductID;
};
///RCAMS策略组合持仓查询
struct CThostFtdcQryRCAMSInvestorCombPositionField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
};
///投资者品种RCAMS保证金查询
struct CThostFtdcQryInvestorProdRCAMSMarginField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
};
///RULE合约保证金参数
struct CThostFtdcRULEInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///投机买折算系数
TThostFtdcRatioType BSpecRatio;
///投机卖折算系数
TThostFtdcRatioType SSpecRatio;
///套保买折算系数
TThostFtdcRatioType BHedgeRatio;
///套保卖折算系数
TThostFtdcRatioType SHedgeRatio;
///买附加风险保证金
TThostFtdcMoneyType BAddOnMargin;
///卖附加风险保证金
TThostFtdcMoneyType SAddOnMargin;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///RULE品种内对锁仓折扣参数
struct CThostFtdcRULEIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///标准合约保证金
TThostFtdcMoneyType StdInstrMargin;
///一般月份合约组合保证金系数
TThostFtdcRatioType UsualIntraRate;
///临近交割合约组合保证金系数
TThostFtdcRatioType DeliveryIntraRate;
};
///RULE跨品种抵扣参数
struct CThostFtdcRULEInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRate;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///腿1比例系数
TThostFtdcCommonIntType Leg1PropFactor;
///腿2比例系数
TThostFtdcCommonIntType Leg2PropFactor;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///商品群名称
TThostFtdcInstrumentNameType CommodityGroupName;
};
///RULE合约保证金参数查询
struct CThostFtdcQryRULEInstrParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
};
///RULE品种内对锁仓折扣参数查询
struct CThostFtdcQryRULEIntraParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
};
///RULE跨品种抵扣参数查询
struct CThostFtdcQryRULEInterParameterField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///投资者产品RULE保证金
struct CThostFtdcInvestorProdRULEMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///买标准持仓
TThostFtdcStdPositionType BStdPosition;
///卖标准持仓
TThostFtdcStdPositionType SStdPosition;
///买标准开仓冻结
TThostFtdcStdPositionType BStdOpenFrozen;
///卖标准开仓冻结
TThostFtdcStdPositionType SStdOpenFrozen;
///买标准平仓冻结
TThostFtdcStdPositionType BStdCloseFrozen;
///卖标准平仓冻结
TThostFtdcStdPositionType SStdCloseFrozen;
///品种内对冲标准持仓
TThostFtdcStdPositionType IntraProdStdPosition;
///品种内单腿标准持仓
TThostFtdcStdPositionType NetStdPosition;
///品种间对冲标准持仓
TThostFtdcStdPositionType InterProdStdPosition;
///单腿标准持仓
TThostFtdcStdPositionType SingleStdPosition;
///品种内对锁保证金
TThostFtdcMoneyType IntraProdMargin;
///品种间对锁保证金
TThostFtdcMoneyType InterProdMargin;
///跨品种单腿保证金
TThostFtdcMoneyType SingleMargin;
///非组合合约保证金
TThostFtdcMoneyType NonCombMargin;
///附加保证金
TThostFtdcMoneyType AddOnMargin;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///附加冻结保证金
TThostFtdcMoneyType AddOnFrozenMargin;
///开仓冻结保证金
TThostFtdcMoneyType OpenFrozenMargin;
///平仓冻结保证金
TThostFtdcMoneyType CloseFrozenMargin;
///品种保证金
TThostFtdcMoneyType Margin;
///冻结保证金
TThostFtdcMoneyType FrozenMargin;
};
///投资者产品RULE保证金查询
struct CThostFtdcQryInvestorProdRULEMarginField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
};
///风险结算追平SPBM组合保证金套餐
struct CThostFtdcSyncDeltaSPBMPortfDefinitionField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///是否启用SPBM
TThostFtdcBoolType IsSPBM;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者SPBM套餐选择
struct CThostFtdcSyncDeltaSPBMInvstPortfDefField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组合保证金套餐代码
TThostFtdcPortfolioDefIDType PortfolioDefID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM期货合约保证金参数
struct CThostFtdcSyncDeltaSPBMFutureParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期货合约因子
TThostFtdcVolumeMultipleType Cvf;
///阶段标识
TThostFtdcTimeRangeType TimeRange;
///品种保证金标准
TThostFtdcRatioType MarginRate;
///期货合约内部对锁仓费率折扣比例
TThostFtdcRatioType LockRateX;
///提高保证金标准
TThostFtdcRatioType AddOnRate;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///期货合约内部对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnLockRateX2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM期权合约保证金参数
struct CThostFtdcSyncDeltaSPBMOptionParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///期权合约因子
TThostFtdcVolumeMultipleType Cvf;
///期权冲抵价格
TThostFtdcPriceType DownPrice;
///Delta值
TThostFtdcDeltaType Delta;
///卖方期权风险转换最低值
TThostFtdcDeltaType SlimiDelta;
///昨结算价
TThostFtdcPriceType PreSettlementPrice;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM品种内对锁仓折扣参数
struct CThostFtdcSyncDeltaSPBMIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///品种内合约间对锁仓费率折扣比例
TThostFtdcRatioType IntraRateY;
///品种内合约间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnIntraRateY2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM跨品种抵扣参数
struct CThostFtdcSyncDeltaSPBMInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRateZ;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPBM附加跨品种抵扣参数
struct CThostFtdcSyncDeltaSPBMAddOnInterParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓附加费率折扣比例
TThostFtdcRatioType AddOnInterRateZ2;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM合约参数
struct CThostFtdcSyncDeltaSPMMInstParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///SPMM合约保证金算法
TThostFtdcInstMarginCalIDType InstMarginCalID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM产品相关参数
struct CThostFtdcSyncDeltaSPMMProductParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcSPMMProductIDType ProductID;
///商品组代码
TThostFtdcSPMMProductIDType CommodityID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平投资者SPMM模板选择
struct CThostFtdcSyncDeltaInvestorSPMMModelField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///SPMM模板ID
TThostFtdcSPMMModelIDType SPMMModelID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平SPMM模板参数设置
struct CThostFtdcSyncDeltaSPMMModelParamField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///SPMM模板ID
TThostFtdcSPMMModelIDType SPMMModelID;
///商品群代码
TThostFtdcSPMMProductIDType CommodityGroupID;
///SPMM品种内跨期优惠系数
TThostFtdcSPMMDiscountRatioType IntraCommodityRate;
///SPMM品种间优惠系数
TThostFtdcSPMMDiscountRatioType InterCommodityRate;
///SPMM期权优惠系数
TThostFtdcSPMMDiscountRatioType OptionDiscountRate;
///商品群最小保证金比例
TThostFtdcSPMMDiscountRatioType MiniMarginRatio;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS产品组合信息
struct CThostFtdcSyncDeltaRCAMSCombProdInfoField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///商品组代码
TThostFtdcProductIDType CombProductID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS同合约风险对冲参数
struct CThostFtdcSyncDeltaRCAMSInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品代码
TThostFtdcProductIDType ProductID;
///同合约风险对冲比率
TThostFtdcHedgeRateType HedgeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS品种内风险对冲参数
struct CThostFtdcSyncDeltaRCAMSIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///品种内对冲比率
TThostFtdcHedgeRateType HedgeRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS跨品种风险折抵参数
struct CThostFtdcSyncDeltaRCAMSInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///商品群代码
TThostFtdcProductIDType ProductGroupID;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///折抵率
TThostFtdcHedgeRateType CreditRate;
///产品组合代码1
TThostFtdcProductIDType CombProduct1;
///产品组合代码2
TThostFtdcProductIDType CombProduct2;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS空头期权风险调整参数
struct CThostFtdcSyncDeltaRCAMSSOptAdjParamField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///产品组合代码
TThostFtdcProductIDType CombProductID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///空头期权风险调整标准
TThostFtdcAdjustValueType AdjustValue;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS策略组合规则明细
struct CThostFtdcSyncDeltaRCAMSCombRuleDtlField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///策略产品
TThostFtdcProductIDType ProdGroup;
///策略id
TThostFtdcRuleIdType RuleId;
///优先级
TThostFtdcRCAMSPriorityType Priority;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///组合保证金标准
TThostFtdcMoneyType CombMargin;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RCAMS策略组合持仓
struct CThostFtdcSyncDeltaRCAMSInvstCombPosField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///投套标志
TThostFtdcHedgeFlagType HedgeFlag;
///持仓多空方向
TThostFtdcPosiDirectionType PosiDirection;
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///交易所组合合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///持仓量
TThostFtdcVolumeType TotalAmt;
///交易所保证金
TThostFtdcMoneyType ExchMargin;
///投资者保证金
TThostFtdcMoneyType Margin;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE合约保证金参数
struct CThostFtdcSyncDeltaRULEInstrParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///合约类型
TThostFtdcInstrumentClassType InstrumentClass;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///投机买折算系数
TThostFtdcRatioType BSpecRatio;
///投机卖折算系数
TThostFtdcRatioType SSpecRatio;
///套保买折算系数
TThostFtdcRatioType BHedgeRatio;
///套保卖折算系数
TThostFtdcRatioType SHedgeRatio;
///买附加风险保证金
TThostFtdcMoneyType BAddOnMargin;
///卖附加风险保证金
TThostFtdcMoneyType SAddOnMargin;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE品种内对锁仓折扣参数
struct CThostFtdcSyncDeltaRULEIntraParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///品种代码
TThostFtdcInstrumentIDType ProdFamilyCode;
///标准合约
TThostFtdcInstrumentIDType StdInstrumentID;
///标准合约保证金
TThostFtdcMoneyType StdInstrMargin;
///一般月份合约组合保证金系数
TThostFtdcRatioType UsualIntraRate;
///临近交割合约组合保证金系数
TThostFtdcRatioType DeliveryIntraRate;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///风险结算追平RULE跨品种抵扣参数
struct CThostFtdcSyncDeltaRULEInterParameterField
{
///交易日
TThostFtdcDateType TradingDay;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///优先级
TThostFtdcSpreadIdType SpreadId;
///品种间对锁仓费率折扣比例
TThostFtdcRatioType InterRate;
///第一腿构成品种
TThostFtdcInstrumentIDType Leg1ProdFamilyCode;
///第二腿构成品种
TThostFtdcInstrumentIDType Leg2ProdFamilyCode;
///腿1比例系数
TThostFtdcCommonIntType Leg1PropFactor;
///腿2比例系数
TThostFtdcCommonIntType Leg2PropFactor;
///商品群号
TThostFtdcCommodityGroupIDType CommodityGroupID;
///商品群名称
TThostFtdcInstrumentNameType CommodityGroupName;
///操作标志
TThostFtdcActionDirectionType ActionDirection;
///追平序号
TThostFtdcSequenceNoType SyncDeltaSequenceNo;
};
///服务地址参数
struct CThostFtdcIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易中心名称
TThostFtdcDRIdentityNameType DRIdentityName;
///交易地址OR行情地址
TThostFtdcAddrSrvModeType AddrSrvMode;
///地址版本
TThostFtdcAddrVerType AddrVer;
///服务地址编号
TThostFtdcCommonIntType AddrNo;
///服务地址名称
TThostFtdcAddrNameType AddrName;
///是否是国密地址
TThostFtdcBoolType IsSM;
///是否是内网地址
TThostFtdcBoolType IsLocalAddr;
///地址补充信息
TThostFtdcAddrRemarkType Remark;
///站点
TThostFtdcSiteType Site;
///网络运营商
TThostFtdcNetOperatorType NetOperator;
};
///服务地址参数查询
struct CThostFtdcQryIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///服务地址参数
struct CThostFtdcTGIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///交易中心名称
TThostFtdcDRIdentityNameType DRIdentityName;
///交易地址OR行情地址
TThostFtdcAddrSrvModeType AddrSrvMode;
///地址版本
TThostFtdcAddrVerType AddrVer;
///服务地址编号
TThostFtdcCommonIntType AddrNo;
///服务地址名称
TThostFtdcAddrNameType AddrName;
///是否是国密地址
TThostFtdcBoolType IsSM;
///是否是内网地址
TThostFtdcBoolType IsLocalAddr;
///地址补充信息
TThostFtdcAddrRemarkType Remark;
///站点
TThostFtdcSiteType Site;
///网络运营商
TThostFtdcNetOperatorType NetOperator;
};
///服务地址参数查询
struct CThostFtdcQryTGIpAddrParamField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///App代码
TThostFtdcAppIDType AppID;
};
///TGate会话查询状态
struct CThostFtdcTGSessionQryStatusField
{
///最近30s的查询频率
TThostFtdcCommonIntType LastQryFreq;
///查询状态
TThostFtdcTGSessionQryStatusType QryStatus;
};
///内网地址配置
struct CThostFtdcLocalAddrConfigField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///对端地址
TThostFtdcIpAddrType PeerAddr;
///子网掩码
TThostFtdcIpAddrType NetMask;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///内网服务地址
TThostFtdcIpAddrType LocalAddress;
};
///内网地址配置查询
struct CThostFtdcQryLocalAddrConfigField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///次席查询银行资金帐户信息请求
struct CThostFtdcReqQueryBankAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次席查询银行资金帐户信息回报
struct CThostFtdcRspQueryBankAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次中心发起的转帐交易
struct CThostFtdcReqTransferBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///次中心发起的转帐交易回报
struct CThostFtdcRspTransferBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///安装编号
TThostFtdcInstallIDType InstallID;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///转帐金额
TThostFtdcTradeAmountType TradeAmount;
///期货可取金额
TThostFtdcTradeAmountType FutureFetchAmount;
///费用支付标志
TThostFtdcFeePayFlagType FeePayFlag;
///应收客户费用
TThostFtdcCustFeeType CustFee;
///应收期货公司费用
TThostFtdcFutureFeeType BrokerFee;
///发送方给接收方的消息
TThostFtdcAddInfoType Message;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///转账交易状态
TThostFtdcTransferStatusType TransferStatus;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///查询银行资金帐户信息通知 要发往次席
struct CThostFtdcNotifyQueryFutureAccountBySecField
{
///业务功能码
TThostFtdcTradeCodeType TradeCode;
///银行代码
TThostFtdcBankIDType BankID;
///银行分支机构代码
TThostFtdcBankBrchIDType BankBranchID;
///期商代码
TThostFtdcBrokerIDType BrokerID;
///期商分支机构代码
TThostFtdcFutureBranchIDType BrokerBranchID;
///交易日期
TThostFtdcTradeDateType TradeDate;
///交易时间
TThostFtdcTradeTimeType TradeTime;
///银行流水号
TThostFtdcBankSerialType BankSerial;
///交易系统日期
TThostFtdcTradeDateType TradingDay;
///银期平台消息流水号
TThostFtdcSerialType PlateSerial;
///最后分片标志
TThostFtdcLastFragmentType LastFragment;
///会话号
TThostFtdcSessionIDType SessionID;
///客户姓名
TThostFtdcIndividualNameType CustomerName;
///证件类型
TThostFtdcIdCardTypeType IdCardType;
///证件号码
TThostFtdcIdentifiedCardNoType IdentifiedCardNo;
///客户类型
TThostFtdcCustTypeType CustType;
///银行帐号
TThostFtdcBankAccountType BankAccount;
///银行密码
TThostFtdcPasswordType BankPassWord;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///期货密码
TThostFtdcPasswordType Password;
///期货公司流水号
TThostFtdcFutureSerialType FutureSerial;
///安装编号
TThostFtdcInstallIDType InstallID;
///用户标识
TThostFtdcUserIDType UserID;
///验证客户证件号码标志
TThostFtdcYesNoIndicatorType VerifyCertNoFlag;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///摘要
TThostFtdcDigestType Digest;
///银行帐号类型
TThostFtdcBankAccTypeType BankAccType;
///渠道标志
TThostFtdcDeviceIDType DeviceID;
///期货单位帐号类型
TThostFtdcBankAccTypeType BankSecuAccType;
///期货公司银行编码
TThostFtdcBankCodingForFutureType BrokerIDByBank;
///期货单位帐号
TThostFtdcBankAccountType BankSecuAcc;
///银行密码标志
TThostFtdcPwdFlagType BankPwdFlag;
///期货资金密码核对标志
TThostFtdcPwdFlagType SecuPwdFlag;
///交易柜员
TThostFtdcOperNoType OperNo;
///请求编号
TThostFtdcRequestIDType RequestID;
///交易ID
TThostFtdcTIDType TID;
///银行可用金额
TThostFtdcTradeAmountType BankUseAmount;
///银行可取金额
TThostFtdcTradeAmountType BankFetchAmount;
///错误代码
TThostFtdcErrorIDType ErrorID;
///错误信息
TThostFtdcErrorMsgType ErrorMsg;
///长客户姓名
TThostFtdcLongIndividualNameType LongCustomerName;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///次中心发起转账期货公司流水号
TThostFtdcFutureSerialType SecFutureSerial;
};
///退出紧急状态参数
struct CThostFtdcExitEmergencyField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///新组保保证金系数投资者模板对应关系
struct CThostFtdcInvestorPortfMarginModelField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///保证金系数模板
TThostFtdcInvestorIDType MarginModelID;
};
///投资者新组保设置
struct CThostFtdcInvestorPortfSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
///投机套保标志
TThostFtdcHedgeFlagType HedgeFlag;
///是否开启新组保
TThostFtdcBoolType UsePortf;
};
///投资者新组保设置查询
struct CThostFtdcQryInvestorPortfSettingField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
};
///来自次席的用户口令变更
struct CThostFtdcUserPasswordUpdateFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///来自次席的结算结果确认
struct CThostFtdcSettlementInfoConfirmFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///确认日期
TThostFtdcDateType ConfirmDate;
///确认时间
TThostFtdcTimeType ConfirmTime;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///来自次席的资金账户口令变更
struct CThostFtdcTradingAccountPasswordUpdateFromSecField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者帐号
TThostFtdcAccountIDType AccountID;
///原来的口令
TThostFtdcPasswordType OldPassword;
///新的口令
TThostFtdcPasswordType NewPassword;
///币种代码
TThostFtdcCurrencyIDType CurrencyID;
///次席的交易中心代码
TThostFtdcDRIdentityIDType FromSec;
};
///风控禁止的合约交易权限
struct CThostFtdcRiskForbiddenRightField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者编号
TThostFtdcInvestorIDType InvestorID;
///合约/产品代码
TThostFtdcInstrumentIDType InstrumentID;
///用户代码
TThostFtdcUserIDType UserID;
};
///投资者申报费阶梯收取记录
struct CThostFtdcInvestorInfoCommRecField
{
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcInstrumentIDType InstrumentID;
///报单总笔数
TThostFtdcVolumeType OrderCount;
///撤单总笔数
TThostFtdcVolumeType OrderActionCount;
///询价总次数
TThostFtdcVolumeType ForQuoteCnt;
///申报费
TThostFtdcMoneyType InfoComm;
///是否期权系列
TThostFtdcBoolType IsOptSeries;
///品种代码
TThostFtdcProductIDType ProductID;
///信息量总量
TThostFtdcVolumeType InfoCnt;
};
///投资者申报费阶梯收取记录查询
struct CThostFtdcQryInvestorInfoCommRecField
{
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///商品代码
TThostFtdcInstrumentIDType InstrumentID;
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///组合腿信息
struct CThostFtdcCombLegField
{
///组合合约代码
TThostFtdcInstrumentIDType CombInstrumentID;
///单腿编号
TThostFtdcLegIDType LegID;
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
///买卖方向
TThostFtdcDirectionType Direction;
///单腿乘数
TThostFtdcLegMultipleType LegMultiple;
///派生层数
TThostFtdcImplyLevelType ImplyLevel;
};
///组合腿信息查询
struct CThostFtdcQryCombLegField
{
///单腿合约代码
TThostFtdcInstrumentIDType LegInstrumentID;
};
///输入的对冲设置
struct CThostFtdcInputOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
};
///对冲设置
struct CThostFtdcOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///交易所合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///交易所期权系列号
TThostFtdcExchangeInstIDType ExchangeSerialNo;
///交易所产品代码
TThostFtdcProductIDType ExchangeProductID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///对冲提交状态
TThostFtdcOrderSubmitStatusType OrderSubmitStatus;
///交易日
TThostFtdcDateType TradingDay;
///结算编号
TThostFtdcSettlementIDType SettlementID;
///报单日期
TThostFtdcDateType InsertDate;
///插入时间
TThostFtdcTimeType InsertTime;
///撤销时间
TThostFtdcTimeType CancelTime;
///对冲设置结果
TThostFtdcExecResultType ExecResult;
///序号
TThostFtdcSequenceNoType SequenceNo;
///前置编号
TThostFtdcFrontIDType FrontID;
///会话编号
TThostFtdcSessionIDType SessionID;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作用户代码
TThostFtdcUserIDType ActiveUserID;
///经纪公司报单编号
TThostFtdcSequenceNoType BrokerOffsetSettingSeq;
///申请来源
TThostFtdcApplySrcType ApplySrc;
};
///撤销对冲设置
struct CThostFtdcCancelOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///标的期货合约代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
///申请对冲的合约数量
TThostFtdcVolumeType Volume;
///是否对冲
TThostFtdcBoolType IsOffset;
///请求编号
TThostFtdcRequestIDType RequestID;
///用户代码
TThostFtdcUserIDType UserID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///IP地址
TThostFtdcIPAddressType IPAddress;
///Mac地址
TThostFtdcMacAddressType MacAddress;
///交易所合约代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///交易所期权系列号
TThostFtdcExchangeInstIDType ExchangeSerialNo;
///交易所产品代码
TThostFtdcProductIDType ExchangeProductID;
///交易所交易员代码
TThostFtdcTraderIDType TraderID;
///安装编号
TThostFtdcInstallIDType InstallID;
///会员代码
TThostFtdcParticipantIDType ParticipantID;
///客户代码
TThostFtdcClientIDType ClientID;
///报单操作状态
TThostFtdcOrderActionStatusType OrderActionStatus;
///状态信息
TThostFtdcErrorMsgType StatusMsg;
///操作本地编号
TThostFtdcOrderLocalIDType ActionLocalID;
///操作日期
TThostFtdcDateType ActionDate;
///操作时间
TThostFtdcTimeType ActionTime;
};
///查询对冲设置
struct CThostFtdcQryOffsetSettingField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///产品代码
TThostFtdcProductIDType ProductID;
///对冲类型
TThostFtdcOffsetTypeType OffsetType;
};
///服务地址和AppID的关系
struct CThostFtdcAddrAppIDRelationField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///服务地址
TThostFtdcIpAddrType Address;
///交易中心代码
TThostFtdcDRIdentityIDType DRIdentityID;
///App代码
TThostFtdcAppIDType AppID;
};
///服务地址和AppID的关系查询
struct CThostFtdcQryAddrAppIDRelationField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///微信小程序等用户系统信息
struct CThostFtdcWechatUserSystemInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///微信小程序等用户端系统内部信息长度
TThostFtdcSystemInfoLenType WechatCltSysInfoLen;
///微信小程序等用户端系统内部信息
TThostFtdcClientSystemInfoType WechatCltSysInfo;
///终端IP端口
TThostFtdcIPPortType ClientIPPort;
///登录成功时间
TThostFtdcTimeType ClientLoginTime;
///App代码
TThostFtdcAppIDType ClientAppID;
///用户公网IP
TThostFtdcIPAddressType ClientPublicIP;
///客户登录备注2
TThostFtdcClientLoginRemarkType ClientLoginRemark;
};
///投资者预留信息
struct CThostFtdcInvestorReserveInfoField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
///预留信息
TThostFtdcReserveInfoType ReserveInfo;
};
///查询组织架构投资者对应关系
struct CThostFtdcQryInvestorDepartmentFlatField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///组织架构投资者对应关系
struct CThostFtdcInvestorDepartmentFlatField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
///投资者代码
TThostFtdcInvestorIDType InvestorID;
///组织架构代码
TThostFtdcInvestorIDType DepartmentID;
};
///查询操作员组织架构关系
struct CThostFtdcQryDepartmentUserField
{
///经纪公司代码
TThostFtdcBrokerIDType BrokerID;
};
///前置信息
struct CThostFtdcFrontInfoField
{
///前置地址
TThostFtdcAddressType FrontAddr;
///查询流控
TThostFtdcQueryFreqType QryFreq;
///FTD流控
TThostFtdcQueryFreqType FTDPkgFreq;
};
#endif
================================================
FILE: native/ctp_bridge/api/win/error.dtd
================================================
================================================
FILE: native/ctp_bridge/api/win/error.xml
================================================
================================================
FILE: native/ctp_bridge/build_win.bat
================================================
@echo off
setlocal
chcp 936 >nul
set "VCVARS=D:\Program Files\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
if not exist "%VCVARS%" (
echo [ERROR] vcvars64.bat not found: %VCVARS%
exit /b 1
)
call "%VCVARS%"
if errorlevel 1 (
echo [ERROR] Failed to initialize Visual Studio build environment.
exit /b 1
)
cd /d "%~dp0"
cls
cmake --preset win
if errorlevel 1 exit /b 1
cmake --build --preset win
if errorlevel 1 exit /b 1
echo [OK] Build finished.
exit /b 0
================================================
FILE: native/ctp_bridge/scripts/build_native_bridge.ps1
================================================
param(
[string]$BuildDir = "build",
[string]$Config = "Release"
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
function Write-Step([string]$Message) {
Write-Host "`n==> $Message" -ForegroundColor Cyan
}
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$bridgeRoot = Split-Path -Parent $scriptDir
Write-Step "Configure CMake"
Set-Location $bridgeRoot
& cmake -S . -B $BuildDir
if ($LASTEXITCODE -ne 0) {
throw "cmake configure failed with exit code: $LASTEXITCODE"
}
Write-Step "Build module"
& cmake --build $BuildDir --config $Config --parallel
if ($LASTEXITCODE -ne 0) {
throw "cmake build failed with exit code: $LASTEXITCODE"
}
Write-Step "Done"
Write-Host "Build output: $bridgeRoot/$BuildDir" -ForegroundColor Green
================================================
FILE: native/ctp_bridge/scripts/sync_thost_api.ps1
================================================
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
function Write-Step([string]$Message) {
Write-Host "`n==> $Message" -ForegroundColor Cyan
}
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$bridgeRoot = Split-Path -Parent $scriptDir
$targetApiRoot = Join-Path $bridgeRoot "api"
# 固定源路径:后续只需更新 backend-ctp/api,再执行本脚本即可
$sourceApiRoot = "D:\github\backend-ctp\api"
$srcWin = Join-Path $sourceApiRoot "win"
$srcLinux = Join-Path $sourceApiRoot "linux"
if (-not (Test-Path $srcWin)) {
throw "Source win dir not found: $srcWin"
}
if (-not (Test-Path $srcLinux)) {
throw "Source linux dir not found: $srcLinux"
}
Write-Step "Sync Thost API files from fixed source"
New-Item -ItemType Directory -Path $targetApiRoot -Force | Out-Null
Copy-Item -Path $srcWin -Destination $targetApiRoot -Recurse -Force
Copy-Item -Path $srcLinux -Destination $targetApiRoot -Recurse -Force
Write-Step "Done"
Write-Host "Synced to: $targetApiRoot" -ForegroundColor Green
================================================
FILE: native/ctp_bridge/src/py_module.cpp
================================================
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "ThostFtdcMdApi.h"
#include "ThostFtdcTraderApi.h"
namespace py = pybind11;
namespace {
void copy_cstr(char* dst, size_t dst_size, const std::string& value) {
if (dst == nullptr || dst_size == 0) {
return;
}
std::memset(dst, 0, dst_size);
if (!value.empty()) {
std::strncpy(dst, value.c_str(), dst_size - 1);
}
}
std::string get_str(const py::dict& d, const char* key, const std::string& fallback = "") {
if (!d.contains(py::str(key))) {
return fallback;
}
return py::str(d[py::str(key)]).cast();
}
int get_int(const py::dict& d, const char* key, int fallback = 0) {
if (!d.contains(py::str(key))) {
return fallback;
}
return py::int_(d[py::str(key)]).cast();
}
double get_double(const py::dict& d, const char* key, double fallback = 0.0) {
if (!d.contains(py::str(key))) {
return fallback;
}
return py::float_(d[py::str(key)]).cast();
}
py::str decode_text(const char* value) {
if (value == nullptr) {
return py::str("");
}
const auto len = std::strlen(value);
if (len == 0) {
return py::str("");
}
PyObject* obj = PyUnicode_Decode(value, static_cast(len), "utf-8", "strict");
if (!obj) {
PyErr_Clear();
obj = PyUnicode_Decode(value, static_cast(len), "gb18030", "strict");
}
if (!obj) {
PyErr_Clear();
obj = PyUnicode_Decode(value, static_cast(len), "gbk", "strict");
}
if (!obj) {
PyErr_Clear();
obj = PyUnicode_Decode(value, static_cast(len), "utf-8", "replace");
}
if (!obj) {
PyErr_Clear();
obj = PyUnicode_Decode(value, static_cast(len), "gb18030", "replace");
}
if (!obj) {
PyErr_Clear();
obj = PyUnicode_Decode(value, static_cast(len), "gbk", "replace");
}
if (!obj) {
PyErr_Clear();
obj = PyUnicode_DecodeLatin1(value, static_cast(len), nullptr);
}
if (!obj) {
PyErr_Clear();
return py::str("");
}
return py::reinterpret_steal(obj);
}
} // namespace
class CtpClient;
class TraderSpi final : public CThostFtdcTraderSpi {
public:
explicit TraderSpi(CtpClient* owner) : owner_(owner) {}
void OnFrontConnected() override;
void OnFrontDisconnected(int nReason) override;
void OnRspAuthenticate(CThostFtdcRspAuthenticateField* pRspAuthenticateField, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspUserLogin(CThostFtdcRspUserLoginField* pRspUserLogin, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspError(CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryTradingAccount(CThostFtdcTradingAccountField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryInstrument(CThostFtdcInstrumentField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryOrder(CThostFtdcOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspQryTrade(CThostFtdcTradeField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField* pSettlementInfoConfirm, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspOrderInsert(CThostFtdcInputOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspOrderAction(CThostFtdcInputOrderActionField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRtnOrder(CThostFtdcOrderField* pStruct) override;
void OnRtnTrade(CThostFtdcTradeField* pStruct) override;
private:
CtpClient* owner_;
};
class MdSpi final : public CThostFtdcMdSpi {
public:
explicit MdSpi(CtpClient* owner) : owner_(owner) {}
void OnFrontConnected() override;
void OnFrontDisconnected(int nReason) override;
void OnRspUserLogin(CThostFtdcRspUserLoginField* pRspUserLogin, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspError(CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspSubMarketData(CThostFtdcSpecificInstrumentField* pSpecificInstrument, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField* pSpecificInstrument, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) override;
void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField* pData) override;
private:
CtpClient* owner_;
};
class CtpClient {
public:
CtpClient() = default;
~CtpClient() { stop(); }
void configure(const py::dict& cfg) {
std::lock_guard lk(mu_);
trade_front_ = get_str(cfg, "trade_front", trade_front_);
market_front_ = get_str(cfg, "market_front", market_front_);
broker_id_ = get_str(cfg, "broker_id", broker_id_);
investor_id_ = get_str(cfg, "investor_id", investor_id_);
password_ = get_str(cfg, "password", password_);
appid_ = get_str(cfg, "appid", appid_);
authcode_ = get_str(cfg, "authcode", authcode_);
userinfo_ = get_str(cfg, "userinfo", userinfo_);
ip_ = get_str(cfg, "ip", ip_);
mac_ = get_str(cfg, "mac", mac_);
flow_path_ = get_str(cfg, "flow_path", flow_path_);
request_timeout_ms_ = get_int(cfg, "request_timeout_ms", request_timeout_ms_);
}
void start() {
std::lock_guard lk(mu_);
if (started_) {
return;
}
if (trade_front_.empty() || market_front_.empty() || broker_id_.empty() || investor_id_.empty() || password_.empty() || appid_.empty() || authcode_.empty() || userinfo_.empty()) {
throw std::runtime_error("CTP_NATIVE config missing required fields: "
"trade_front/market_front/broker_id/investor_id/"
"password/appid/authcode/userinfo");
}
std::filesystem::create_directories(flow_path_ + "/trade");
std::filesystem::create_directories(flow_path_ + "/md");
trader_api_ = CThostFtdcTraderApi::CreateFtdcTraderApi((flow_path_ + "/trade").c_str());
md_api_ = CThostFtdcMdApi::CreateFtdcMdApi((flow_path_ + "/md").c_str());
if (!trader_api_ || !md_api_) {
throw std::runtime_error("Create CTP API failed");
}
trader_spi_ = new TraderSpi(this);
md_spi_ = new MdSpi(this);
trader_api_->RegisterSpi(trader_spi_);
trader_api_->SubscribePublicTopic(THOST_TERT_QUICK);
trader_api_->SubscribePrivateTopic(THOST_TERT_QUICK);
trader_api_->RegisterFront((char*)trade_front_.c_str());
md_api_->RegisterSpi(md_spi_);
md_api_->RegisterFront((char*)market_front_.c_str());
started_ = true;
trade_login_ = false;
market_login_ = false;
trader_api_->Init();
md_api_->Init();
}
void stop() {
std::lock_guard lk(mu_);
if (!started_) {
return;
}
started_ = false;
trade_login_ = false;
market_login_ = false;
if (trader_api_) {
trader_api_->RegisterSpi(nullptr);
trader_api_->Release();
trader_api_ = nullptr;
}
if (md_api_) {
md_api_->RegisterSpi(nullptr);
md_api_->Release();
md_api_ = nullptr;
}
delete trader_spi_;
trader_spi_ = nullptr;
delete md_spi_;
md_spi_ = nullptr;
pending_.clear();
request_name_by_id_.clear();
}
void set_event_callback(py::object cb) {
std::lock_guard lk(mu_);
event_callback_ = std::move(cb);
}
py::list request(const std::string& req_name, const py::object& payload) {
if (!started_) {
throw std::runtime_error("CtpClient is not started");
}
py::dict d;
if (py::isinstance(payload)) {
d = payload.cast();
}
int request_id = get_int(d, "RequestID", 0);
bool is_market_req = (req_name == "SubscribeMarketData" || req_name == "UnSubscribeMarketData");
bool is_query_req = req_name.rfind("ReqQry", 0) == 0;
bool is_order_insert = req_name == "ReqOrderInsert";
if (is_market_req && request_id == 0) {
request_id = 0; // 保持与现有通道语义一致
}
if (is_market_req) {
wait_login(/*trade=*/false, /*market=*/true);
} else {
wait_login(/*trade=*/true, /*market=*/false);
}
{
std::lock_guard lk(mu_);
if (!is_order_insert) {
pending_[request_id] = Pending{};
}
if (request_id != 0) {
request_name_by_id_[request_id] = req_name;
}
}
if (is_query_req) {
enforce_query_throttle();
}
int rc = dispatch_request(req_name, request_id, payload);
if (rc < 0) {
py::dict row;
row["ErrorID"] = rc;
row["ErrorMsg"] = "Req dispatch failed";
row["RequestID"] = request_id;
row["bIsLast"] = true;
row["empty"] = true;
std::lock_guard lk(mu_);
pending_.erase(request_id);
request_name_by_id_.erase(request_id);
py::list rows;
rows.append(row);
return rows;
}
if (is_order_insert) {
py::list rows;
return rows;
}
bool timeout = false;
{
py::gil_scoped_release release;
std::unique_lock lk(mu_);
const auto timeout_ms = std::chrono::milliseconds(request_timeout_ms_);
if (!cv_.wait_for(lk, timeout_ms, [&] {
auto it = pending_.find(request_id);
return it == pending_.end() || it->second.done;
})) {
timeout = true;
}
}
py::list out;
std::lock_guard lk(mu_);
auto it = pending_.find(request_id);
if (timeout || it == pending_.end()) {
py::dict row;
row["ErrorID"] = -1001;
row["ErrorMsg"] = "request timeout";
row["RequestID"] = request_id;
row["bIsLast"] = true;
row["empty"] = true;
out.append(row);
pending_.erase(request_id);
request_name_by_id_.erase(request_id);
return out;
}
for (auto& r : it->second.rows) {
out.append(r);
}
pending_.erase(it);
request_name_by_id_.erase(request_id);
return out;
}
// ----- SPI helpers -----
void on_trade_front_connected() {
py::gil_scoped_acquire gil;
py::dict evt;
evt["Reason"] = 0;
emit_event("OnFrontConnected", evt);
CThostFtdcReqAuthenticateField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.UserID, sizeof(req.UserID), investor_id_);
copy_cstr(req.UserProductInfo, sizeof(req.UserProductInfo), userinfo_);
copy_cstr(req.AuthCode, sizeof(req.AuthCode), authcode_);
copy_cstr(req.AppID, sizeof(req.AppID), appid_);
trader_api_->ReqAuthenticate(&req, 1);
}
void on_trade_front_disconnected(int nReason) {
{
std::lock_guard lk(mu_);
trade_login_ = false;
}
cv_login_.notify_all();
py::gil_scoped_acquire gil;
py::dict evt;
evt["Reason"] = nReason;
emit_event("OnFrontDisconnected", evt);
}
void on_trade_auth_rsp(CThostFtdcRspInfoField* pRspInfo, int nRequestID) {
{
py::gil_scoped_acquire gil;
py::dict row;
row["RequestID"] = nRequestID;
row["bIsLast"] = true;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["ErrorMsg"] = decode_text(pRspInfo->ErrorMsg);
} else {
row["ErrorID"] = 0;
}
emit_event("OnRspAuthenticate", row);
}
if (pRspInfo && pRspInfo->ErrorID != 0) {
on_rsp_error(nRequestID, pRspInfo->ErrorID, pRspInfo->ErrorMsg);
return;
}
send_trade_login(nRequestID + 1);
}
void on_trade_login_rsp(CThostFtdcRspUserLoginField* pRspUserLogin, CThostFtdcRspInfoField* pRspInfo, int nRequestID) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["ErrorMsg"] = decode_text(pRspInfo->ErrorMsg);
row["RequestID"] = nRequestID;
row["bIsLast"] = true;
emit_event("OnRspUserLogin", row);
return;
}
{
std::lock_guard lk(mu_);
trade_login_ = true;
}
cv_login_.notify_all();
row["ErrorID"] = 0;
row["RequestID"] = nRequestID;
row["bIsLast"] = true;
if (pRspUserLogin) {
row["TradingDay"] = decode_text(pRspUserLogin->TradingDay);
row["LoginTime"] = decode_text(pRspUserLogin->LoginTime);
row["BrokerID"] = decode_text(pRspUserLogin->BrokerID);
row["UserID"] = decode_text(pRspUserLogin->UserID);
row["SystemName"] = decode_text(pRspUserLogin->SystemName);
row["FrontID"] = pRspUserLogin->FrontID;
row["SessionID"] = pRspUserLogin->SessionID;
row["MaxOrderRef"] = decode_text(pRspUserLogin->MaxOrderRef);
}
emit_event("OnRspUserLogin", row);
int settlement_req_id = nRequestID + 1;
int rc = send_settlement_info_confirm(settlement_req_id);
if (rc < 0) {
py::dict err;
err["ErrorID"] = rc;
err["ErrorMsg"] = "ReqSettlementInfoConfirm dispatch failed";
err["RequestID"] = settlement_req_id;
err["bIsLast"] = true;
emit_event("OnRspSettlementInfoConfirm", err);
}
}
void on_market_front_connected() {
py::gil_scoped_acquire gil;
py::dict evt;
evt["Reason"] = 0;
emit_event("OnFrontConnectedMd", evt);
CThostFtdcReqUserLoginField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.UserID, sizeof(req.UserID), investor_id_);
copy_cstr(req.Password, sizeof(req.Password), password_);
md_api_->ReqUserLogin(&req, 1);
}
void on_market_front_disconnected(int nReason) {
{
std::lock_guard lk(mu_);
market_login_ = false;
}
cv_login_.notify_all();
py::gil_scoped_acquire gil;
py::dict evt;
evt["Reason"] = nReason;
emit_event("OnFrontDisconnectedMd", evt);
}
void on_market_login_rsp(CThostFtdcRspInfoField* pRspInfo) {
{
py::gil_scoped_acquire gil;
py::dict row;
row["RequestID"] = 1;
row["bIsLast"] = true;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["ErrorMsg"] = decode_text(pRspInfo->ErrorMsg);
} else {
row["ErrorID"] = 0;
}
emit_event("OnRspUserLoginMd", row);
}
if (pRspInfo && pRspInfo->ErrorID != 0) {
return;
}
{
std::lock_guard lk(mu_);
market_login_ = true;
}
cv_login_.notify_all();
}
void on_rsp_settlement_info_confirm(CThostFtdcSettlementInfoConfirmField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["ErrorMsg"] = decode_text(pRspInfo->ErrorMsg);
row["empty"] = true;
} else if (pStruct) {
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["ConfirmDate"] = decode_text(pStruct->ConfirmDate);
row["ConfirmTime"] = decode_text(pStruct->ConfirmTime);
row["ErrorID"] = 0;
row["empty"] = false;
} else {
row["ErrorID"] = 0;
row["empty"] = true;
}
row["RequestID"] = nRequestID;
row["bIsLast"] = bIsLast;
bool found_pending = false;
{
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
found_pending = true;
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
if (!found_pending) {
emit_event("OnRspSettlementInfoConfirm", row);
}
}
void on_rsp_error(int request_id, int error_id, const std::string& error_msg = "") {
py::gil_scoped_acquire gil;
py::dict row;
row["ErrorID"] = error_id;
row["RequestID"] = request_id;
if (!error_msg.empty()) {
row["ErrorMsg"] = decode_text(error_msg.c_str());
}
row["bIsLast"] = true;
row["empty"] = true;
std::string req_name;
{
std::lock_guard lk(mu_);
auto req_it = request_name_by_id_.find(request_id);
if (req_it != request_name_by_id_.end()) {
req_name = req_it->second;
request_name_by_id_.erase(req_it);
row["RequestName"] = req_name;
}
auto it = pending_.find(request_id);
if (it != pending_.end()) {
it->second.rows.push_back(row);
it->second.done = true;
cv_.notify_all();
return;
}
}
if (req_name == "ReqOrderInsert") {
emit_event("OnRspOrderInsert", row);
} else if (req_name == "ReqOrderAction") {
emit_event("OnRspOrderAction", row);
} else {
emit_event("OnRspError", row);
}
}
void on_rsp_trading_account(CThostFtdcTradingAccountField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["AccountID"] = decode_text(pStruct->AccountID);
row["Withdraw"] = pStruct->Withdraw;
row["Deposit"] = pStruct->Deposit;
row["PreBalance"] = pStruct->PreBalance;
row["CloseProfit"] = pStruct->CloseProfit;
row["PositionProfit"] = pStruct->PositionProfit;
row["Commission"] = pStruct->Commission;
row["CurrMargin"] = pStruct->CurrMargin;
row["Available"] = pStruct->Available;
row["TradingDay"] = decode_text(pStruct->TradingDay);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_investor_position_detail(CThostFtdcInvestorPositionDetailField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["Direction"] = pStruct->Direction;
row["OpenDate"] = decode_text(pStruct->OpenDate);
row["Volume"] = pStruct->Volume;
row["OpenPrice"] = pStruct->OpenPrice;
row["PositionProfitByTrade"] = pStruct->PositionProfitByTrade;
row["Margin"] = pStruct->Margin;
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_instrument(CThostFtdcInstrumentField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["InstrumentName"] = decode_text(pStruct->InstrumentName);
row["ProductID"] = decode_text(pStruct->ProductID);
row["CreateDate"] = decode_text(pStruct->CreateDate);
row["OpenDate"] = decode_text(pStruct->OpenDate);
row["ExpireDate"] = decode_text(pStruct->ExpireDate);
row["ProductClass"] = pStruct->ProductClass;
row["VolumeMultiple"] = pStruct->VolumeMultiple;
row["PriceTick"] = pStruct->PriceTick;
row["LongMarginRatio"] = pStruct->LongMarginRatio;
row["IsTrading"] = pStruct->IsTrading;
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_instrument_commission_rate(CThostFtdcInstrumentCommissionRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["OpenRatioByMoney"] = pStruct->OpenRatioByMoney;
row["OpenRatioByVolume"] = pStruct->OpenRatioByVolume;
row["CloseRatioByMoney"] = pStruct->CloseRatioByMoney;
row["CloseRatioByVolume"] = pStruct->CloseRatioByVolume;
row["CloseTodayRatioByMoney"] = pStruct->CloseTodayRatioByMoney;
row["CloseTodayRatioByVolume"] = pStruct->CloseTodayRatioByVolume;
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["InvestUnitID"] = decode_text(pStruct->InvestUnitID);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_instrument_margin_rate(CThostFtdcInstrumentMarginRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["HedgeFlag"] = pStruct->HedgeFlag;
row["LongMarginRatioByMoney"] = pStruct->LongMarginRatioByMoney;
row["LongMarginRatioByVolume"] = pStruct->LongMarginRatioByVolume;
row["ShortMarginRatioByMoney"] = pStruct->ShortMarginRatioByMoney;
row["ShortMarginRatioByVolume"] = pStruct->ShortMarginRatioByVolume;
row["IsRelative"] = pStruct->IsRelative;
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["InvestUnitID"] = decode_text(pStruct->InvestUnitID);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_qry_order(CThostFtdcOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
row["Direction"] = pStruct->Direction;
row["CombOffsetFlag"] = pStruct->CombOffsetFlag;
row["LimitPrice"] = pStruct->LimitPrice;
row["VolumeTotalOriginal"] = pStruct->VolumeTotalOriginal;
row["OrderSubmitStatus"] = pStruct->OrderSubmitStatus;
row["OrderStatus"] = pStruct->OrderStatus;
row["VolumeTraded"] = pStruct->VolumeTraded;
row["VolumeTotal"] = pStruct->VolumeTotal;
row["InsertDate"] = decode_text(pStruct->InsertDate);
row["InsertTime"] = decode_text(pStruct->InsertTime);
row["UpdateTime"] = decode_text(pStruct->UpdateTime);
row["CancelTime"] = decode_text(pStruct->CancelTime);
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["OrderSysID"] = decode_text(pStruct->OrderSysID);
row["FrontID"] = pStruct->FrontID;
row["SessionID"] = pStruct->SessionID;
row["StatusMsg"] = decode_text(pStruct->StatusMsg);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_qry_trade(CThostFtdcTradeField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pStruct) {
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
row["UserID"] = decode_text(pStruct->UserID);
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["TradeID"] = decode_text(pStruct->TradeID);
row["Direction"] = pStruct->Direction;
row["OrderSysID"] = decode_text(pStruct->OrderSysID);
row["OffsetFlag"] = pStruct->OffsetFlag;
row["HedgeFlag"] = pStruct->HedgeFlag;
row["Price"] = pStruct->Price;
row["Volume"] = pStruct->Volume;
row["TradeDate"] = decode_text(pStruct->TradeDate);
row["TradeTime"] = decode_text(pStruct->TradeTime);
row["TradeType"] = pStruct->TradeType;
row["TradingDay"] = decode_text(pStruct->TradingDay);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
void on_rsp_order_insert(CThostFtdcInputOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
} else {
row["ErrorID"] = 0;
}
if (pStruct) {
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
row["Direction"] = pStruct->Direction;
row["CombOffsetFlag"] = pStruct->CombOffsetFlag;
row["LimitPrice"] = pStruct->LimitPrice;
row["VolumeTotalOriginal"] = pStruct->VolumeTotalOriginal;
}
row["RequestID"] = nRequestID;
row["bIsLast"] = bIsLast;
if (bIsLast) {
std::lock_guard lk(mu_);
request_name_by_id_.erase(nRequestID);
}
emit_event("OnRspOrderInsert", row);
}
void on_rsp_order_action(CThostFtdcInputOrderActionField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
} else {
row["ErrorID"] = 0;
}
if (pStruct) {
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderSysID"] = decode_text(pStruct->OrderSysID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
}
row["RequestID"] = nRequestID;
row["bIsLast"] = bIsLast;
{
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
}
emit_event("OnRspOrderAction", row);
}
void on_rtn_order(CThostFtdcOrderField* pStruct) {
if (!pStruct) {
return;
}
py::gil_scoped_acquire gil;
py::dict row;
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
row["Direction"] = pStruct->Direction;
row["CombOffsetFlag"] = pStruct->CombOffsetFlag;
row["LimitPrice"] = pStruct->LimitPrice;
row["VolumeTotalOriginal"] = pStruct->VolumeTotalOriginal;
row["OrderSubmitStatus"] = pStruct->OrderSubmitStatus;
row["OrderStatus"] = pStruct->OrderStatus;
row["VolumeTraded"] = pStruct->VolumeTraded;
row["VolumeTotal"] = pStruct->VolumeTotal;
row["InsertDate"] = decode_text(pStruct->InsertDate);
row["InsertTime"] = decode_text(pStruct->InsertTime);
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["OrderSysID"] = decode_text(pStruct->OrderSysID);
row["FrontID"] = pStruct->FrontID;
row["SessionID"] = pStruct->SessionID;
row["UserID"] = decode_text(pStruct->UserID);
row["StatusMsg"] = decode_text(pStruct->StatusMsg);
emit_event("OnRtnOrder", row);
}
void on_rtn_trade(CThostFtdcTradeField* pStruct) {
if (!pStruct) {
return;
}
py::gil_scoped_acquire gil;
py::dict row;
row["BrokerID"] = decode_text(pStruct->BrokerID);
row["InvestorID"] = decode_text(pStruct->InvestorID);
row["InstrumentID"] = decode_text(pStruct->InstrumentID);
row["OrderRef"] = decode_text(pStruct->OrderRef);
row["UserID"] = decode_text(pStruct->UserID);
row["ExchangeID"] = decode_text(pStruct->ExchangeID);
row["TradeID"] = decode_text(pStruct->TradeID);
row["Direction"] = pStruct->Direction;
row["OrderSysID"] = decode_text(pStruct->OrderSysID);
row["OffsetFlag"] = pStruct->OffsetFlag;
row["HedgeFlag"] = pStruct->HedgeFlag;
row["Price"] = pStruct->Price;
row["Volume"] = pStruct->Volume;
row["TradeDate"] = decode_text(pStruct->TradeDate);
row["TradeTime"] = decode_text(pStruct->TradeTime);
row["TradeType"] = pStruct->TradeType;
row["TradingDay"] = decode_text(pStruct->TradingDay);
emit_event("OnRtnTrade", row);
}
void on_rsp_sub_market_data(CThostFtdcSpecificInstrumentField* pSpecificInstrument, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast, bool un_sub) {
py::gil_scoped_acquire gil;
py::dict row;
if (pRspInfo && pRspInfo->ErrorID != 0) {
row["ErrorID"] = pRspInfo->ErrorID;
row["empty"] = true;
} else if (pSpecificInstrument) {
row["InstrumentID"] = decode_text(pSpecificInstrument->InstrumentID);
row["empty"] = false;
} else {
row["empty"] = true;
}
row["bIsLast"] = bIsLast;
std::lock_guard lk(mu_);
auto it = pending_.find(nRequestID);
if (it != pending_.end()) {
it->second.rows.push_back(row);
if (bIsLast) {
it->second.done = true;
request_name_by_id_.erase(nRequestID);
cv_.notify_all();
}
}
(void)un_sub;
}
void on_rtn_depth_market_data(CThostFtdcDepthMarketDataField* pData) {
if (!pData) {
return;
}
py::gil_scoped_acquire gil;
py::dict row;
row["TradingDay"] = decode_text(pData->TradingDay);
row["InstrumentID"] = decode_text(pData->InstrumentID);
row["LastPrice"] = pData->LastPrice;
row["OpenPrice"] = pData->OpenPrice;
row["HighestPrice"] = pData->HighestPrice;
row["LowestPrice"] = pData->LowestPrice;
row["Volume"] = pData->Volume;
row["Turnover"] = pData->Turnover;
row["OpenInterest"] = pData->OpenInterest;
row["UpperLimitPrice"] = pData->UpperLimitPrice;
row["LowerLimitPrice"] = pData->LowerLimitPrice;
row["BidPrice1"] = pData->BidPrice1;
row["BidVolume1"] = pData->BidVolume1;
row["AskPrice1"] = pData->AskPrice1;
row["AskVolume1"] = pData->AskVolume1;
row["ActionDay"] = decode_text(pData->ActionDay);
row["UpdateTime"] = decode_text(pData->ActionDay).cast() + " " + decode_text(pData->UpdateTime).cast() + ":" + std::to_string(pData->UpdateMillisec * 1000);
emit_event("OnRtnDepthMarketData", row);
}
private:
struct Pending {
std::vector rows;
bool done{false};
};
void enforce_query_throttle() {
std::unique_lock lk(mu_);
auto now = std::chrono::steady_clock::now();
auto next_allowed = last_query_at_ + std::chrono::milliseconds(1000);
if (now < next_allowed) {
auto wait_dur = next_allowed - now;
lk.unlock();
std::this_thread::sleep_for(wait_dur);
lk.lock();
}
last_query_at_ = std::chrono::steady_clock::now();
}
void wait_login(bool trade, bool market) {
std::unique_lock lk(mu_);
const auto timeout_ms = std::chrono::milliseconds(request_timeout_ms_);
bool ok = cv_login_.wait_for(lk, timeout_ms, [&] {
bool trade_ok = !trade || trade_login_;
bool market_ok = !market || market_login_;
return trade_ok && market_ok;
});
if (!ok) {
throw std::runtime_error("CTP login timeout");
}
}
void send_trade_login(int req_id) {
CThostFtdcReqUserLoginField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.UserID, sizeof(req.UserID), investor_id_);
copy_cstr(req.Password, sizeof(req.Password), password_);
trader_api_->ReqUserLogin(&req, req_id);
}
int send_settlement_info_confirm(int req_id) {
CThostFtdcSettlementInfoConfirmField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
return trader_api_->ReqSettlementInfoConfirm(&req, req_id);
}
int dispatch_request(const std::string& req_name, int request_id, const py::object& payload) {
py::dict payload_dict;
if (py::isinstance(payload)) {
payload_dict = payload.cast();
}
if (req_name == "ReqQryTradingAccount") {
CThostFtdcQryTradingAccountField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
return trader_api_->ReqQryTradingAccount(&req, request_id);
}
if (req_name == "ReqQryInvestorPositionDetail") {
CThostFtdcQryInvestorPositionDetailField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
return trader_api_->ReqQryInvestorPositionDetail(&req, request_id);
}
if (req_name == "ReqQryInstrument") {
CThostFtdcQryInstrumentField req{};
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
return trader_api_->ReqQryInstrument(&req, request_id);
}
if (req_name == "ReqQryInstrumentCommissionRate") {
CThostFtdcQryInstrumentCommissionRateField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
copy_cstr(req.InvestUnitID, sizeof(req.InvestUnitID), get_str(payload_dict, "InvestUnitID"));
return trader_api_->ReqQryInstrumentCommissionRate(&req, request_id);
}
if (req_name == "ReqQryInstrumentMarginRate") {
CThostFtdcQryInstrumentMarginRateField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
auto hedge_flag = get_str(payload_dict, "HedgeFlag");
req.HedgeFlag = hedge_flag.empty() ? THOST_FTDC_HF_Speculation : hedge_flag[0];
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
copy_cstr(req.InvestUnitID, sizeof(req.InvestUnitID), get_str(payload_dict, "InvestUnitID"));
return trader_api_->ReqQryInstrumentMarginRate(&req, request_id);
}
if (req_name == "ReqQryOrder") {
CThostFtdcQryOrderField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
copy_cstr(req.OrderSysID, sizeof(req.OrderSysID), get_str(payload_dict, "OrderSysID"));
copy_cstr(req.InsertTimeStart, sizeof(req.InsertTimeStart), get_str(payload_dict, "InsertTimeStart"));
copy_cstr(req.InsertTimeEnd, sizeof(req.InsertTimeEnd), get_str(payload_dict, "InsertTimeEnd"));
copy_cstr(req.InvestUnitID, sizeof(req.InvestUnitID), get_str(payload_dict, "InvestUnitID"));
return trader_api_->ReqQryOrder(&req, request_id);
}
if (req_name == "ReqQryTrade") {
CThostFtdcQryTradeField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
copy_cstr(req.TradeID, sizeof(req.TradeID), get_str(payload_dict, "TradeID"));
copy_cstr(req.TradeTimeStart, sizeof(req.TradeTimeStart), get_str(payload_dict, "TradeTimeStart"));
copy_cstr(req.TradeTimeEnd, sizeof(req.TradeTimeEnd), get_str(payload_dict, "TradeTimeEnd"));
copy_cstr(req.InvestUnitID, sizeof(req.InvestUnitID), get_str(payload_dict, "InvestUnitID"));
return trader_api_->ReqQryTrade(&req, request_id);
}
if (req_name == "SubscribeMarketData") {
std::vector ids;
if (py::isinstance(payload)) {
for (auto item : payload.cast()) {
ids.push_back(py::str(item).cast());
}
}
std::vector ptrs;
ptrs.reserve(ids.size());
for (auto& s : ids) {
ptrs.push_back(s.data());
}
return md_api_->SubscribeMarketData(ptrs.data(), static_cast(ptrs.size()));
}
if (req_name == "UnSubscribeMarketData") {
std::vector ids;
if (py::isinstance(payload)) {
for (auto item : payload.cast()) {
ids.push_back(py::str(item).cast());
}
}
std::vector ptrs;
ptrs.reserve(ids.size());
for (auto& s : ids) {
ptrs.push_back(s.data());
}
return md_api_->UnSubscribeMarketData(ptrs.data(), static_cast(ptrs.size()));
}
if (req_name == "ReqOrderInsert") {
CThostFtdcInputOrderField req{};
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.OrderRef, sizeof(req.OrderRef), get_str(payload_dict, "OrderRef"));
req.Direction = get_str(payload_dict, "Direction").empty() ? '\0' : get_str(payload_dict, "Direction")[0];
req.LimitPrice = get_double(payload_dict, "LimitPrice", 0.0);
req.VolumeTotalOriginal = get_int(payload_dict, "VolumeTotalOriginal", 0);
req.OrderPriceType = THOST_FTDC_OPT_LimitPrice;
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
auto cof = get_str(payload_dict, "CombOffsetFlag");
req.CombOffsetFlag[0] = cof.empty() ? '\0' : cof[0];
req.CombHedgeFlag[0] = THOST_FTDC_HF_Speculation;
req.VolumeCondition = THOST_FTDC_VC_AV;
req.MinVolume = 1;
req.ForceCloseReason = THOST_FTDC_FCC_NotForceClose;
req.ContingentCondition = THOST_FTDC_CC_Immediately;
req.IsAutoSuspend = 1;
req.UserForceClose = 0;
req.TimeCondition = THOST_FTDC_TC_GFD;
copy_cstr(req.IPAddress, sizeof(req.IPAddress), ip_);
copy_cstr(req.MacAddress, sizeof(req.MacAddress), mac_);
return trader_api_->ReqOrderInsert(&req, request_id);
}
if (req_name == "ReqOrderAction") {
CThostFtdcInputOrderActionField req{};
copy_cstr(req.BrokerID, sizeof(req.BrokerID), broker_id_);
copy_cstr(req.InvestorID, sizeof(req.InvestorID), investor_id_);
copy_cstr(req.ExchangeID, sizeof(req.ExchangeID), get_str(payload_dict, "ExchangeID"));
copy_cstr(req.UserID, sizeof(req.UserID), get_str(payload_dict, "UserID", investor_id_));
copy_cstr(req.InstrumentID, sizeof(req.InstrumentID), get_str(payload_dict, "InstrumentID"));
copy_cstr(req.OrderSysID, sizeof(req.OrderSysID), get_str(payload_dict, "OrderSysID"));
req.OrderActionRef = request_id + 1;
req.ActionFlag = THOST_FTDC_AF_Delete;
copy_cstr(req.IPAddress, sizeof(req.IPAddress), ip_);
copy_cstr(req.MacAddress, sizeof(req.MacAddress), mac_);
return trader_api_->ReqOrderAction(&req, request_id);
}
return -999;
}
void emit_event(const std::string& topic, const py::dict& row) {
if (event_callback_.is_none()) {
return;
}
try {
event_callback_(topic, row);
} catch (const py::error_already_set& e) {
PyErr_WriteUnraisable(e.value().ptr());
}
}
friend class TraderSpi;
friend class MdSpi;
std::mutex mu_;
std::condition_variable cv_;
std::condition_variable cv_login_;
std::unordered_map pending_;
std::unordered_map request_name_by_id_;
CThostFtdcTraderApi* trader_api_{nullptr};
CThostFtdcMdApi* md_api_{nullptr};
TraderSpi* trader_spi_{nullptr};
MdSpi* md_spi_{nullptr};
bool started_{false};
bool trade_login_{false};
bool market_login_{false};
int request_timeout_ms_{10000};
py::object event_callback_{py::none()};
std::string trade_front_;
std::string market_front_;
std::string broker_id_;
std::string investor_id_;
std::string password_;
std::string appid_;
std::string authcode_;
std::string userinfo_;
std::string ip_;
std::string mac_;
std::string flow_path_{"d:/Github/trader/native/ctp_bridge/flow"};
std::chrono::steady_clock::time_point last_query_at_{};
};
// ----- TraderSpi impl -----
void TraderSpi::OnFrontConnected() { owner_->on_trade_front_connected(); }
void TraderSpi::OnFrontDisconnected(int nReason) { owner_->on_trade_front_disconnected(nReason); }
void TraderSpi::OnRspAuthenticate(CThostFtdcRspAuthenticateField* /*pRspAuthenticateField*/, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool /*bIsLast*/) { owner_->on_trade_auth_rsp(pRspInfo, nRequestID); }
void TraderSpi::OnRspUserLogin(CThostFtdcRspUserLoginField* pRspUserLogin, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool /*bIsLast*/) { owner_->on_trade_login_rsp(pRspUserLogin, pRspInfo, nRequestID); }
void TraderSpi::OnRspError(CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool /*bIsLast*/) {
if (pRspInfo) {
owner_->on_rsp_error(nRequestID, pRspInfo->ErrorID, pRspInfo->ErrorMsg);
}
}
void TraderSpi::OnRspQryTradingAccount(CThostFtdcTradingAccountField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_trading_account(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_investor_position_detail(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryInstrument(CThostFtdcInstrumentField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_instrument(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_instrument_commission_rate(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_instrument_margin_rate(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryOrder(CThostFtdcOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_qry_order(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspQryTrade(CThostFtdcTradeField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_qry_trade(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField* pSettlementInfoConfirm, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_settlement_info_confirm(pSettlementInfoConfirm, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspOrderInsert(CThostFtdcInputOrderField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_order_insert(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRspOrderAction(CThostFtdcInputOrderActionField* pStruct, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_order_action(pStruct, pRspInfo, nRequestID, bIsLast); }
void TraderSpi::OnRtnOrder(CThostFtdcOrderField* pStruct) { owner_->on_rtn_order(pStruct); }
void TraderSpi::OnRtnTrade(CThostFtdcTradeField* pStruct) { owner_->on_rtn_trade(pStruct); }
// ----- MdSpi impl -----
void MdSpi::OnFrontConnected() { owner_->on_market_front_connected(); }
void MdSpi::OnFrontDisconnected(int nReason) { owner_->on_market_front_disconnected(nReason); }
void MdSpi::OnRspUserLogin(CThostFtdcRspUserLoginField* /*pRspUserLogin*/, CThostFtdcRspInfoField* pRspInfo, int /*nRequestID*/, bool /*bIsLast*/) { owner_->on_market_login_rsp(pRspInfo); }
void MdSpi::OnRspError(CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool /*bIsLast*/) {
if (pRspInfo) {
owner_->on_rsp_error(nRequestID, pRspInfo->ErrorID, pRspInfo->ErrorMsg);
}
}
void MdSpi::OnRspSubMarketData(CThostFtdcSpecificInstrumentField* pSpecificInstrument, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_sub_market_data(pSpecificInstrument, pRspInfo, nRequestID, bIsLast, false); }
void MdSpi::OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField* pSpecificInstrument, CThostFtdcRspInfoField* pRspInfo, int nRequestID, bool bIsLast) { owner_->on_rsp_sub_market_data(pSpecificInstrument, pRspInfo, nRequestID, bIsLast, true); }
void MdSpi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField* pData) { owner_->on_rtn_depth_market_data(pData); }
PYBIND11_MODULE(ctp_bridge_native, m) {
m.doc() = "CTP native bridge (pybind11)";
py::class_(m, "CtpClient").def(py::init<>()).def("configure", &CtpClient::configure).def("start", &CtpClient::start).def("stop", &CtpClient::stop).def("set_event_callback", &CtpClient::set_event_callback).def("request", &CtpClient::request);
}
================================================
FILE: panel/__init__.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
================================================
FILE: panel/admin.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.contrib import admin
from django.conf.locale.zh_Hans import formats as zh_formats
from .forms import BrokerForm
from .models import *
zh_formats.DATETIME_FORMAT = "Y-m-d H:i:s"
@admin.register(Address)
class AddressAdmin(admin.ModelAdmin):
list_display = ('name', 'url', 'type', 'operator')
@admin.register(Broker)
class BrokerAdmin(admin.ModelAdmin):
list_display = ('name', 'contract_type', 'trade_address', 'market_address',
'identify', 'username', 'fake', 'cash', 'pre_balance', 'current')
form = BrokerForm
@admin.register(Strategy)
class StrategyAdmin(admin.ModelAdmin):
list_display = ('name', 'broker', 'get_instruments', 'get_force_opens')
@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
list_display = ('instrument', 'price', 'direction', 'offset_flag', 'status', 'send_time', 'update_time')
@admin.register(Instrument)
class InstrumentAdmin(admin.ModelAdmin):
list_display = ('exchange', 'section', 'name', 'product_code', 'sina_code', 'night_trade', 'main_code',
'last_main', 'change_time', 'up_limit_ratio',
'margin_rate', 'fee_money', 'fee_volume', 'price_tick')
ordering = ['-exchange', 'section']
@admin.register(MainBar)
class MainBarAdmin(admin.ModelAdmin):
list_display = ('product_code', 'code', 'time', 'open', 'high', 'low', 'close',
'volume', 'open_interest', 'basis')
search_fields = ('product_code', 'code', 'time',)
@admin.register(DailyBar)
class DailyBarAdmin(admin.ModelAdmin):
list_display = ('exchange', 'code', 'time', 'open', 'high', 'low', 'close', 'volume', 'open_interest')
@admin.register(Trade)
class TradeAdmin(admin.ModelAdmin):
list_display = (
'broker', 'strategy', 'instrument', 'code', 'shares', 'direction', 'open_time', 'close_time',
'avg_entry_price', 'avg_exit_price', 'profit', 'frozen_margin', 'cost')
@admin.register(Param)
class ParamAdmin(admin.ModelAdmin):
list_display = (
'strategy', 'update_time', 'code', 'str_value', 'int_value', 'float_value')
search_fields = ('code',)
@admin.register(Signal)
class SignalAdmin(admin.ModelAdmin):
list_display = (
'strategy', 'instrument', 'code', 'type', 'trigger_value', 'price', 'volume',
'trigger_time', 'priority', 'processed')
search_fields = ('instrument',)
@admin.register(Performance)
class PerformanceAdmin(admin.ModelAdmin):
list_display = (
'broker', 'day', 'capital', 'unit_count', 'NAV', 'accumulated', 'dividend', 'used_margin')
search_fields = ('day',)
================================================
FILE: panel/apps.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.apps import AppConfig
class PanelConfig(AppConfig):
name = 'panel'
verbose_name = "交易后台"
================================================
FILE: panel/const.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.db import models
class ContractType(models.TextChoices):
STOCK = 'STOCK', '股票'
FUTURE = 'FUTURE', '期货'
OPTION = 'OPTION', '期权'
class ExchangeType(models.TextChoices):
SHFE = 'SHFE', '上期所'
DCE = 'DCE', '大商所'
CZCE = 'CZCE', '郑商所'
CFFEX = 'CFFEX', '中金所'
INE = 'INE', '上期能源'
GFEX = 'GFEX', '广交所'
class SectionType(models.TextChoices):
Financial = '金融', '金融'
PreciousMetal = '贵金属', '贵金属'
BaseMetal = '有色金属', '有色金属'
Ferrous = '黑色产业', '黑色产业'
Energy = '能源', '能源'
Chemical = '化工', '化工'
Agriculture = '农牧', '农牧'
NewEnergy = '新能源', '新能源'
class SortType(models.TextChoices):
StockIndex = '股指', '股指'
Treasury = '国债', '国债'
Shipping = '航运', '航运'
Precious = '贵金属', '贵金属'
CopperChain = '铜产业链', '铜产业链'
AluminumChain = '铝产业链', '铝产业链'
OtherNonferrous = '其他有色', '其他有色'
SteelChain = '钢铁链', '钢铁链'
BuildMaterial = '建材', '建材'
CrudeOilChain = '原油链', '原油链'
Olefin = '烯烃', '烯烃'
Aromatic = '芳烃', '芳烃'
Rubber = '橡胶', '橡胶'
CoalChem = '煤化工', '煤化工'
OilFat = '油脂油料', '油脂油料'
GrainFeed = '谷物饲料', '谷物饲料'
SoftAgri = '软商品', '软商品'
Livestock = '畜牧', '畜牧'
Forestry = '林纸', '林纸'
NewEnergyMat = '新能源材料', '新能源材料'
class AddressType(models.TextChoices):
TRADE = 'TRADE', '交易'
MARKET = 'MARKET', '行情'
class OperatorType(models.TextChoices):
TELECOM = 'TELECOM', '电信'
UNICOM = 'UNICOM', '联通'
class DirectionType(models.TextChoices):
LONG = '0', '多'
SHORT = '1', '空'
class CombOffsetFlag(models.TextChoices): # 订单开平标志
Open = '0', '开'
Close = '1', '平'
ForceClose = '2', '强平'
CloseToday = '3', '平'
CloseYesterday = '4', '平昨'
ForceOff = '5', '强减'
LocalForceClose = '6', '本地强平'
class OffsetFlag(models.TextChoices): # 开平标志
Open = '0', '开'
Close = '1', '平'
ForceClose = '2', '强平'
CloseToday = '3', '平今'
CloseYesterday = '4', '平昨'
ForceOff = '5', '强减'
LocalForceClose = '6', '本地强平'
class OrderStatus(models.TextChoices): # 报单状态
AllTraded = '0', '全部成交'
PartTradedQueueing = '1', '部分成交还在队列中'
PartTradedNotQueueing = '2', '部分成交不在队列中'
NoTradeQueueing = '3', '未成交还在队列中'
NoTradeNotQueueing = '4', '未成交不在队列中'
Canceled = '5', '撤单'
Unknown = 'a', '未知'
NotTouched = 'b', '尚未触发'
Touched = 'c', '已触发'
class OrderSubmitStatus(models.TextChoices): # 报单提交状态
InsertSubmitted = '0', '已经提交'
CancelSubmitted = '1', '撤单已经提交'
ModifySubmitted = '2', '修改已经提交'
Accepted = '3', '已经接受'
InsertRejected = '4', '报单已经被拒绝'
CancelRejected = '5', '撤单已经被拒绝'
ModifyRejected = '6', '改单已经被拒绝'
DCE_NAME_CODE = {
'豆一': 'a',
'豆二': 'b',
'胶合板': 'bb',
'玉米': 'c',
'玉米淀粉': 'cs',
'纤维板': 'fb',
'铁矿石': 'i',
'焦炭': 'j',
'鸡蛋': 'jd',
'焦煤': 'jm',
'聚乙烯': 'l',
'豆粕': 'm',
'棕榈油': 'p',
'聚丙烯': 'pp',
'聚氯乙烯': 'v',
'苯乙烯': 'eb',
'乙二醇': 'eg',
'液化石油气': 'pg',
'生猪': 'lh',
'粳米': 'rr',
'豆油': 'y',
'原木': 'lg',
'纯苯': 'bz',
}
MONTH_CODE = {
1: "F",
2: "G",
3: "H",
4: "J",
5: "K",
6: "M",
7: "N",
8: "Q",
9: "U",
10: "V",
11: "X",
12: "Z"
}
KT_MARKET = {
'DL': 'DCE',
'DY': 'DCE',
'SQ': 'SHFE',
'SY': 'SHFE',
'ZJ': 'CFFEX',
'ZZ': 'CZCE',
'ZY': 'CZCE',
}
class SignalType(models.TextChoices):
ROLL_CLOSE = 'ROLL_CLOSE', '换月平旧'
ROLL_OPEN = 'ROLL_OPEN', '换月开新'
BUY = 'BUY', '买开'
SELL_SHORT = 'SELL_SHORT', '卖开'
SELL = 'SELL', '卖平'
BUY_COVER = 'BUY_COVER', '买平'
class PriorityType(models.IntegerChoices):
LOW = 0, '低'
Normal = 1, '普通'
High = 2, '高'
================================================
FILE: panel/forms.py
================================================
from django import forms
from .models import *
class BrokerForm(forms.ModelForm):
password = forms.CharField(label='密码', widget=forms.PasswordInput)
class Meta:
model = Broker
exclude = []
================================================
FILE: panel/models.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pandas as pd
from pandas.io.sql import read_sql_query
from django.db import models
from django.db import connection
from django.core.exceptions import EmptyResultSet
from .const import *
def to_df(queryset, index_col=None, parse_dates=None):
"""
:param queryset: django.db.models.query.QuerySet
:param index_col: str or list of str, optional, default: None
:param parse_dates: list or dict, default: None
:return: pandas.core.frame.DataFrame
"""
try:
query, params = queryset.query.sql_with_params()
except EmptyResultSet:
# Occurs when Django tries to create an expression for a
# query which will certainly be empty
# e.g. Book.objects.filter(author__in=[])
return pd.DataFrame()
return read_sql_query(query, connection, params=params, index_col=index_col, parse_dates=parse_dates)
class Autonumber(models.Model):
id = models.AutoField(verbose_name='自增值', primary_key=True)
create_date = models.DateTimeField(verbose_name='生成时间', auto_now_add=True)
class Address(models.Model):
name = models.CharField(verbose_name='名称', max_length=64)
url = models.CharField(verbose_name='地址', max_length=128)
type = models.CharField(verbose_name='类型', max_length=16, choices=AddressType.choices)
operator = models.CharField(verbose_name='运营商', max_length=16, choices=OperatorType.choices)
class Meta:
verbose_name = '前置地址'
verbose_name_plural = '前置地址列表'
def __str__(self):
return '{}{}-{}'.format(self.name, self.get_operator_display(), self.get_type_display()) # type: ignore[attr-defined]
class Broker(models.Model):
name = models.CharField(verbose_name='名称', max_length=64)
contract_type = models.CharField(verbose_name='市场', max_length=32, choices=ContractType.choices)
trade_address = models.ForeignKey(Address, verbose_name='交易前置', on_delete=models.CASCADE, related_name='trade_address')
market_address = models.ForeignKey(Address, verbose_name='行情前置', on_delete=models.CASCADE,
related_name='market_address')
identify = models.CharField(verbose_name='唯一标志', max_length=32)
username = models.CharField(verbose_name='用户名', max_length=32)
password = models.CharField(verbose_name='密码', max_length=32)
fake = models.DecimalField(verbose_name='虚拟资金', null=True, max_digits=12, decimal_places=2)
cash = models.DecimalField(verbose_name='可用资金', null=True, max_digits=12, decimal_places=2)
current = models.DecimalField(verbose_name='动态权益', null=True, max_digits=12, decimal_places=2)
pre_balance = models.DecimalField(verbose_name='静态权益', null=True, max_digits=12, decimal_places=2)
margin = models.DecimalField(verbose_name='保证金', null=True, max_digits=12, decimal_places=2)
class Meta:
verbose_name = '账户'
verbose_name_plural = '账户列表'
def __str__(self):
return '{}-{}'.format(self.name, self.get_contract_type_display()) # type: ignore[attr-defined]
class Performance(models.Model):
broker = models.ForeignKey(Broker, verbose_name='账户', on_delete=models.CASCADE)
day = models.DateField(verbose_name='日期')
capital = models.DecimalField(verbose_name='资金', max_digits=12, decimal_places=2)
unit_count = models.IntegerField(verbose_name='单位乘数', null=True)
NAV = models.DecimalField(verbose_name='单位净值', max_digits=8, decimal_places=3, null=True)
accumulated = models.DecimalField(verbose_name='累计净值', max_digits=8, decimal_places=3, null=True)
dividend = models.DecimalField(verbose_name='分红', max_digits=12, decimal_places=2, null=True)
used_margin = models.DecimalField(verbose_name='占用保证金', null=True, max_digits=12, decimal_places=2)
fake = models.DecimalField(verbose_name='虚拟', max_digits=12, decimal_places=2, null=True)
class Meta:
verbose_name = '绩效'
verbose_name_plural = '绩效列表'
def __str__(self):
return '{}-{}'.format(self.broker, self.NAV)
class Strategy(models.Model):
broker = models.ForeignKey(Broker, verbose_name='账户', on_delete=models.CASCADE)
name = models.CharField(verbose_name='名称', max_length=64)
instruments = models.ManyToManyField('Instrument', verbose_name='交易品种')
force_opens = models.ManyToManyField('Instrument', verbose_name='手动开仓', related_name='force_opens', blank=True)
class Meta:
verbose_name = '策略'
verbose_name_plural = '策略列表'
def __str__(self):
return '{}'.format(self.name)
def get_instruments(self):
return [inst for inst in self.instruments.all()]
get_instruments.short_description = '交易合约' # type: ignore[attr-defined]
get_instruments.allow_tags = True # type: ignore[attr-defined]
def get_force_opens(self):
return [inst for inst in self.force_opens.all()]
get_force_opens.short_description = '手动开仓' # type: ignore[attr-defined]
get_force_opens.allow_tags = True # type: ignore[attr-defined]
class Param(models.Model):
strategy = models.ForeignKey(Strategy, verbose_name='策略', on_delete=models.CASCADE)
code = models.CharField('参数名', max_length=64)
str_value = models.CharField('字符串值', max_length=128, null=True, blank=True)
int_value = models.IntegerField('整数值', null=True, blank=True)
float_value = models.DecimalField('浮点值', null=True, max_digits=12, decimal_places=3, blank=True)
update_time = models.DateTimeField('更新时间', auto_now=True)
class Meta:
verbose_name = '策略参数'
verbose_name_plural = '策略参数列表'
def __str__(self):
return '{}: {} = {}'.format(
self.strategy, self.code,
next((v for v in [self.str_value, self.int_value, self.float_value] if v is not None), '-'))
class Instrument(models.Model):
exchange = models.CharField('交易所', max_length=8, choices=ExchangeType.choices)
section = models.CharField('分类', max_length=48, null=True, blank=True, choices=SectionType.choices)
sort = models.CharField('品种', max_length=48, null=True, blank=True, choices=SortType.choices)
name = models.CharField('名称', max_length=32, null=True, blank=True)
product_code = models.CharField('代码', max_length=16, unique=True)
all_inst = models.CharField('品种列表', max_length=256, null=True, blank=True)
main_code = models.CharField('主力合约', max_length=16, null=True, blank=True)
last_main = models.CharField('上个主力', max_length=16, null=True, blank=True)
change_time = models.DateTimeField('切换时间', null=True, blank=True)
night_trade = models.BooleanField('夜盘', default=False)
volume_multiple = models.IntegerField('合约乘数', null=True, blank=True)
price_tick = models.DecimalField('最小变动', max_digits=8, decimal_places=3, null=True, blank=True)
margin_rate = models.DecimalField('保证金率', max_digits=6, decimal_places=5, null=True, blank=True)
fee_money = models.DecimalField('金额手续费', max_digits=7, decimal_places=6, null=True, blank=True)
fee_volume = models.DecimalField('手数手续费', max_digits=6, decimal_places=2, null=True, blank=True)
up_limit_ratio = models.DecimalField('涨停幅度', max_digits=3, decimal_places=2, null=True, blank=True)
down_limit_ratio = models.DecimalField('跌停幅度', max_digits=3, decimal_places=2, null=True, blank=True)
class Meta:
verbose_name = '合约'
verbose_name_plural = '合约列表'
def __str__(self):
return '{}.{}'.format(self.get_exchange_display(), self.name) # type: ignore[attr-defined]
class Signal(models.Model):
strategy = models.ForeignKey(Strategy, verbose_name='策略', on_delete=models.CASCADE)
instrument = models.ForeignKey(Instrument, verbose_name='品种', on_delete=models.CASCADE)
code = models.CharField('当前合约', max_length=16, null=True)
type = models.CharField('信号类型', max_length=16, choices=SignalType.choices)
trigger_value = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='触发值', null=True, blank=True)
price = models.DecimalField('价格', max_digits=12, decimal_places=3, null=True, blank=True)
volume = models.IntegerField('数量', null=True, blank=True)
trigger_time = models.DateTimeField('发生时间')
priority = models.IntegerField('优先级', choices=PriorityType.choices, default=PriorityType.Normal) # type: ignore[arg-type]
processed = models.BooleanField('已处理', default=False, blank=True)
class Meta:
verbose_name = '信号'
verbose_name_plural = '信号列表'
def __str__(self):
return f"{self.instrument}({self.code}){self.type}{self.volume}手" \
f"{'(夜)' if self.instrument.night_trade else ''}"
class MainBar(models.Model):
exchange = models.CharField('交易所', max_length=8, choices=ExchangeType.choices)
product_code = models.CharField('品种代码', max_length=8, null=True, db_index=True)
code = models.CharField('合约代码', max_length=16, null=True, blank=True)
time = models.DateField('时间', db_index=True)
open = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='开盘价')
high = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='最高价')
low = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='最低价')
close = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='收盘价')
settlement = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='结算价', null=True)
volume = models.IntegerField('成交量')
open_interest = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='持仓量')
basis = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='基差', null=True)
class Meta:
verbose_name = '主力连续日K线'
verbose_name_plural = '主力连续日K线列表'
def __str__(self):
return '{}.{}'.format(self.exchange, self.product_code)
class DailyBar(models.Model):
exchange = models.CharField('交易所', max_length=8, choices=ExchangeType.choices)
code = models.CharField('品种代码', max_length=16, null=True, db_index=True)
expire_date = models.IntegerField('交割时间', null=True)
time = models.DateField('时间', db_index=True)
open = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='开盘价')
high = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='最高价')
low = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='最低价')
close = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='收盘价')
settlement = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='结算价', null=True)
volume = models.IntegerField('成交量')
open_interest = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='持仓量')
class Meta:
verbose_name = '日K线'
verbose_name_plural = '日K线列表'
def __str__(self):
return '{}.{}'.format(self.exchange, self.code)
class Order(models.Model):
broker = models.ForeignKey(Broker, verbose_name='账户', on_delete=models.CASCADE)
strategy = models.ForeignKey(Strategy, verbose_name='策略', on_delete=models.SET_NULL, null=True, blank=True)
order_ref = models.CharField('报单号', max_length=13)
instrument = models.ForeignKey(Instrument, verbose_name='品种', on_delete=models.CASCADE)
code = models.CharField('合约代码', max_length=16, null=True, blank=True)
front = models.IntegerField('前置编号')
session = models.IntegerField('会话编号')
price = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='报单价格')
volume = models.IntegerField('手数', blank=True, null=True)
direction = models.CharField('方向', max_length=8, choices=DirectionType.choices)
offset_flag = models.CharField('开平', max_length=8, choices=OffsetFlag.choices)
status = models.CharField('状态', max_length=16, choices=OrderStatus.choices)
send_time = models.DateTimeField('发送时间')
update_time = models.DateTimeField('更新时间')
signal = models.OneToOneField(Signal, verbose_name='信号', on_delete=models.SET_NULL, null=True, blank=True)
class Meta:
verbose_name = '报单'
verbose_name_plural = '报单列表'
def __str__(self):
return '{}-{}'.format(self.instrument, self.get_offset_flag_display()) # type: ignore[attr-defined]
class Trade(models.Model):
broker = models.ForeignKey(Broker, verbose_name='账户', on_delete=models.CASCADE)
strategy = models.ForeignKey(Strategy, verbose_name='策略', on_delete=models.SET_NULL, null=True, blank=True)
instrument = models.ForeignKey(Instrument, verbose_name='品种', on_delete=models.CASCADE)
open_order = models.OneToOneField(Order, verbose_name='开仓报单', on_delete=models.SET_NULL,
related_name='open_order', null=True, blank=True)
close_order = models.OneToOneField(Order, verbose_name='平仓报单', on_delete=models.SET_NULL,
related_name='close_order', null=True, blank=True)
code = models.CharField('合约代码', max_length=16, null=True, blank=True)
direction = models.CharField('方向', max_length=8, choices=DirectionType.choices)
open_time = models.DateTimeField('开仓日期')
close_time = models.DateTimeField('平仓日期', null=True, blank=True)
shares = models.IntegerField('手数', null=True, blank=True)
filled_shares = models.IntegerField('已成交手数', null=True, blank=True)
closed_shares = models.IntegerField('已平仓手数', null=True, blank=True)
avg_entry_price = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='持仓均价', null=True, blank=True)
avg_exit_price = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='平仓均价', null=True, blank=True)
profit = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='持仓盈亏', null=True, blank=True)
frozen_margin = models.DecimalField(max_digits=12, decimal_places=3, verbose_name='冻结保证金', null=True, blank=True)
cost = models.DecimalField(max_digits=12, decimal_places=2, verbose_name='手续费', null=True, blank=True)
class Meta:
verbose_name = '交易记录'
verbose_name_plural = '交易记录列表'
def __str__(self):
return '{}{}{}手'.format(self.instrument, self.direction, self.shares)
================================================
FILE: panel/templatetags/__init__.py
================================================
================================================
FILE: panel/templatetags/custom_tag.py
================================================
# coding=utf-8
from django import template
register = template.Library()
@register.filter
def number(obj):
return '%g' % obj
@register.filter
def change_strategy(request, new):
return request.get_full_path().replace(
'strategy={}'.format(request.GET['strategy']), 'strategy={}'.format(new))
@register.filter
def in_group(user, group_name):
return user.groups.filter(name=group_name).exists()
@register.filter
def format_query_string(request):
variables = request.GET.copy()
if 'page' in variables:
del variables['page']
return '&{0}'.format(variables.urlencode())
@register.filter
def all_query_param(request):
return request.GET.urlencode()
@register.filter
def left_bar(request):
left_open = request.COOKIES.get("open", "false")
if left_open == "true":
return "nav-md"
return "nav-sm"
@register.filter
def can_edit(db_obj, user):
return db_obj.has_edit_perm(user)
@register.filter
def split_ip(ip):
return " ".join(ip.split(","))
================================================
FILE: panel/tests.py
================================================
from django.test import TestCase
# Create your tests here.
================================================
FILE: panel/urls.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.urls import re_path
from .views import *
app_name = 'dashboard'
urlpatterns = [
re_path(r'^status$', StatusView.as_view(
template_name='panel/status.html'), name="status_view"),
re_path(r'^status_data', status_data, name='get_status_data'),
re_path(r'^performance$', PerformanceView.as_view(
template_name='panel/performance.html'), name="performance_view"),
re_path(r'^nav_data', nav_data, name='get_nav_data'),
re_path(r'^instrument$', InstrumentView.as_view(
template_name='panel/instrument.html'), name='instrument_view'),
re_path(r'^bar_data', bar_data, name='get_bar_data'),
re_path(r'^correlation$', CorrelationView.as_view(
template_name='panel/correlation.html'), name="correlation_view"),
re_path(r'^corr_data', corr_data, name='get_corr_data'),
]
================================================
FILE: panel/views.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import datetime
import orjson
from django.db.models import Q
from django.views.decorators.cache import cache_page
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from django.utils import timezone
from django.views.generic import TemplateView
import logging
import pytz
from panel.models import *
logger = logging.getLogger('panel.view')
class CustomBaseView(LoginRequiredMixin, TemplateView):
def get_context_data(self, **kwargs):
context = super(CustomBaseView, self).get_context_data(**kwargs)
context['cur_stra'] = Strategy.objects.get(id=self.request.GET.get('strategy'))
context['stra_list'] = Strategy.objects.all()
return context
class StatusView(CustomBaseView):
def get_context_data(self, **kwargs):
context = super(StatusView, self).get_context_data(**kwargs)
stra = context['cur_stra']
trades = Trade.objects.filter(strategy=stra, close_time__isnull=True).values_list(
'frozen_margin', flat=True)
context['current'] = stra.broker.current
context['pre_balance'] = stra.broker.pre_balance
context['margin'] = round(100 * sum(trades) / stra.broker.current, 1)
context['pos_list'] = Trade.objects.filter(strategy=stra, close_time__isnull=True).order_by('-profit')
context['open_list'] = Signal.objects.filter(
Q(type=SignalType.BUY) | Q(type=SignalType.SELL_SHORT), strategy=stra, processed=False)
context['close_list'] = Signal.objects.filter(
Q(type=SignalType.BUY_COVER) | Q(type=SignalType.SELL), strategy=stra,
processed=False).values_list('code', flat=True)
context['roll_list'] = Signal.objects.filter(
type=SignalType.ROLL_CLOSE, strategy=stra, processed=False).values_list('code', flat=True)
return context
class PerformanceView(CustomBaseView):
pass
class CorrelationView(CustomBaseView):
def get_context_data(self, **kwargs):
context = super(CorrelationView, self).get_context_data(**kwargs)
sections = context['cur_stra'].instruments.order_by('section').values_list('section', flat=True).distinct()
inst_list = list()
for sec in sections:
inst_list.append((SectionType(sec).label, context['cur_stra'].instruments.filter(
section=sec).order_by('-exchange')))
context['inst_list'] = inst_list
context['strategy_inst'] = context['cur_stra'].instruments.values_list('id', flat=True)
return context
class InstrumentView(CustomBaseView):
def get_context_data(self, **kwargs):
context = super(InstrumentView, self).get_context_data(**kwargs)
exchanges = Instrument.objects.all().values_list('exchange', flat=True).distinct()
inst_list = dict()
for ex in exchanges:
inst_list[ExchangeType(ex).label] = context['cur_stra'].instruments.filter(exchange=ex)
context['inst_list'] = inst_list
return context
# @cache_page(3600 * 24)
def nav_data(request):
q = Performance.objects.filter(broker__strategy__id=request.GET.get('strategy')).order_by(
'-day').values_list('day', 'NAV')
rst = []
for day, val in q:
rst.append([day.isoformat(), float(val)])
return JsonResponse(rst, safe=False)
@cache_page(3600 * 24)
def bar_data(request):
try:
inst_id = request.GET['inst_id']
inst = Instrument.objects.get(id=inst_id)
break_n = Strategy.objects.first().param_set.get(code='BreakPeriod').int_value + 1
q = MainBar.objects.filter(product_code=inst.product_code).order_by('time').values_list(
'time', 'open', 'close', 'low', 'high')
rst = {'up': [], 'down': [], 'k': [], 'x': [], 'trade': [], 'title': str(inst)}
for day, oo, cc, ll, hh in q:
rst['x'].append(day.isoformat())
rst['k'].append([float(oo), float(cc), float(ll), float(hh)])
rst['up'].append(max(x[2] for x in rst['k'][-break_n:]))
rst['down'].append(min(x[2] for x in rst['k'][-break_n:]))
for t in Trade.objects.filter(
instrument_id=inst_id, strategy_id=request.GET.get('strategy')).order_by('open_time'):
if t.close_time is None:
close_price = rst['k'][-1][1]
close_time = rst['x'][-1]
if t.profit is None:
continue
else:
close_price = t.avg_exit_price
close_time = timezone.localtime(t.close_time, pytz.FixedOffset(480)).date().isoformat()
rst['trade'].append([
{
'name': '{}至{} {}仓{}手'.format(
t.open_time, close_time, t.direction, t.shares),
'coord': [timezone.localtime(t.open_time, pytz.FixedOffset(480)).date().isoformat(),
t.avg_entry_price],
'lineStyle': {
'normal': {
'color': '#00f' if t.profit > 0 else '#fff'
}
},
},
{
'coord': [close_time, close_price]
}])
return JsonResponse(rst, safe=False)
except Exception as e:
logger.error('bar_data failed: %s', e, exc_info=True)
def calc_corr(year: int, inst_list: list):
category = list()
day = datetime.datetime.today()
price_dict = dict()
begin_day = day.replace(year=day.year - year)
for inst in Instrument.objects.filter(id__in=inst_list):
category.append(inst.name)
price_dict[inst.product_code] = to_df(MainBar.objects.filter(
time__gte=begin_day.date(), exchange=inst.exchange,
product_code=inst.product_code).order_by('time').values_list('time', 'close'))
price_dict[inst.product_code].index = pd.DatetimeIndex(price_dict[inst.product_code].time)
price_dict[inst.product_code]['price'] = price_dict[inst.product_code].close.pct_change()
return category, pd.DataFrame({k: v.price for k, v in price_dict.items()}).corr()
@cache_page(3600 * 24)
def corr_data(request):
try:
year = int(request.GET.get('year'))
insts = orjson.loads(request.GET.get('insts'))
category, corr_pd = calc_corr(year, insts)
length = corr_pd.shape[0]
corr_x = pd.DataFrame([corr_pd.iloc[i, j] for i in range(length) for j in range(i+1, length)])
return JsonResponse({
'data': [[category[i], category[j], round(corr_pd.iloc[i, j], 2)]
for i in range(length) for j in range(i+1, length)],
'score': round((((1 - (corr_x.abs() ** 2).mean()[0]) * 100) - 80) * 5, 1),
'index': category}, safe=False)
except Exception as e:
logger.error('corr_data failed: %s', e, exc_info=True)
def status_data(request):
try:
stra = Strategy.objects.get(id=request.GET.get('strategy'))
return JsonResponse({
'section_labels': [s.label for s in SectionType],
'section': [
Trade.objects.filter(
strategy=stra, close_time__isnull=True,
instrument__section=s.value).count()
for s in SectionType
],
'long': Trade.objects.filter(
strategy=stra, close_time__isnull=True, direction=DirectionType.LONG).count(),
'short': Trade.objects.filter(
strategy=stra, close_time__isnull=True, direction=DirectionType.SHORT).count()
}, safe=False)
except Exception as e:
logger.error('status_data failed: %s', e, exc_info=True)
================================================
FILE: requirements.txt
================================================
aiohttp[speedups]
orjson
appdirs
django
beautifulsoup4
lxml
requests
numpy
pandas
TA-Lib
croniter
chinese_calendar
asynctest
mysqlclient
tqdm
pytz
tzdata
einops
huggingface_hub
matplotlib
safetensors
sshtunnel
pybind11
PyYAML
tushare
================================================
FILE: runtime_config.py
================================================
# coding=utf-8
import configparser
import copy
import os
from configparser import MissingSectionHeaderError
import yaml
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
ROOT_YAML_FILE = os.path.join(REPO_ROOT, 'config.yaml')
ROOT_INI_FILE = os.path.join(REPO_ROOT, 'config.ini')
_DEFAULT_RUNTIME_DATA = {
'ctp_native': {
'gateway': 'pybind',
'module': 'ctp_bridge_native',
'client_class': 'CtpClient',
'module_path': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'build').replace('\\', '/'),
'dll_dir': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'api', 'win').replace('\\', '/'),
'trade_front': 'tcp://180.168.146.187:10001',
'market_front': 'tcp://180.168.146.187:10011',
'broker_id': '',
'investor_id': '',
'password': '',
'appid': '',
'authcode': '',
'userinfo': '',
'flow_path': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'flow').replace('\\', '/'),
'request_timeout_ms': 10000,
'test_instrument': 'IF99',
},
'trade': {
'command_timeout': 5,
'ignore_inst': 'WH,bb,JR,RI,RS,LR,PM,im',
'transport': 'native',
},
'log': {
'level': 'DEBUG',
'format': '%(asctime)s %(name)s [%(levelname)s] %(message)s',
'weixin_level': 'INFO',
'weixin_format': '[%(levelname)s] %(message)s',
},
'host': {
'ip': '1.2.3.4',
'mac': '02:03:04:5a:6b:7c',
},
'ssh_tunnel': {
'enabled': False,
'host': '127.0.0.1',
'port': 22,
'local_node': 'localhost',
'private_key_linux': '/root/.ssh/id_ed25519',
'private_key_win': 'C:\\Users\\timer\\.ssh\\id_ed25519.ppk',
},
'weixin': {
'Token': '',
'EncodingAESKey': '',
'CorpID': '',
'Secret': '',
},
}
def _deep_merge_dict(base: dict, override: dict) -> dict:
merged = copy.deepcopy(base)
for key, value in override.items():
if isinstance(value, dict) and isinstance(merged.get(key), dict):
merged[key] = _deep_merge_dict(merged[key], value)
else:
merged[key] = value
return merged
def _normalize_yaml_data(data: dict | None) -> dict:
if not isinstance(data, dict):
return {}
normalized = {}
for section, section_values in data.items():
section_name = str(section).strip().lower()
if not section_name or not isinstance(section_values, dict):
continue
normalized[section_name] = {}
for key, value in section_values.items():
normalized[section_name][str(key).strip()] = value
return normalized
def _load_ini_data(path: str) -> dict:
parser = configparser.ConfigParser(interpolation=None)
try:
try:
parser.read(path, encoding='utf-8')
except UnicodeDecodeError:
parser.read(path, encoding='gb18030')
if parser.sections():
out = {}
for section in parser.sections():
out[section.lower()] = {k: v for k, v in parser.items(section)}
return out
except MissingSectionHeaderError:
pass
raw = {}
with open(path, 'rt', encoding='utf-8', errors='ignore') as file_obj:
for line in file_obj:
s = line.strip()
if not s or s.startswith(';') or s.startswith('#') or '=' not in s:
continue
key, value = s.split('=', 1)
raw[key.strip()] = value.strip()
mapped = copy.deepcopy(_DEFAULT_RUNTIME_DATA)
mapping = {
'trade': 'trade_front',
'market': 'market_front',
'broker': 'broker_id',
'investor': 'investor_id',
'passwd': 'password',
'appid': 'appid',
'authcode': 'authcode',
'userinfo': 'userinfo',
'module_path': 'module_path',
}
for src_key, dst_key in mapping.items():
if src_key in raw:
mapped['ctp_native'][dst_key] = raw[src_key]
if 'ip' in raw:
mapped['host']['ip'] = raw['ip']
if 'mac' in raw:
mapped['host']['mac'] = raw['mac']
return mapped
def _write_yaml(path: str, data: dict):
with open(path, 'wt', encoding='utf-8') as file_obj:
yaml.safe_dump(data, file_obj, allow_unicode=True, sort_keys=False)
def _ensure_yaml_config() -> str:
if os.path.exists(ROOT_YAML_FILE):
return ROOT_YAML_FILE
if os.path.exists(ROOT_INI_FILE):
ini_data = _load_ini_data(ROOT_INI_FILE)
yaml_data = _deep_merge_dict(_DEFAULT_RUNTIME_DATA, _normalize_yaml_data(ini_data))
_write_yaml(ROOT_YAML_FILE, yaml_data)
print('migrate config file:', ROOT_INI_FILE, '->', ROOT_YAML_FILE)
return ROOT_YAML_FILE
_write_yaml(ROOT_YAML_FILE, _DEFAULT_RUNTIME_DATA)
print('create config file:', ROOT_YAML_FILE)
return ROOT_YAML_FILE
def _to_config_parser(yaml_data: dict) -> configparser.ConfigParser:
parser = configparser.ConfigParser(interpolation=None)
for section, section_values in yaml_data.items():
section_name = section.upper()
if not parser.has_section(section_name):
parser.add_section(section_name)
for key, value in section_values.items():
parser.set(section_name, key, '' if value is None else str(value))
return parser
def load_runtime_config() -> configparser.ConfigParser:
yaml_file = _ensure_yaml_config()
with open(yaml_file, 'rt', encoding='utf-8') as file_obj:
yaml_data = yaml.safe_load(file_obj) or {}
normalized = _normalize_yaml_data(yaml_data)
return _to_config_parser(normalized)
runtime_config = load_runtime_config()
================================================
FILE: strategy/__init__.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import orjson
import pytz
import time
import datetime
import logging
from collections import defaultdict
from django.utils import timezone
from croniter import croniter
import asyncio
from abc import abstractmethod, ABCMeta
from ctp_native import LocalRedisLikeClient
from utils.func_container import CallbackFunctionContainer
from utils.read_config import config
logger = logging.getLogger('BaseModule')
class BaseModule(CallbackFunctionContainer, metaclass=ABCMeta):
def __init__(self):
super().__init__()
self.io_loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.io_loop)
self.transport = 'native'
self.redis_client = LocalRedisLikeClient(self.io_loop)
self.sub_client = self.redis_client.pubsub()
self.initialized = False
self.sub_tasks = list()
self.sub_channels = list()
self.channel_router = dict()
self.crontab_router = defaultdict(dict)
self.datetime = None
self.time = None
self.loop_time = None
def _register_callback(self):
self.datetime = timezone.localtime()
self.time = time.time()
self.loop_time = self.io_loop.time()
for fun_name, args in self.callback_fun_args.items():
if 'crontab' in args:
key = args['crontab']
self.crontab_router[key]['func'] = getattr(self, fun_name)
self.crontab_router[key]['iter'] = croniter(args['crontab'], self.datetime)
self.crontab_router[key]['handle'] = None
elif 'channel' in args:
self.channel_router[args['channel']] = getattr(self, fun_name)
def _get_next(self, key):
return self.loop_time + (self.crontab_router[key]['iter'].get_next() - self.time)
def _call_next(self, key):
if self.crontab_router[key]['handle'] is not None:
self.crontab_router[key]['handle'].cancel()
self.crontab_router[key]['handle'] = self.io_loop.call_at(self._get_next(key), self._call_next, key)
self.io_loop.create_task(self.crontab_router[key]['func']())
async def install(self):
try:
if hasattr(self.redis_client, 'start'):
await self.redis_client.start()
self._register_callback()
await self.sub_client.psubscribe(*self.channel_router.keys())
asyncio.run_coroutine_threadsafe(self._msg_reader(), self.io_loop)
# self.io_loop.create_task(self._msg_reader())
for key, cron_dict in self.crontab_router.items():
if cron_dict['handle'] is not None:
cron_dict['handle'].cancel()
cron_dict['handle'] = self.io_loop.call_at(self._get_next(key), self._call_next, key)
self.initialized = True
logger.debug('%s plugin installed', type(self).__name__)
except Exception as e:
logger.error('%s plugin install failed: %s', type(self).__name__, repr(e), exc_info=True)
async def uninstall(self):
try:
await self.sub_client.punsubscribe()
# await asyncio.wait(self.sub_tasks, loop=self.io_loop)
self.sub_tasks.clear()
await self.sub_client.close()
if hasattr(self.redis_client, 'stop'):
await self.redis_client.stop()
for key, cron_dict in self.crontab_router.items():
if self.crontab_router[key]['handle'] is not None:
self.crontab_router[key]['handle'].cancel()
self.crontab_router[key]['handle'] = None
self.initialized = False
logger.debug('%s plugin uninstalled', type(self).__name__)
except Exception as e:
logger.error('%s plugin uninstall failed: %s', type(self).__name__, repr(e), exc_info=True)
async def _msg_reader(self):
# {'type': 'pmessage', 'pattern': 'channel:*', 'channel': 'channel:1', 'data': 'Hello'}
async for msg in self.sub_client.listen():
if msg['type'] == 'pmessage':
channel = msg['channel']
pattern = msg['pattern']
data = orjson.loads(msg['data'])
# logger.debug("%s channel[%s] Got Message:%s", type(self).__name__, channel, msg)
self.io_loop.create_task(self.channel_router[pattern](channel, data))
elif msg['type'] == 'punsubscribe':
break
logger.debug('%s quit _msg_reader!', type(self).__name__)
async def start(self):
await self.install()
async def stop(self):
await self.uninstall()
def run(self):
try:
self.io_loop.create_task(self.start())
self.io_loop.run_forever()
except KeyboardInterrupt:
self.io_loop.run_until_complete(self.stop())
except Exception as ee:
logger.error('发生错误: %s', repr(ee), exc_info=True)
self.io_loop.run_until_complete(self.stop())
finally:
logger.debug('程序已退出')
================================================
FILE: strategy/base_strategy.py
================================================
# coding=utf-8
# pyright: reportAttributeAccessIssue=false, reportOptionalMemberAccess=false, reportOptionalSubscript=false, reportOptionalOperand=false, reportArgumentType=false, reportOperatorIssue=false, reportGeneralTypeIssues=false, reportCallIssue=false
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import asyncio
import re
from abc import abstractmethod
from collections import defaultdict
import datetime
from decimal import Decimal
from typing import Any
import logging
from django.db.models import Q, F, Sum
from django.utils import timezone
import orjson
from strategy import BaseModule
from utils.func_container import RegisterCallback
from utils.read_config import config, ctp_errors
from utils import ApiStruct, price_round, is_trading_day, update_from_shfe, update_from_dce, update_from_czce, update_from_cffex, \
get_contracts_argument, calc_main_inst, str_to_number, get_next_id, ORDER_REF_SIGNAL_ID_START, update_from_gfex
from panel.models import *
logger = logging.getLogger('CTPApi')
HANDLER_TIME_OUT = config.getint('TRADE', 'command_timeout', fallback=10)
class BaseTradeStrategy(BaseModule):
"""
交易策略公共基类,封装 CTP 通信、账户/持仓管理、回调处理、定时任务等共用逻辑。
子类只需实现 calc_signal(),可选覆盖 get_signal_instruments() / get_margin_threshold()。
"""
def __init__(self, name: str):
super().__init__()
self._market_response_format = config.get('MSG_CHANNEL', 'market_response_format', fallback='MSG:CTP:RSP:MARKET:{}:{}')
self._trade_response_format = config.get('MSG_CHANNEL', 'trade_response_format', fallback='MSG:CTP:RSP:TRADE:{}:{}')
self._request_format = config.get('MSG_CHANNEL', 'request_format', fallback='MSG:CTP:REQ:{}')
self._ignore_inst_list = config.get('TRADE', 'ignore_inst', fallback="WH,bb,JR,RI,RS,LR,PM,im").split(',')
self._strategy = Strategy.objects.get(name=name)
self._inst_ids = self._strategy.instruments.all().values_list('product_code', flat=True)
self._broker = self._strategy.broker
self._fake = self._broker.fake # 虚拟资金
self._current = self._broker.current # 当前动态权益
self._pre_balance = self._broker.pre_balance # 静态权益
self._cash = self._broker.cash # 可用资金
self._shares = dict() # { instrument : position }
self._cur_account = None
self._margin = self._broker.margin # 占用保证金
self._withdraw = 0 # 出金
self._deposit = 0 # 入金
self._activeOrders = dict() # 未成交委托单
self._cur_pos = dict() # 持有头寸
self._re_extract_code = re.compile(r'([a-zA-Z]*)(\d+)') # 提合约字母部分 IF1509 -> IF
self._re_extract_name = re.compile('(.*?)([0-9]+)(.*?)$') # 提取合约文字部分
trading_day = self.redis_client.get("TradingDay")
if not trading_day:
trading_day = timezone.localtime().strftime('%Y%m%d')
self.redis_client.set('TradingDay', trading_day)
last_trading_day = self.redis_client.get("LastTradingDay")
if not last_trading_day:
last_trading_day = trading_day
self.redis_client.set('LastTradingDay', last_trading_day)
self._trading_day = timezone.make_aware(datetime.datetime.strptime(trading_day + '08', '%Y%m%d%H'))
self._last_trading_day = timezone.make_aware(datetime.datetime.strptime(last_trading_day + '08', '%Y%m%d%H'))
# CTP 连接状态
self._trade_connected: bool = False
# ═══════════════════════════════════════════════════════════════════
# 参数读取
# ═══════════════════════════════════════════════════════════════════
def get_param(self, code: str, default=None):
"""从 DB Param 表读取参数值,优先返回 int_value → float_value → str_value,未找到则返回 default"""
try:
p = self._strategy.param_set.get(code=code)
for val in [p.int_value, p.float_value, p.str_value]:
if val is not None:
return val
return default
except Exception:
return default
@staticmethod
def _normalize_ctp_text(text: Any) -> str:
if text is None:
return ''
s = str(text).strip()
if not s:
return ''
# 兼容 pybind 在部分柜台返回 GBK 文本时可能出现的乱码
try:
raw = s.encode('latin1')
except UnicodeEncodeError:
return s
for enc in ('gbk', 'gb18030'):
try:
fixed = raw.decode(enc).strip()
except UnicodeDecodeError:
continue
if fixed and any('\u4e00' <= ch <= '\u9fff' for ch in fixed):
return fixed
return s
@staticmethod
def _is_suspect_text(text: str) -> bool:
if not text:
return True
if '\ufffd' in text or '�' in text:
return True
if any(ch in text for ch in ('ϩ', '¾', '��')):
return True
return False
# ═══════════════════════════════════════════════════════════════════
# 启动 / 账户 / 持仓 / 合约
# ═══════════════════════════════════════════════════════════════════
async def start(self):
await self.install()
self.redis_client.set('HEARTBEAT:TRADER', 1, ex=61)
today = timezone.localtime()
now = int(today.strftime('%H%M'))
_, trading = await is_trading_day(today)
if trading and (820 <= now <= 1550 or 2010 <= now <= 2359):
await self._session_init()
# 延迟检查 CTP 连接状态
self.io_loop.call_later(10, asyncio.create_task, self._check_initial_connection())
async def _check_initial_connection(self):
if not self._trade_connected:
logger.debug('CTP 前置未连接,可能处于非交易时段,等待自动重连...')
async def _session_init(self):
"""盘前初始化:刷新账户、撤销未成交订单、同步持仓"""
if not self._trade_connected:
logger.debug('CTP 交易前置未连接,跳过 session_init')
return
try:
await self.refresh_account()
order_list = await self.query('Order') or []
for order in order_list:
# 未成交订单
if int(order['OrderStatus']) in range(1, 5) and order['OrderSubmitStatus'] == ApiStruct.OSS_Accepted:
direct_str = DirectionType(order['Direction']).label
logger.info(f"撤销未成交订单: 合约{order['InstrumentID']} {direct_str}单 {order['VolumeTotal']}手 价格{order['LimitPrice']}")
await self.cancel_order(order)
# 已成交订单
elif order['OrderSubmitStatus'] == ApiStruct.OSS_Accepted:
self.save_order(order)
await self.refresh_position()
except Exception as e:
logger.warning(f'_session_init 发生错误: {repr(e)}', exc_info=True)
async def refresh_account(self):
try:
logger.debug('更新账户')
account = await self.query('TradingAccount')
account = account[0]
self._withdraw = Decimal(account['Withdraw'])
self._deposit = Decimal(account['Deposit'])
# 虚拟=虚拟(原始)-入金+出金
fake = self._fake - self._deposit + self._withdraw
if fake < 1:
fake = 0
# 静态权益=上日结算+入金金额-出金金额
self._pre_balance = Decimal(account['PreBalance']) + self._deposit - self._withdraw
# 动态权益=静态权益+平仓盈亏+持仓盈亏-手续费
self._current = self._pre_balance + Decimal(account['CloseProfit']) + Decimal(account['PositionProfit']) - Decimal(account['Commission'])
self._margin = Decimal(account['CurrMargin'])
self._cash = Decimal(account['Available'])
self._cur_account = account
self._broker.cash = self._cash
self._broker.current = self._current
self._broker.pre_balance = self._pre_balance
self._broker.margin = self._margin
self._broker.save(update_fields=['cash', 'current', 'pre_balance', 'margin'])
logger.debug(f"更新账户,可用资金: {self._cash:,.0f} 静态权益: {self._pre_balance:,.0f} 动态权益: {self._current:,.0f} "
f"出入金: {self._withdraw - self._deposit:,.0f} 虚拟: {fake:,.0f}")
except Exception as e:
logger.warning(f'refresh_account 发生错误: {repr(e)}', exc_info=True)
async def refresh_position(self):
try:
logger.debug('更新持仓...')
pos_list = await self.query('InvestorPositionDetail') or []
self._cur_pos.clear()
for pos in pos_list:
if 'empty' in pos and pos['empty'] is True or len(pos['InstrumentID']) > 6:
continue
if pos['Volume'] > 0:
old_pos = self._cur_pos.get(pos['InstrumentID'])
if old_pos is None:
self._cur_pos[pos['InstrumentID']] = pos
else:
old_pos['OpenPrice'] = (old_pos['OpenPrice'] * old_pos['Volume'] + pos['OpenPrice'] * pos['Volume']) / (old_pos['Volume'] + pos['Volume'])
old_pos['Volume'] += pos['Volume']
old_pos['PositionProfitByTrade'] += pos['PositionProfitByTrade']
old_pos['Margin'] += pos['Margin']
Trade.objects.filter(~Q(code__in=self._cur_pos.keys()), close_time__isnull=True).delete() # 删除不存在的头寸
for _, pos in self._cur_pos.items():
p_code = self._re_extract_code.match(pos['InstrumentID']).group(1)
inst = Instrument.objects.get(product_code=p_code)
trade = Trade.objects.filter(broker=self._broker, strategy=self._strategy, instrument=inst, code=pos['InstrumentID'], close_time__isnull=True,
direction=DirectionType(pos['Direction']).label).first()
bar = DailyBar.objects.filter(code=pos['InstrumentID']).order_by('-time').first()
profit = (bar.close - Decimal(pos['OpenPrice'])) * pos['Volume'] * inst.volume_multiple
if pos['Direction'] == DirectionType.SHORT:
profit *= -1
if trade:
trade.shares = (trade.closed_shares if trade.closed_shares else 0) + pos['Volume']
trade.filled_shares = trade.shares
trade.profit = profit
trade.save(update_fields=['shares', 'filled_shares', 'profit'])
else:
Trade.objects.create(
broker=self._broker, strategy=self._strategy, instrument=inst, code=pos['InstrumentID'], profit=profit, filled_shares=pos['Volume'],
direction=DirectionType(pos['Direction']).label, avg_entry_price=Decimal(pos['OpenPrice']), shares=pos['Volume'],
open_time=timezone.make_aware(datetime.datetime.strptime(pos['OpenDate'] + '08', '%Y%m%d%H')), frozen_margin=Decimal(pos['Margin']),
cost=pos['Volume'] * Decimal(pos['OpenPrice']) * inst.fee_money * inst.volume_multiple + pos['Volume'] * inst.fee_volume)
logger.debug('更新持仓完成!')
except Exception as e:
logger.warning(f'refresh_position 发生错误: {repr(e)}', exc_info=True)
async def refresh_instrument(self):
try:
logger.debug("更新合约...")
inst_dict = defaultdict(dict)
margin_rate_cache: dict[str, Any] = {}
fee_cache: dict[str, Any] = {}
inst_list = await self.query('Instrument') or []
for inst in inst_list:
if inst['empty']:
continue
is_trading = inst.get('IsTrading') == 1 or str(inst.get('IsTrading')) == '1'
product_class = inst.get('ProductClass')
if isinstance(product_class, int):
product_class = chr(product_class)
if is_trading and product_class == ApiStruct.PC_Futures:
product_id = str(inst.get('ProductID', '')).strip()
instrument_id = str(inst.get('InstrumentID', '')).strip()
exchange_id = str(inst.get('ExchangeID', '')).strip()
if not product_id or not instrument_id or not exchange_id:
continue
if product_id in self._ignore_inst_list or inst['LongMarginRatio'] > 1:
continue
inst_dict[product_id][instrument_id] = dict()
inst_dict[product_id][instrument_id]['exchange'] = exchange_id
inst_dict[product_id][instrument_id]['name'] = self._normalize_ctp_text(inst.get('InstrumentName', ''))
inst_dict[product_id][instrument_id]['multiple'] = inst['VolumeMultiple']
inst_dict[product_id][instrument_id]['price_tick'] = inst['PriceTick']
for code in inst_dict.keys():
all_inst = ','.join(sorted(inst_dict[code].keys()))
inst_data = list(inst_dict[code].values())[0]
valid_name = self._re_extract_name.match(inst_data['name'])
if valid_name is not None:
valid_name = valid_name.group(1)
else:
valid_name = inst_data['name']
if valid_name == code:
valid_name = ''
inst_data['name'] = valid_name
inst, created = Instrument.objects.update_or_create(product_code=code)
logger.debug(f"inst:{inst} created:{created} main_code:{inst.main_code}")
update_field_list = list()
# 更新主力合约的保证金和手续费
if inst.main_code:
margin_rate = margin_rate_cache.get(inst.main_code)
if margin_rate is None:
margin_rate = await self.query('InstrumentMarginRate', InstrumentID=inst.main_code)
margin_rate_cache[inst.main_code] = margin_rate
if margin_rate:
inst.margin_rate = margin_rate[0]['LongMarginRatioByMoney']
update_field_list.append('margin_rate')
else:
logger.debug(f'{inst} 查询保证金率为空,跳过')
fee = fee_cache.get(inst.main_code)
if fee is None:
fee = await self.query('InstrumentCommissionRate', InstrumentID=inst.main_code)
fee_cache[inst.main_code] = fee
if fee:
inst.fee_money = Decimal(fee[0]['CloseRatioByMoney'])
inst.fee_volume = Decimal(fee[0]['CloseRatioByVolume'])
update_field_list += ['fee_money', 'fee_volume']
else:
logger.debug(f'{inst} 查询手续费为空,跳过')
if created:
inst.exchange = inst_data['exchange']
inst.name = inst_data['name']
inst.all_inst = all_inst
inst.volume_multiple = inst_data['multiple']
inst.price_tick = inst_data['price_tick']
update_field_list += ['exchange', 'name', 'all_inst', 'volume_multiple', 'price_tick']
else:
if inst_data.get('exchange') and not inst.exchange:
inst.exchange = inst_data['exchange']
update_field_list.append('exchange')
normalized_name = inst_data.get('name', '')
if normalized_name and (not inst.name or self._is_suspect_text(inst.name)):
inst.name = normalized_name
update_field_list.append('name')
if all_inst and (not inst.all_inst or inst.main_code):
inst.all_inst = all_inst
update_field_list.append('all_inst')
inst.save(update_fields=update_field_list)
logger.debug("更新合约完成!")
except Exception as e:
logger.warning(f'refresh_instrument 发生错误: {repr(e)}', exc_info=True)
# ═══════════════════════════════════════════════════════════════════
# 持仓查询
# ═══════════════════════════════════════════════════════════════════
def getShares(self, instrument: str):
# 这个函数只能处理持有单一方向仓位的情况,若同时持有多空的头寸,返回结果不正确
shares = 0
pos_price = 0
for pos in self._shares[instrument]:
pos_price += pos['Volume'] * pos['OpenPrice']
shares += pos['Volume'] * (-1 if pos['Direction'] == DirectionType.SHORT else 1)
return shares, pos_price / abs(shares), self._shares[instrument][0]['OpenDate']
def getPositions(self, inst_id: int):
# 这个函数只能处理持有单一方向仓位的情况,若同时持有多空的头寸,返回结果不正确
return self._shares[inst_id][0]
# ═══════════════════════════════════════════════════════════════════
# CTP 查询通信
# ═══════════════════════════════════════════════════════════════════
def async_query(self, query_type: str, **kwargs):
request_id = get_next_id()
kwargs['RequestID'] = request_id
self.redis_client.publish(self._request_format.format('ReqQry' + query_type), orjson.dumps(kwargs))
@staticmethod
async def query_reader(pb):
msg_list = []
async for msg in pb.listen():
msg_dict = orjson.loads(msg['data'])
if 'empty' not in msg_dict or not msg_dict['empty']:
msg_list.append(msg_dict)
if 'bIsLast' not in msg_dict or msg_dict['bIsLast']:
return msg_list
async def query(self, query_type: str, **kwargs):
sub_client = None
channel_rsp_qry, channel_rsp_err = None, None
try:
sub_client = self.redis_client.pubsub(ignore_subscribe_messages=True)
request_id = get_next_id()
kwargs['RequestID'] = request_id
channel_rsp_qry = self._trade_response_format.format('OnRspQry' + query_type, request_id)
channel_rsp_err = self._trade_response_format.format('OnRspError', request_id)
await sub_client.psubscribe(channel_rsp_qry, channel_rsp_err)
task = asyncio.create_task(self.query_reader(sub_client))
self.redis_client.publish(self._request_format.format('ReqQry' + query_type), orjson.dumps(kwargs))
await asyncio.wait_for(task, HANDLER_TIME_OUT)
await sub_client.punsubscribe()
await sub_client.close()
return task.result()
except Exception as e:
logger.warning(f'{query_type} 发生错误: {repr(e)}', exc_info=True)
if sub_client and channel_rsp_qry:
await sub_client.unsubscribe()
await sub_client.close()
return None
async def SubscribeMarketData(self, inst_ids: list):
sub_client = None
channel_rsp_dat, channel_rsp_err = None, None
try:
sub_client = self.redis_client.pubsub(ignore_subscribe_messages=True)
channel_rsp_dat = self._market_response_format.format('OnRspSubMarketData', 0)
channel_rsp_err = self._market_response_format.format('OnRspError', 0)
await sub_client.psubscribe(channel_rsp_dat, channel_rsp_err)
task = asyncio.create_task(self.query_reader(sub_client))
self.redis_client.publish(self._request_format.format('SubscribeMarketData'), orjson.dumps(inst_ids))
await asyncio.wait_for(task, HANDLER_TIME_OUT)
await sub_client.punsubscribe()
await sub_client.close()
return task.result()
except Exception as e:
logger.warning(f'SubscribeMarketData 发生错误: {repr(e)}', exc_info=True)
if sub_client and sub_client.in_pubsub and channel_rsp_dat:
await sub_client.unsubscribe()
await sub_client.close()
return None
async def UnSubscribeMarketData(self, inst_ids: list):
sub_client = None
channel_rsp_dat, channel_rsp_err = None, None
try:
sub_client = self.redis_client.pubsub(ignore_subscribe_messages=True)
channel_rsp_dat = self._market_response_format.format('OnRspUnSubMarketData', 0)
channel_rsp_err = self._market_response_format.format('OnRspError', 0)
await sub_client.psubscribe(channel_rsp_dat, channel_rsp_err)
task = asyncio.create_task(self.query_reader(sub_client))
self.redis_client.publish(self._request_format.format('UnSubscribeMarketData'), orjson.dumps(inst_ids))
await asyncio.wait_for(task, HANDLER_TIME_OUT)
await sub_client.punsubscribe()
await sub_client.close()
return task.result()
except Exception as e:
logger.warning(f'UnSubscribeMarketData 发生错误: {repr(e)}', exc_info=True)
if sub_client and sub_client.in_pubsub and channel_rsp_dat:
await sub_client.unsubscribe()
await sub_client.close()
return None
# ═══════════════════════════════════════════════════════════════════
# 下单 / 撤单
# ═══════════════════════════════════════════════════════════════════
def ReqOrderInsert(self, sig: Signal):
try:
request_id = get_next_id()
autoid = Autonumber.objects.create()
order_ref = f"{autoid.id:07}{sig.id:05}"
param_dict = dict()
param_dict['RequestID'] = request_id
param_dict['OrderRef'] = order_ref
param_dict['InstrumentID'] = sig.code
param_dict['VolumeTotalOriginal'] = sig.volume
param_dict['LimitPrice'] = float(sig.price)
match sig.type:
case SignalType.BUY | SignalType.SELL_SHORT:
param_dict['Direction'] = ApiStruct.D_Buy if sig.type == SignalType.BUY else ApiStruct.D_Sell
param_dict['CombOffsetFlag'] = ApiStruct.OF_Open
logger.info(f'{sig.instrument} {sig.type}{sig.volume}手 价格: {sig.price}')
case SignalType.BUY_COVER | SignalType.SELL:
param_dict['Direction'] = ApiStruct.D_Buy if sig.type == SignalType.BUY_COVER else ApiStruct.D_Sell
param_dict['CombOffsetFlag'] = ApiStruct.OF_Close
pos = Trade.objects.filter(
broker=self._broker, strategy=self._strategy, code=sig.code, shares=sig.volume, close_time__isnull=True,
direction=DirectionType.SHORT.label if sig.type == SignalType.BUY_COVER else DirectionType.LONG.label).first()
if pos.open_time.astimezone().date() == timezone.localtime().date() and pos.instrument.exchange == ExchangeType.SHFE:
param_dict['CombOffsetFlag'] = ApiStruct.OF_CloseToday # 上期所区分平今和平昨
logger.info(f'{sig.instrument} {sig.type}{sig.volume}手 价格: {sig.price}')
case SignalType.ROLL_CLOSE:
param_dict['CombOffsetFlag'] = ApiStruct.OF_Close
pos = Trade.objects.filter(broker=self._broker, strategy=self._strategy, code=sig.code, shares=sig.volume, close_time__isnull=True).first()
param_dict['Direction'] = ApiStruct.D_Sell if pos.direction == DirectionType.LONG.label else ApiStruct.D_Buy
if pos.open_time.astimezone().date() == timezone.localtime().date() and pos.instrument.exchange == ExchangeType.SHFE:
param_dict['CombOffsetFlag'] = ApiStruct.OF_CloseToday # 上期所区分平今和平昨
logger.info(f'{sig.code}->{sig.instrument.main_code} {pos.direction}头换月平旧{sig.volume}手 价格: {sig.price}')
case SignalType.ROLL_OPEN:
param_dict['CombOffsetFlag'] = ApiStruct.OF_Open
pos = Trade.objects.filter(
Q(close_time__isnull=True) | Q(close_time__date__gte=timezone.localtime().now().date()),
broker=self._broker, strategy=self._strategy, code=sig.instrument.last_main, shares=sig.volume).first()
param_dict['Direction'] = ApiStruct.D_Buy if pos.direction == DirectionType.LONG.label else ApiStruct.D_Sell
logger.info(f'{pos.code}->{sig.code} {pos.direction}头换月开新{sig.volume}手 价格: {sig.price}')
self.redis_client.publish(self._request_format.format('ReqOrderInsert'), orjson.dumps(param_dict))
except Exception as e:
logger.warning(f'ReqOrderInsert 发生错误: {repr(e)}', exc_info=True)
async def cancel_order(self, order: dict):
sub_client = None
channel_rsp_odr_act, channel_rsp_err = None, None
try:
sub_client = self.redis_client.pubsub(ignore_subscribe_messages=True)
request_id = get_next_id()
order['RequestID'] = request_id
channel_rtn_odr = self._trade_response_format.format('OnRtnOrder', order['OrderRef'])
channel_rsp_odr_act = self._trade_response_format.format('OnRspOrderAction', 0)
channel_rsp_err = self._trade_response_format.format('OnRspError', request_id)
await sub_client.psubscribe(channel_rtn_odr, channel_rsp_odr_act, channel_rsp_err)
task = asyncio.create_task(self.query_reader(sub_client))
self.redis_client.publish(self._request_format.format('ReqOrderAction'), orjson.dumps(order))
await asyncio.wait_for(task, HANDLER_TIME_OUT)
await sub_client.punsubscribe()
await sub_client.close()
result = task.result()[0]
if 'ErrorID' in result:
err_id = result['ErrorID']
err_msg = ctp_errors.get(err_id, f"未知错误码:{err_id}")
logger.warning(f"撤销订单出错: {err_msg}")
return False
return True
except Exception as e:
logger.warning('cancel_order 发生错误: %s', repr(e), exc_info=True)
if sub_client and sub_client.in_pubsub and channel_rsp_odr_act:
await sub_client.unsubscribe()
await sub_client.close()
return False
# ═══════════════════════════════════════════════════════════════════
# 行情回调
# ═══════════════════════════════════════════════════════════════════
@RegisterCallback(channel='MSG:CTP:RSP:MARKET:OnRtnDepthMarketData:*')
async def OnRtnDepthMarketData(self, channel, tick: dict):
try:
inst = channel.split(':')[-1]
tick['UpdateTime'] = datetime.datetime.strptime(tick['UpdateTime'], "%Y%m%d %H:%M:%S:%f")
logger.debug('inst=%s, tick: %s', inst, tick)
except Exception as ee:
logger.warning('OnRtnDepthMarketData 发生错误: %s', repr(ee), exc_info=True)
@staticmethod
def get_trade_string(trade: dict) -> str:
if trade['OffsetFlag'] == OffsetFlag.Open:
open_direct = DirectionType(trade['Direction']).label
else:
open_direct = DirectionType.LONG.label if trade['Direction'] == DirectionType.SHORT else DirectionType.SHORT.label
return f"{trade['ExchangeID']}.{trade['InstrumentID']} {OffsetFlag(trade['OffsetFlag']).label}{open_direct}已成交{trade['Volume']}手 " \
f"价格:{trade['Price']} 时间:{trade['TradeTime']} 订单号: {trade['OrderRef']}"
# ═══════════════════════════════════════════════════════════════════
# 成交 / 订单回调
# ═══════════════════════════════════════════════════════════════════
@RegisterCallback(channel='MSG:CTP:RSP:TRADE:OnRtnTrade:*')
async def OnRtnTrade(self, channel, trade: dict):
try:
if len(trade['InstrumentID']) > 6:
return
signal = None
new_trade = False
trade_completed = False
order_ref: str = channel.split(':')[-1]
manual_trade = int(order_ref) < 10000
if not manual_trade:
signal = Signal.objects.get(id=int(order_ref[ORDER_REF_SIGNAL_ID_START:]))
logger.info(f"成交回报: {self.get_trade_string(trade)}")
inst = Instrument.objects.get(product_code=self._re_extract_code.match(trade['InstrumentID']).group(1))
order = Order.objects.filter(order_ref=order_ref, code=trade['InstrumentID']).order_by('-send_time').first()
trade_cost = trade['Volume'] * Decimal(trade['Price']) * inst.fee_money * inst.volume_multiple + trade['Volume'] * inst.fee_volume
trade_margin = trade['Volume'] * Decimal(trade['Price']) * inst.margin_rate
now = timezone.localtime()
trade_time = timezone.make_aware(datetime.datetime.strptime(trade['TradeDate'] + trade['TradeTime'], '%Y%m%d%H:%M:%S'))
if trade_time.date() > now.date():
trade_time.replace(year=now.year, month=now.month, day=now.day)
if trade['OffsetFlag'] == OffsetFlag.Open: # 开仓
last_trade = Trade.objects.filter(
broker=self._broker, strategy=self._strategy, instrument=inst, code=trade['InstrumentID'], open_time__lte=trade_time,
close_time__isnull=True,
direction=DirectionType(trade['Direction']).label).first() if manual_trade else Trade.objects.filter(open_order=order).first()
if last_trade is None:
new_trade = True
last_trade = Trade.objects.create(
broker=self._broker, strategy=self._strategy, instrument=inst, code=trade['InstrumentID'], open_order=order if order else None,
direction=DirectionType(trade['Direction']).label, open_time=trade_time, shares=order.volume if order else trade['Volume'],
cost=trade_cost, filled_shares=trade['Volume'], avg_entry_price=trade['Price'], frozen_margin=trade_margin)
if order is None or order.status == OrderStatus.AllTraded.label:
trade_completed = True
if (not new_trade and not manual_trade) or (trade_completed and not new_trade and manual_trade):
last_trade.avg_entry_price = (last_trade.avg_entry_price * last_trade.filled_shares + trade['Volume'] * Decimal(trade['Price'])) / \
(last_trade.filled_shares + trade['Volume'])
last_trade.filled_shares += trade['Volume']
if trade_completed and not new_trade and manual_trade:
last_trade.shares += trade['Volume']
last_trade.cost += trade_cost
last_trade.frozen_margin += trade_margin
last_trade.save()
else: # 平仓
open_direct = DirectionType.LONG.label if trade['Direction'] == DirectionType.SHORT else DirectionType.SHORT.label
last_trade = Trade.objects.filter(Q(closed_shares__isnull=True) | Q(closed_shares__lt=F('shares')), shares=F('filled_shares'),
broker=self._broker, strategy=self._strategy, instrument=inst, code=trade['InstrumentID'],
direction=open_direct).first()
logger.debug(f'trade={last_trade}')
if last_trade:
if last_trade.closed_shares and last_trade.avg_exit_price:
last_trade.avg_exit_price = (last_trade.avg_exit_price * last_trade.closed_shares + trade['Volume'] * Decimal(trade['Price'])) / \
(last_trade.closed_shares + trade['Volume'])
last_trade.closed_shares += trade['Volume']
else:
last_trade.avg_exit_price = trade['Volume'] * Decimal(trade['Price']) / trade['Volume']
last_trade.closed_shares = trade['Volume']
last_trade.cost += trade_cost
last_trade.close_order = order
if last_trade.closed_shares == last_trade.shares: # 全部成交
trade_completed = True
last_trade.close_time = trade_time
if last_trade.direction == DirectionType.LONG.label:
profit_point = last_trade.avg_exit_price - last_trade.avg_entry_price
else:
profit_point = last_trade.avg_entry_price - last_trade.avg_exit_price
last_trade.profit = profit_point * last_trade.shares * inst.volume_multiple
last_trade.save(force_update=True)
logger.debug(f"new_trade:{new_trade} manual_trade:{manual_trade} trade_completed:{trade_completed} "
f"order:{order} signal: {signal}")
if trade_completed and not manual_trade:
signal.processed = True
signal.save(update_fields=['processed'])
order.signal = signal
order.save(update_fields=['signal'])
except Exception as ee:
logger.warning(f'OnRtnTrade 发生错误: {repr(ee)}', exc_info=True)
@staticmethod
def save_order(order: dict):
try:
if int(order['OrderRef']) < 10000: # 非本程序生成订单
return None, None
signal = Signal.objects.get(id=int(order['OrderRef'][ORDER_REF_SIGNAL_ID_START:]))
odr, created = Order.objects.update_or_create(
code=order['InstrumentID'], order_ref=order['OrderRef'], defaults={
'broker': signal.strategy.broker, 'strategy': signal.strategy, 'instrument': signal.instrument, 'front': order['FrontID'],
'session': order['SessionID'], 'price': order['LimitPrice'], 'volume': order['VolumeTotalOriginal'],
'direction': DirectionType(order['Direction']).label, 'status': OrderStatus(order['OrderStatus']).label,
'offset_flag': CombOffsetFlag(order['CombOffsetFlag']).label, 'update_time': timezone.localtime(),
'send_time': timezone.make_aware(datetime.datetime.strptime(order['InsertDate'] + order['InsertTime'], '%Y%m%d%H:%M:%S'))})
if order['OrderStatus'] == ApiStruct.OST_Canceled: # 删除错误订单
odr.delete()
return None, None
now = timezone.localtime().date()
if created and odr.send_time.date() > timezone.localtime().date(): # 夜盘成交时返回的时间是下一个交易日,需要改成今天
odr.send_time.replace(year=now.year, month=now.month, day=now.day)
odr.save(update_fields=['send_time'])
odr.signal = signal
return odr, created
except Exception as ee:
logger.warning(f'save_order 发生错误: {repr(ee)}', exc_info=True)
return None, None
@staticmethod
def get_order_string(order: dict) -> str:
off_set_flag = CombOffsetFlag(order['CombOffsetFlag']).label if order['CombOffsetFlag'] in CombOffsetFlag.values else \
OffsetFlag(order['CombOffsetFlag']).label
order_str = f"订单号:{order['OrderRef']},{order['ExchangeID']}.{order['InstrumentID']} {off_set_flag}{DirectionType(order['Direction']).label}" \
f"{order['VolumeTotalOriginal']}手 价格:{order['LimitPrice']} 报单时间:{order['InsertTime']} " \
f"提交状态:{OrderSubmitStatus(order['OrderSubmitStatus']).label} "
if order['OrderStatus'] != OrderStatus.Unknown:
order_str += f"成交状态:{OrderStatus(order['OrderStatus']).label} 消息:{order['StatusMsg']} "
if order['OrderStatus'] == OrderStatus.PartTradedQueueing:
order_str += f"成交数量:{order['VolumeTraded']} 剩余数量:{order['VolumeTotal']}"
return order_str
@RegisterCallback(channel='MSG:CTP:RSP:TRADE:OnRtnOrder:*')
async def OnRtnOrder(self, _: str, order: dict):
try:
if len(order['InstrumentID']) > 6:
return
if order["OrderSysID"]:
logger.debug(f"订单回报: {self.get_order_string(order)}")
order_obj, created = self.save_order(order)
if not order_obj:
return
signal = order_obj.signal
inst = Instrument.objects.get(product_code=self._re_extract_code.match(order['InstrumentID']).group(1))
# 处理由于委托价格超出交易所涨跌停板而被撤单的报单,将委托价格下调50%,重新报单
if order['OrderStatus'] == OrderStatus.Canceled and order['OrderSubmitStatus'] == OrderSubmitStatus.InsertRejected:
last_bar = DailyBar.objects.filter(exchange=inst.exchange, code=order['InstrumentID']).order_by('-time').first()
volume = int(order['VolumeTotalOriginal'])
price = Decimal(order['LimitPrice'])
if order['CombOffsetFlag'] == CombOffsetFlag.Open:
if order['Direction'] == DirectionType.LONG:
delta = (price - last_bar.settlement) * Decimal(0.5)
price = price_round(last_bar.settlement + delta, inst.price_tick)
if delta / last_bar.settlement < 0.01:
logger.warning(f"{inst} 新价格: {price} 过低难以成交,放弃报单!")
return
logger.info(f"{inst} 以价格 {price} 开多{volume}手 重新报单...")
signal.price = price
self.io_loop.call_soon(self.ReqOrderInsert, signal)
else:
delta = (last_bar.settlement - price) * Decimal(0.5)
price = price_round(last_bar.settlement - delta, inst.price_tick)
if delta / last_bar.settlement < 0.01:
logger.warning(f"{inst} 新价格: {price} 过低难以成交,放弃报单!")
return
logger.info(f"{inst} 以价格 {price} 开空{volume}手 重新报单...")
signal.price = price
self.io_loop.call_soon(self.ReqOrderInsert, signal)
else:
if order['Direction'] == DirectionType.LONG:
delta = (price - last_bar.settlement) * Decimal(0.5)
price = price_round(last_bar.settlement + delta, inst.price_tick)
if delta / last_bar.settlement < 0.01:
logger.warning(f"{inst} 新价格: {price} 过低难以成交,放弃报单!")
return
logger.info(f"{inst} 以价格 {price} 买平{volume}手 重新报单...")
signal.price = price
self.io_loop.call_soon(self.ReqOrderInsert, signal)
else:
delta = (last_bar.settlement - price) * Decimal(0.5)
price = price_round(last_bar.settlement - delta, inst.price_tick)
if delta / last_bar.settlement < 0.01:
logger.warning(f"{inst} 新价格: {price} 过低难以成交,放弃报单!")
return
logger.info(f"{inst} 以价格 {price} 卖平{volume}手 重新报单...")
signal.price = price
self.io_loop.call_soon(self.ReqOrderInsert, signal)
except Exception as ee:
logger.warning(f'OnRtnOrder 发生错误: {repr(ee)}', exc_info=True)
# ═══════════════════════════════════════════════════════════════════
# 定时任务
# ═══════════════════════════════════════════════════════════════════
@RegisterCallback(crontab='30 8 * * *')
async def refresh_trading_day(self):
"""每日08:30刷新交易日状态(常驻模式下跨日更新)"""
today = timezone.localtime()
_, trading = await is_trading_day(today)
if trading:
self._last_trading_day = self._trading_day
self._trading_day = timezone.make_aware(datetime.datetime.strptime(today.strftime('%Y%m%d') + '08', '%Y%m%d%H'))
self.redis_client.set('LastTradingDay', self._last_trading_day.strftime('%Y%m%d'))
self.redis_client.set('TradingDay', today.strftime('%Y%m%d'))
logger.info(f'交易日刷新: TradingDay={today.strftime("%Y%m%d")}, LastTradingDay={self._last_trading_day.strftime("%Y%m%d")}')
else:
logger.info(f'今日{today.strftime("%Y-%m-%d")}是非交易日,程序待机中。')
async def _has_night_session_tonight(self) -> bool:
"""判断今晚是否有夜盘。明天是交易日则有夜盘;周五时检查下周一。"""
today = timezone.localtime()
tomorrow = today + datetime.timedelta(days=1)
_, trading = await is_trading_day(tomorrow)
if trading:
return True
# 今天是周五,明天周六不是交易日,检查下周一
if today.isoweekday() == 5:
monday = today + datetime.timedelta(days=3)
_, trading = await is_trading_day(monday)
return trading
return False
@RegisterCallback(crontab='*/1 * * * *')
async def heartbeat(self):
self.redis_client.set('HEARTBEAT:TRADER', 1, ex=301)
self.redis_client.set('STATE:CTP_CONNECTED', int(self._trade_connected), ex=301)
# ═══════════════════════════════════════════════════════════════════
# CTP 连接状态回调
# ═══════════════════════════════════════════════════════════════════
@RegisterCallback(channel='MSG:CTP:RSP:TRADE:OnFrontConnected:*')
async def on_ctp_connected(self, channel, data: dict):
self._trade_connected = True
self.redis_client.set('STATE:CTP_CONNECTED', 1)
logger.debug('CTP 前置已连接')
@RegisterCallback(channel='MSG:CTP:RSP:TRADE:OnFrontDisconnected:*')
async def on_ctp_disconnected(self, channel, data: dict):
self._trade_connected = False
self.redis_client.set('STATE:CTP_CONNECTED', 0)
reason = data.get('Reason', '未知') if isinstance(data, dict) else '未知'
logger.debug(f'CTP 前置断开连接,原因: {reason}')
@RegisterCallback(channel='MSG:CTP:RSP:TRADE:OnRspUserLogin:*')
async def on_ctp_login(self, channel, data: dict):
if not isinstance(data, dict):
return
error_id = data.get('ErrorID', -1)
if error_id == 0:
self._trade_connected = True
self.redis_client.set('STATE:CTP_CONNECTED', 1)
trading_day = data.get('TradingDay', '')
logger.debug(f'CTP 登录成功,交易日: {trading_day}')
# 如果在交易时段,自动执行盘前初始化
today = timezone.localtime()
now = int(today.strftime('%H%M'))
_, trading = await is_trading_day(today)
night_session = await self._has_night_session_tonight()
if trading and (850 <= now <= 1550) or night_session and (2050 <= now <= 2359):
logger.debug('登录后自动执行 session_init...')
await self._session_init()
else:
error_msg = data.get('ErrorMsg', '未知错误')
logger.warning(f'CTP 登录失败,ErrorID={error_id},{error_msg}')
# ═══════════════════════════════════════════════════════════════════
# 盘前初始化定时任务
# ═══════════════════════════════════════════════════════════════════
@RegisterCallback(crontab='50 8 * * *')
async def session_init_day(self):
_, trading = await is_trading_day(timezone.localtime())
if trading:
logger.debug('日盘盘前初始化...')
await self._session_init()
@RegisterCallback(crontab='15 15 * * *')
async def session_init_afternoon(self):
_, trading = await is_trading_day(timezone.localtime())
if trading:
logger.debug('收盘后刷新账户持仓...')
await self._session_init()
@RegisterCallback(crontab='50 20 * * *')
async def session_init_night(self):
if await self._has_night_session_tonight():
logger.debug('夜盘盘前初始化...')
await self._session_init()
else:
logger.info('今晚没有夜盘。')
@RegisterCallback(crontab='55 8 * * *')
async def processing_signal1(self):
await asyncio.sleep(5)
day = timezone.localtime()
_, trading = await is_trading_day(day)
if trading:
logger.debug('查询日盘信号..')
for sig in Signal.objects.filter(~Q(instrument__exchange=ExchangeType.CFFEX), trigger_time__gte=self._last_trading_day, strategy=self._strategy,
instrument__night_trade=False, processed=False).order_by('-priority'):
logger.info(f'发现日盘信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
if (self._trading_day - self._last_trading_day).days > 3:
logger.info(f'假期后第一天,处理节前未成交夜盘信号.')
self.io_loop.call_soon(asyncio.create_task, self.processing_signal3())
@RegisterCallback(crontab='1 9 * * *')
async def check_signal1_processed(self):
day = timezone.localtime()
_, trading = await is_trading_day(day)
if trading:
logger.debug('查询遗漏的日盘信号..')
for sig in Signal.objects.filter(~Q(instrument__exchange=ExchangeType.CFFEX), trigger_time__gte=self._last_trading_day, strategy=self._strategy,
instrument__night_trade=False, processed=False).order_by('-priority'):
logger.info(f'发现遗漏信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
@RegisterCallback(crontab='25 9 * * *')
async def processing_signal2(self):
await asyncio.sleep(5)
day = timezone.localtime()
_, trading = await is_trading_day(day)
if trading:
logger.debug('查询股指和国债信号..')
for sig in Signal.objects.filter(instrument__exchange=ExchangeType.CFFEX, trigger_time__gte=self._last_trading_day, strategy=self._strategy,
instrument__night_trade=False, processed=False).order_by('-priority'):
logger.info(f'发现股指和国债信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
@RegisterCallback(crontab='31 9 * * *')
async def check_signal2_processed(self):
day = timezone.localtime()
_, trading = await is_trading_day(day)
if trading:
logger.debug('查询遗漏的股指和国债信号..')
for sig in Signal.objects.filter(instrument__exchange=ExchangeType.CFFEX, trigger_time__gte=self._last_trading_day, strategy=self._strategy,
instrument__night_trade=False, processed=False).order_by('-priority'):
logger.info(f'发现遗漏的股指和国债信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
@RegisterCallback(crontab='55 20 * * *')
async def processing_signal3(self):
await asyncio.sleep(5)
if not await self._has_night_session_tonight():
return
logger.debug('查询夜盘信号..')
for sig in Signal.objects.filter(
trigger_time__gte=self._last_trading_day, strategy=self._strategy, instrument__night_trade=True, processed=False).order_by('-priority'):
logger.info(f'发现夜盘信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
@RegisterCallback(crontab='1 21 * * *')
async def check_signal3_processed(self):
if not await self._has_night_session_tonight():
return
logger.debug('查询遗漏的夜盘信号..')
for sig in Signal.objects.filter(
trigger_time__gte=self._last_trading_day, strategy=self._strategy, instrument__night_trade=True, processed=False).order_by('-priority'):
logger.info(f'发现遗漏的夜盘信号: {sig}')
self.io_loop.call_soon(self.ReqOrderInsert, sig)
@RegisterCallback(crontab='20 15 * * *')
async def refresh_all(self):
day = timezone.localtime()
_, trading = await is_trading_day(day)
if not trading:
logger.info('今日是非交易日, 不更新任何数据。')
return
await self.refresh_account()
await self.refresh_position()
await self.refresh_instrument()
logger.debug('全部更新完成!')
@RegisterCallback(crontab='30 15 * * *')
async def update_equity(self):
today, trading = await is_trading_day(timezone.localtime())
if trading:
dividend = Performance.objects.filter(
broker=self._broker, day__lt=today.date()).aggregate(Sum('dividend'))['dividend__sum']
if dividend is None:
dividend = Decimal(0)
dividend = dividend + self._deposit - self._withdraw
# 虚拟=虚拟(原始)-入金+出金
self._fake = self._fake - self._deposit + self._withdraw
if self._fake < 1:
self._fake = 0
self._broker.fake = self._fake
self._broker.save(update_fields=['fake'])
unit = dividend + self._fake
nav = (self._current + self._fake) / unit # 单位净值
accumulated = self._current / (unit - self._fake) # 累计净值
Performance.objects.update_or_create(broker=self._broker, day=today.date(), defaults={
'used_margin': self._margin, 'dividend': self._deposit - self._withdraw, 'fake': self._fake, 'capital': self._current, 'unit_count': unit,
'NAV': nav, 'accumulated': accumulated})
logger.info(f"动态权益: {self._current:,.0f}({self._current / 10000:.1f}万) "
f"静态权益: {self._pre_balance:,.0f}({self._pre_balance / 10000:.1f}万) "
f"可用资金: {self._cash:,.0f}({self._cash / 10000:.1f}万) "
f"保证金占用: {self._margin:,.0f}({self._margin / 10000:.1f}万) "
f"虚拟资金: {self._fake:,.0f}({self._fake / 10000:.1f}万) 当日入金: {self._deposit:,.0f} "
f"当日出金: {self._withdraw:,.0f} 单位净值: {nav:,.2f} 累计净值: {accumulated:,.2f}")
@RegisterCallback(crontab='0 17 * * *')
async def collect_quote(self, tasks=None):
try:
day = timezone.localtime()
_, trading = await is_trading_day(day)
if not trading:
logger.info('今日是非交易日, 不计算任何数据。')
return
logger.debug(f'{day}盘后计算,获取交易所日线数据..')
if tasks is None:
tasks = [update_from_shfe, update_from_dce, update_from_czce, update_from_cffex, update_from_gfex, get_contracts_argument]
result = await asyncio.gather(*[func(day) for func in tasks], return_exceptions=True)
if all(result):
self.io_loop.call_soon(self.calculate, day)
else:
failed_tasks = [tasks[i] for i, rst in enumerate(result) if not rst]
self.io_loop.call_later(10 * 60, asyncio.create_task, self.collect_quote(failed_tasks))
except Exception as e:
logger.warning(f'collect_quote 发生错误: {repr(e)}', exc_info=True)
logger.debug('盘后计算完毕!')
# ═══════════════════════════════════════════════════════════════════
# 涨跌停价计算
# ═══════════════════════════════════════════════════════════════════
def calc_up_limit(self, inst: Instrument, bar: DailyBar):
settlement = bar.settlement
limit_ratio = str_to_number(self.redis_client.get(f"LIMITRATIO:{inst.exchange}:{inst.product_code}:{bar.code}"))
if limit_ratio is None:
limit_ratio = float(inst.up_limit_ratio or 0)
price_tick = inst.price_tick
price = price_round(settlement * (Decimal(1) + Decimal(limit_ratio)), price_tick)
return price - price_tick
def calc_down_limit(self, inst: Instrument, bar: DailyBar):
settlement = bar.settlement
limit_ratio = str_to_number(self.redis_client.get(f"LIMITRATIO:{inst.exchange}:{inst.product_code}:{bar.code}"))
if limit_ratio is None:
limit_ratio = float(inst.down_limit_ratio or 0)
price_tick = inst.price_tick
price = price_round(settlement * (Decimal(1) - Decimal(limit_ratio)), price_tick)
return price + price_tick
# ═══════════════════════════════════════════════════════════════════
# 模板方法: calculate + 可覆盖钩子
# ═══════════════════════════════════════════════════════════════════
def get_signal_instruments(self) -> set[str]:
"""返回需要计算信号的品种代码集合。子类可覆盖以扩展品种池。"""
p_code_set = set(self._inst_ids)
for code in self._cur_pos.keys():
p_code_set.add(self._re_extract_code.match(code).group(1))
return p_code_set
def get_margin_threshold(self) -> float:
"""返回保证金/权益告警阈值。子类可覆盖。"""
return 0.8
def calculate(self, day, create_main_bar=True):
try:
p_code_set = self.get_signal_instruments()
all_margin = 0
for inst in Instrument.objects.all().order_by('section', 'exchange', 'name'):
if create_main_bar:
logger.debug(f'生成连续合约: {inst.name}')
calc_main_inst(inst, day)
if inst.product_code in p_code_set:
logger.debug(f'计算交易信号: {inst.name}')
sig, margin = self.calc_signal(inst, day)
all_margin += margin
threshold = self.get_margin_threshold()
if self._current and self._current > 0 and (all_margin + self._margin) / self._current > threshold:
logger.info(f"!! 风险提示 !! 开仓保证金共计: {all_margin:.0f}({all_margin / 10000:.1f}万) "
f"账户风险度将达到: {100 * (all_margin + self._margin) / self._current:.0f}% "
f"超过{threshold * 100:.0f}%阈值!")
except Exception as e:
logger.warning(f'calculate 发生错误: {repr(e)}', exc_info=True)
@abstractmethod
def calc_signal(self, inst: Instrument, day: datetime.datetime) -> tuple[Any | None, Decimal]:
"""计算交易信号,子类必须实现。返回 (signal_type | None, estimated_margin)"""
...
================================================
FILE: strategy/brother2.py
================================================
# coding=utf-8
# pyright: reportAttributeAccessIssue=false, reportOptionalMemberAccess=false, reportOptionalSubscript=false, reportOptionalOperand=false, reportArgumentType=false, reportOperatorIssue=false, reportGeneralTypeIssues=false
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import datetime
from decimal import Decimal
from typing import Any
import logging
from django.db.models import Sum
from talib import ATR
from strategy.base_strategy import BaseTradeStrategy
from utils import price_round
from panel.models import *
logger = logging.getLogger('CTPApi')
class TradeStrategy(BaseTradeStrategy):
"""大哥2.2 — 经典通道突破趋势跟踪策略"""
def __init__(self, name: str):
super().__init__(name)
def calc_signal(self, inst: Instrument, day: datetime.datetime) -> tuple[Any | None, Decimal]:
try:
break_n = self.get_param('BreakPeriod')
atr_n = self.get_param('AtrPeriod')
long_n = self.get_param('LongPeriod')
short_n = self.get_param('ShortPeriod')
stop_n = self.get_param('StopLoss')
risk = self.get_param('Risk')
# 只读取最近400条记录,减少运算量
df = to_df(MainBar.objects.filter(time__lte=day.date(), exchange=inst.exchange, product_code=inst.product_code).order_by('-time').values_list(
'time', 'open', 'high', 'low', 'close')[:400], index_col='time', parse_dates=['time'])
df = df.iloc[::-1] # 日期升序排列
df["atr"] = ATR(df.high, df.low, df.close, timeperiod=atr_n)
df["short_trend"] = df.close
df["long_trend"] = df.close
for idx in range(1, df.shape[0]): # 手动计算SMA
df.short_trend[idx] = (df.short_trend[idx - 1] * (short_n - 1) + df.close[idx]) / short_n
df.long_trend[idx] = (df.long_trend[idx - 1] * (long_n - 1) + df.close[idx]) / long_n
df["high_line"] = df.close.rolling(window=break_n).max()
df["low_line"] = df.close.rolling(window=break_n).min()
idx = -1
buy_sig = df.short_trend[idx] > df.long_trend[idx] and price_round(df.close[idx], inst.price_tick) >= price_round(df.high_line[idx - 1], inst.price_tick)
sell_sig = df.short_trend[idx] < df.long_trend[idx] and price_round(df.close[idx], inst.price_tick) <= price_round(df.low_line[idx - 1], inst.price_tick)
pos = Trade.objects.filter(close_time__isnull=True, broker=self._broker, strategy=self._strategy, instrument=inst, shares__gt=0).first()
roll_over = False
if pos:
roll_over = pos.code != inst.main_code and pos.code < inst.main_code
elif self._strategy.force_opens.filter(id=inst.id).exists() and not buy_sig and not sell_sig:
logger.info(f'强制开仓: {inst}')
if df.short_trend[idx] > df.long_trend[idx]:
buy_sig = True
else:
sell_sig = True
self._strategy.force_opens.remove(inst)
signal = signal_code = price = volume = volume_ori = use_margin = None
priority = PriorityType.LOW
if pos:
# 多头持仓
if pos.direction == DirectionType.LONG.label:
first_pos = pos
while hasattr(first_pos, 'open_order') and first_pos.open_order and first_pos.open_order.signal and first_pos.open_order.signal.type == \
SignalType.ROLL_OPEN:
last_pos = Trade.objects.filter(
close_order__signal__type=SignalType.ROLL_CLOSE, instrument=first_pos.instrument, strategy=first_pos.strategy,
shares=first_pos.shares, direction=first_pos.direction, close_time__date=first_pos.open_time.date()).first()
if last_pos is None:
break
logger.debug(f"发现换月前持仓:{last_pos} 开仓时间: {last_pos.open_time}")
first_pos = last_pos
pos_idx = df.index.get_loc(first_pos.open_time.astimezone().date().isoformat())
# 多头止损
if df.close[idx] <= df.high[pos_idx:idx].max() - df.atr[pos_idx - 1] * stop_n:
signal = SignalType.SELL
signal_code = pos.code
volume = pos.shares
last_bar = DailyBar.objects.filter(exchange=inst.exchange, code=pos.code, time=day.date()).first()
price = self.calc_down_limit(inst, last_bar)
priority = PriorityType.High
# 多头换月
elif roll_over:
signal = SignalType.ROLL_OPEN
volume = pos.shares
last_bar = DailyBar.objects.filter(exchange=inst.exchange, code=pos.code, time=day.date()).first()
new_bar = DailyBar.objects.filter(exchange=inst.exchange, code=inst.main_code, time=day.date()).first()
price = self.calc_up_limit(inst, new_bar)
priority = PriorityType.Normal
Signal.objects.update_or_create(
code=pos.code, strategy=self._strategy, instrument=inst, type=SignalType.ROLL_CLOSE, trigger_time=day,
defaults={'price': self.calc_down_limit(inst, last_bar), 'volume': volume, 'priority': priority, 'processed': False})
# 空头持仓
else:
first_pos = pos
while hasattr(first_pos, 'open_order') and first_pos.open_order and first_pos.open_order.signal \
and first_pos.open_order.signal.type == SignalType.ROLL_OPEN:
last_pos = Trade.objects.filter(
close_order__signal__type=SignalType.ROLL_CLOSE, instrument=first_pos.instrument, strategy=first_pos.strategy,
shares=first_pos.shares, direction=first_pos.direction, close_time__date=first_pos.open_time.date()).first()
if last_pos is None:
break
logger.debug(f"发现换月前持仓:{last_pos} 开仓时间: {last_pos.open_time}")
first_pos = last_pos
pos_idx = df.index.get_loc(first_pos.open_time.astimezone().date().isoformat())
# 空头止损
if df.close[idx] >= df.low[pos_idx:idx].min() + df.atr[pos_idx - 1] * stop_n:
signal = SignalType.BUY_COVER
signal_code = pos.code
volume = pos.shares
last_bar = DailyBar.objects.filter(exchange=inst.exchange, code=pos.code, time=day.date()).first()
price = self.calc_up_limit(inst, last_bar)
priority = PriorityType.High
# 空头换月
elif roll_over:
signal = SignalType.ROLL_OPEN
volume = pos.shares
last_bar = DailyBar.objects.filter(exchange=inst.exchange, code=pos.code, time=day.date()).first()
new_bar = DailyBar.objects.filter(exchange=inst.exchange, code=inst.main_code, time=day.date()).first()
price = self.calc_down_limit(inst, new_bar)
priority = PriorityType.Normal
Signal.objects.update_or_create(
code=pos.code, strategy=self._strategy, instrument=inst, type=SignalType.ROLL_CLOSE, trigger_time=day,
defaults={'price': self.calc_up_limit(inst, last_bar), 'volume': volume, 'priority': priority, 'processed': False})
# 开新仓
elif buy_sig or sell_sig:
start_cash = Performance.objects.last().unit_count
# 原始扎堆儿
profit = Trade.objects.filter(strategy=self._strategy, instrument__section=inst.section).aggregate(sum=Sum('profit'))['sum']
profit = profit if profit else 0
risk_each = Decimal(df.atr[idx]) * Decimal(inst.volume_multiple)
volume_ori = (start_cash + profit) * risk / risk_each
volume = round(volume_ori)
print(f"{inst}: ({start_cash:,.0f} + {profit:,.0f}) / {risk_each:,.0f} = {volume_ori}")
if volume > 0:
new_bar = DailyBar.objects.filter(exchange=inst.exchange, code=inst.main_code, time=day.date()).first()
if new_bar is None:
logger.info(f"未找到新日线数据,{inst.exchange} {inst.main_code} {day.date()}")
use_margin = new_bar.settlement * inst.volume_multiple * inst.margin_rate * volume
price = self.calc_up_limit(inst, new_bar) if buy_sig else self.calc_down_limit(inst, new_bar)
signal = SignalType.BUY if buy_sig else SignalType.SELL_SHORT
else:
logger.info(f"做{'多' if buy_sig else '空'}{inst},单手风险:{risk_each:.0f},超出风控额度,放弃。")
if signal:
use_margin = use_margin if use_margin else 0
sig, _ = Signal.objects.update_or_create(
code=signal_code if signal_code else inst.main_code, strategy=self._strategy, instrument=inst, type=signal, trigger_time=day,
defaults={'price': price, 'volume': volume, 'priority': priority, 'processed': False})
volume_ori = volume_ori if volume_ori else volume
logger.info(f"新信号: {sig}({volume_ori:.1f}手) "
f"预估保证金: {use_margin:.0f}({use_margin / 10000:.1f}万)")
return signal, Decimal(use_margin)
except Exception as e:
logger.warning(f'calc_signal 发生错误: {repr(e)}', exc_info=True)
return None, Decimal(0)
return None, Decimal(0)
================================================
FILE: strategy/kronos.py
================================================
import sys
import os
import django
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if ROOT not in sys.path:
sys.path.insert(0, ROOT)
os.environ["DJANGO_SETTINGS_MODULE"] = "dashboard.settings"
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
django.setup()
from model import Kronos, KronosTokenizer, KronosPredictor
from panel.models import MainBar, to_df
import pandas as pd
import matplotlib.pyplot as plt
if __name__ == '__main__':
tokenizer = KronosTokenizer.from_pretrained("D:/Github/Kronos/token_model/", local_files_only=True)
model = Kronos.from_pretrained("D:/Github/Kronos/base_model/", local_files_only=True)
predictor = KronosPredictor(model, tokenizer, device="cuda:0", max_context=512)
qs = MainBar.objects.filter(product_code=product_code).order_by('-time')[:300]
df = to_df(qs, parse_dates=['time'])
# 统一列名与类型
df.rename(columns={
'time': 'timestamps',
'open': 'open',
'high': 'high',
'low': 'low',
'close': 'close',
'volume': 'volume',
'open_interest': 'amount',
}, inplace=True)
use_cols = ['timestamps', 'open', 'high', 'low', 'close', 'volume']
df = df[use_cols].copy()
# 仅保留最后 need_rows 行用于后续切分(前250, 预测50)
if len(df) < need_rows:
raise RuntimeError(f"MainBar数据不足{need_rows}行,当前仅有{len(df)}行")
df[['timestamps', 'open', 'high', 'low', 'close', 'volume', 'amount']].to_csv(csv_path, index=False)
================================================
FILE: utils/ApiStruct.py
================================================
# coding=utf-8
T = dict()
T['TE_RESUME'] = 'int' # 流重传方式
TERT_RESTART = 0 # 从本交易日开始重传
TERT_RESUME = 1 # 从上次收到的续传
TERT_QUICK = 2 # 只传送登录后的流内容
T['TraderID'] = 'char[21]' # 交易所交易员代码
T['InvestorID'] = 'char[13]' # 投资者代码
T['BrokerID'] = 'char[11]' # 经纪公司代码
T['BrokerAbbr'] = 'char[9]' # 经纪公司简称
T['BrokerName'] = 'char[81]' # 经纪公司名称
T['ExchangeInstID'] = 'char[31]' # 合约在交易所的代码
T['OrderRef'] = 'char[13]' # 报单引用
T['ParticipantID'] = 'char[11]' # 会员代码
T['UserID'] = 'char[16]' # 用户代码
T['Password'] = 'char[41]' # 密码
T['ClientID'] = 'char[11]' # 交易编码
T['InstrumentID'] = 'char[31]' # 合约代码
T['MarketID'] = 'char[31]' # 市场代码
T['ProductName'] = 'char[21]' # 产品名称
T['ExchangeID'] = 'char[9]' # 交易所代码
T['ExchangeName'] = 'char[61]' # 交易所名称
T['ExchangeAbbr'] = 'char[9]' # 交易所简称
T['ExchangeFlag'] = 'char[2]' # 交易所标志
T['MacAddress'] = 'char[21]' # Mac地址
T['SystemID'] = 'char[21]' # 系统编号
T['ExchangeProperty'] = 'char' # 交易所属性
EXP_Normal = '0' # 正常
EXP_GenOrderByTrade = '1' # 根据成交生成报单
T['Date'] = 'char[9]' # 日期
T['Time'] = 'char[9]' # 时间
T['LongTime'] = 'char[13]' # 长时间
T['InstrumentName'] = 'char[21]' # 合约名称
T['SettlementGroupID'] = 'char[9]' # 结算组代码
T['OrderSysID'] = 'char[21]' # 报单编号
T['TradeID'] = 'char[21]' # 成交编号
T['CommandType'] = 'char[65]' # DB命令类型
T['IPAddress'] = 'char[16]' # IP地址
T['IPPort'] = 'int' # IP端口
T['ProductInfo'] = 'char[11]' # 产品信息
T['ProtocolInfo'] = 'char[11]' # 协议信息
T['BusinessUnit'] = 'char[21]' # 业务单元
T['DepositSeqNo'] = 'char[15]' # 出入金流水号
T['IdentifiedCardNo'] = 'char[51]' # 证件号码
T['IdCardType'] = 'char' # 证件类型
ICT_EID = '0' # 组织机构代码
ICT_IDCard = '1' # 中国公民身份证
ICT_OfficerIDCard = '2' # 军官证
ICT_PoliceIDCard = '3' # 警官证
ICT_SoldierIDCard = '4' # 士兵证
ICT_HouseholdRegister = '5' # 户口簿
ICT_Passport = '6' # 护照
ICT_TaiwanCompatriotIDCard = '7' # 台胞证
ICT_HomeComingCard = '8' # 回乡证
ICT_LicenseNo = '9' # 营业执照号
ICT_TaxNo = 'A' # 税务登记号/当地纳税ID
ICT_HMMainlandTravelPermit = 'B' # 港澳居民来往内地通行证
ICT_TwMainlandTravelPermit = 'C' # 台湾居民来往大陆通行证
ICT_DrivingLicense = 'D' # 驾照
ICT_SocialID = 'F' # 当地社保ID
ICT_LocalID = 'G' # 当地身份证
ICT_BusinessRegistration = 'H' # 商业登记证
ICT_HKMCIDCard = 'I' # 港澳永久性居民身份证
ICT_AccountsPermits = 'J' # 人行开户许可证
ICT_OtherCard = 'x' # 其他证件
T['OrderLocalID'] = 'char[13]' # 本地报单编号
T['UserName'] = 'char[81]' # 用户名称
T['PartyName'] = 'char[81]' # 参与人名称
T['ErrorMsg'] = 'char[81]' # 错误信息
T['FieldName'] = 'char[2049]' # 字段名
T['FieldContent'] = 'char[2049]' # 字段内容
T['SystemName'] = 'char[41]' # 系统名称
T['Content'] = 'char[501]' # 消息正文
T['InvestorRange'] = 'char' # 投资者范围
IR_All = '1' # 所有
IR_Group = '2' # 投资者组
IR_Single = '3' # 单一投资者
T['DepartmentRange'] = 'char' # 投资者范围
DR_All = '1' # 所有
DR_Group = '2' # 组织架构
DR_Single = '3' # 单一投资者
T['DataSyncStatus'] = 'char' # 数据同步状态
DS_Asynchronous = '1' # 未同步
DS_Synchronizing = '2' # 同步中
DS_Synchronized = '3' # 已同步
T['BrokerDataSyncStatus'] = 'char' # 经纪公司数据同步状态
BDS_Synchronized = '1' # 已同步
BDS_Synchronizing = '2' # 同步中
T['ExchangeConnectStatus'] = 'char' # 交易所连接状态
ECS_NoConnection = '1' # 没有任何连接
ECS_QryInstrumentSent = '2' # 已经发出合约查询请求
ECS_GotInformation = '9' # 已经获取信息
T['TraderConnectStatus'] = 'char' # 交易所交易员连接状态
TCS_NotConnected = '1' # 没有任何连接
TCS_Connected = '2' # 已经连接
TCS_QryInstrumentSent = '3' # 已经发出合约查询请求
TCS_SubPrivateFlow = '4' # 订阅私有流
T['FunctionCode'] = 'char' # 功能代码
FC_DataAsync = '1' # 数据异步化
FC_ForceUserLogout = '2' # 强制用户登出
FC_UserPasswordUpdate = '3' # 变更管理用户口令
FC_BrokerPasswordUpdate = '4' # 变更经纪公司口令
FC_InvestorPasswordUpdate = '5' # 变更投资者口令
FC_OrderInsert = '6' # 报单插入
FC_OrderAction = '7' # 报单操作
FC_SyncSystemData = '8' # 同步系统数据
FC_SyncBrokerData = '9' # 同步经纪公司数据
FC_BachSyncBrokerData = 'A' # 批量同步经纪公司数据
FC_SuperQuery = 'B' # 超级查询
FC_ParkedOrderInsert = 'C' # 预埋报单插入
FC_ParkedOrderAction = 'D' # 预埋报单操作
FC_SyncOTP = 'E' # 同步动态令牌
FC_DeleteOrder = 'F' # 删除未知单
T['BrokerFunctionCode'] = 'char' # 经纪公司功能代码
BFC_ForceUserLogout = '1' # 强制用户登出
BFC_UserPasswordUpdate = '2' # 变更用户口令
BFC_SyncBrokerData = '3' # 同步经纪公司数据
BFC_BachSyncBrokerData = '4' # 批量同步经纪公司数据
BFC_OrderInsert = '5' # 报单插入
BFC_OrderAction = '6' # 报单操作
BFC_AllQuery = '7' # 全部查询
BFC_log = 'a' # 系统功能:登入/登出/修改密码等
BFC_BaseQry = 'b' # 基本查询:查询基础数据,如合约,交易所等常量
BFC_TradeQry = 'c' # 交易查询:如查成交,委托
BFC_Trade = 'd' # 交易功能:报单,撤单
BFC_Virement = 'e' # 银期转账
BFC_Risk = 'f' # 风险监控
BFC_Session = 'g' # 查询/管理:查询会话,踢人等
BFC_RiskNoticeCtl = 'h' # 风控通知控制
BFC_RiskNotice = 'i' # 风控通知发送
BFC_BrokerDeposit = 'j' # 察看经纪公司资金权限
BFC_QueryFund = 'k' # 资金查询
BFC_QueryOrder = 'l' # 报单查询
BFC_QueryTrade = 'm' # 成交查询
BFC_QueryPosition = 'n' # 持仓查询
BFC_QueryMarketData = 'o' # 行情查询
BFC_QueryUserEvent = 'p' # 用户事件查询
BFC_QueryRiskNotify = 'q' # 风险通知查询
BFC_QueryFundChange = 'r' # 出入金查询
BFC_QueryInvestor = 's' # 投资者信息查询
BFC_QueryTradingCode = 't' # 交易编码查询
BFC_ForceClose = 'u' # 强平
BFC_PressTest = 'v' # 压力测试
BFC_RemainCalc = 'w' # 权益反算
BFC_NetPositionInd = 'x' # 净持仓保证金指标
BFC_RiskPredict = 'y' # 风险预算
BFC_DataExport = 'z' # 数据导出
BFC_RiskTargetSetup = 'A' # 风控指标设置
BFC_MarketDataWarn = 'B' # 行情预警
BFC_QryBizNotice = 'C' # 业务通知查询
BFC_CfgBizNotice = 'D' # 业务通知模板设置
BFC_SyncOTP = 'E' # 同步动态令牌
BFC_SendBizNotice = 'F' # 发送业务通知
BFC_CfgRiskLevelStd = 'G' # 风险级别标准设置
BFC_TbCommand = 'H' # 交易终端应急功能
BFC_DeleteOrder = 'J' # 删除未知单
BFC_ParkedOrderInsert = 'K' # 预埋报单插入
BFC_ParkedOrderAction = 'L' # 预埋报单操作
T['OrderActionStatus'] = 'char' # 报单操作状态
OAS_Submitted = 'a' # 已经提交
OAS_Accepted = 'b' # 已经接受
OAS_Rejected = 'c' # 已经被拒绝
T['OrderStatus'] = 'char' # 报单状态
OST_AllTraded = '0' # 全部成交
OST_PartTradedQueueing = '1' # 部分成交还在队列中
OST_PartTradedNotQueueing = '2' # 部分成交不在队列中
OST_NoTradeQueueing = '3' # 未成交还在队列中
OST_NoTradeNotQueueing = '4' # 未成交不在队列中
OST_Canceled = '5' # 撤单
OST_Unknown = 'a' # 未知
OST_NotTouched = 'b' # 尚未触发
OST_Touched = 'c' # 已触发
T['OrderSubmitStatus'] = 'char' # 报单提交状态
OSS_InsertSubmitted = '0' # 已经提交
OSS_CancelSubmitted = '1' # 撤单已经提交
OSS_ModifySubmitted = '2' # 修改已经提交
OSS_Accepted = '3' # 已经接受
OSS_InsertRejected = '4' # 报单已经被拒绝
OSS_CancelRejected = '5' # 撤单已经被拒绝
OSS_ModifyRejected = '6' # 改单已经被拒绝
T['PositionDate'] = 'char' # 持仓日期
PSD_Today = '1' # 今日持仓
PSD_History = '2' # 历史持仓
T['PositionDateType'] = 'char' # 持仓日期类型
PDT_UseHistory = '1' # 使用历史持仓
PDT_NoUseHistory = '2' # 不使用历史持仓
T['TradingRole'] = 'char' # 交易角色
ER_Broker = '1' # 代理
ER_Host = '2' # 自营
ER_Maker = '3' # 做市商
T['ProductClass'] = 'char' # 产品类型
PC_Futures = '1' # 期货
PC_Options = '2' # 期货期权
PC_Combination = '3' # 组合
PC_Spot = '4' # 即期
PC_EFP = '5' # 期转现
PC_SpotOption = '6' # 现货期权
T['InstLifePhase'] = 'char' # 合约生命周期状态
IP_NotStart = '0' # 未上市
IP_Started = '1' # 上市
IP_Pause = '2' # 停牌
IP_Expired = '3' # 到期
T['Direction'] = 'char' # 买卖方向
D_Buy = '0' # 买
D_Sell = '1' # 卖
T['PositionType'] = 'char' # 持仓类型
PT_Net = '1' # 净持仓
PT_Gross = '2' # 综合持仓
T['PosiDirection'] = 'char' # 持仓多空方向
PD_Net = '1' # 净
PD_Long = '2' # 多头
PD_Short = '3' # 空头
T['SysSettlementStatus'] = 'char' # 系统结算状态
SS_NonActive = '1' # 不活跃
SS_Startup = '2' # 启动
SS_Operating = '3' # 操作
SS_Settlement = '4' # 结算
SS_SettlementFinished = '5' # 结算完成
T['RatioAttr'] = 'char' # 费率属性
RA_Trade = '0' # 交易费率
RA_Settlement = '1' # 结算费率
T['HedgeFlag'] = 'char' # 投机套保标志
HF_Speculation = '1' # 投机
HF_Arbitrage = '2' # 套利
HF_Hedge = '3' # 套保
T['BillHedgeFlag'] = 'char' # 投机套保标志
BHF_Speculation = '1' # 投机
BHF_Arbitrage = '2' # 套利
BHF_Hedge = '3' # 套保
T['ClientIDType'] = 'char' # 交易编码类型
CIDT_Speculation = '1' # 投机
CIDT_Arbitrage = '2' # 套利
CIDT_Hedge = '3' # 套保
T['OrderPriceType'] = 'char' # 报单价格条件
OPT_AnyPrice = '1' # 任意价
OPT_LimitPrice = '2' # 限价
OPT_BestPrice = '3' # 最优价
OPT_LastPrice = '4' # 最新价
OPT_LastPricePlusOneTicks = '5' # 最新价浮动上浮1个ticks
OPT_LastPricePlusTwoTicks = '6' # 最新价浮动上浮2个ticks
OPT_LastPricePlusThreeTicks = '7' # 最新价浮动上浮3个ticks
OPT_AskPrice1 = '8' # 卖一价
OPT_AskPrice1PlusOneTicks = '9' # 卖一价浮动上浮1个ticks
OPT_AskPrice1PlusTwoTicks = 'A' # 卖一价浮动上浮2个ticks
OPT_AskPrice1PlusThreeTicks = 'B' # 卖一价浮动上浮3个ticks
OPT_BidPrice1 = 'C' # 买一价
OPT_BidPrice1PlusOneTicks = 'D' # 买一价浮动上浮1个ticks
OPT_BidPrice1PlusTwoTicks = 'E' # 买一价浮动上浮2个ticks
OPT_BidPrice1PlusThreeTicks = 'F' # 买一价浮动上浮3个ticks
OPT_FiveLevelPrice = 'G' # 五档价
T['OffsetFlag'] = 'char' # 开平标志
OF_Open = '0' # 开仓
OF_Close = '1' # 平仓
OF_ForceClose = '2' # 强平
OF_CloseToday = '3' # 平今
OF_CloseYesterday = '4' # 平昨
OF_ForceOff = '5' # 强减
OF_LocalForceClose = '6' # 本地强平
T['ForceCloseReason'] = 'char' # 强平原因
FCC_NotForceClose = '0' # 非强平
FCC_LackDeposit = '1' # 资金不足
FCC_ClientOverPositionLimit = '2' # 客户超仓
FCC_MemberOverPositionLimit = '3' # 会员超仓
FCC_NotMultiple = '4' # 持仓非整数倍
FCC_Violation = '5' # 违规
FCC_Other = '6' # 其它
FCC_PersonDeliv = '7' # 自然人临近交割
T['OrderType'] = 'char' # 报单类型
ORDT_Normal = '0' # 正常
ORDT_DeriveFromQuote = '1' # 报价衍生
ORDT_DeriveFromCombination = '2' # 组合衍生
ORDT_Combination = '3' # 组合报单
ORDT_ConditionalOrder = '4' # 条件单
ORDT_Swap = '5' # 互换单
T['TimeCondition'] = 'char' # 有效期类型
TC_IOC = '1' # 立即完成,否则撤销
TC_GFS = '2' # 本节有效
TC_GFD = '3' # 当日有效
TC_GTD = '4' # 指定日期前有效
TC_GTC = '5' # 撤销前有效
TC_GFA = '6' # 集合竞价有效
T['VolumeCondition'] = 'char' # 成交量类型
VC_AV = '1' # 任何数量
VC_MV = '2' # 最小数量
VC_CV = '3' # 全部数量
T['ContingentCondition'] = 'char' # 触发条件
CC_Immediately = '1' # 立即
CC_Touch = '2' # 止损
CC_TouchProfit = '3' # 止赢
CC_ParkedOrder = '4' # 预埋单
CC_LastPriceGreaterThanStopPrice = '5' # 最新价大于条件价
CC_LastPriceGreaterEqualStopPrice = '6' # 最新价大于等于条件价
CC_LastPriceLesserThanStopPrice = '7' # 最新价小于条件价
CC_LastPriceLesserEqualStopPrice = '8' # 最新价小于等于条件价
CC_AskPriceGreaterThanStopPrice = '9' # 卖一价大于条件价
CC_AskPriceGreaterEqualStopPrice = 'A' # 卖一价大于等于条件价
CC_AskPriceLesserThanStopPrice = 'B' # 卖一价小于条件价
CC_AskPriceLesserEqualStopPrice = 'C' # 卖一价小于等于条件价
CC_BidPriceGreaterThanStopPrice = 'D' # 买一价大于条件价
CC_BidPriceGreaterEqualStopPrice = 'E' # 买一价大于等于条件价
CC_BidPriceLesserThanStopPrice = 'F' # 买一价小于条件价
CC_BidPriceLesserEqualStopPrice = 'H' # 买一价小于等于条件价
T['ActionFlag'] = 'char' # 操作标志
AF_Delete = '0' # 删除
AF_Modify = '3' # 修改
T['TradingRight'] = 'char' # 交易权限
TR_Allow = '0' # 可以交易
TR_CloseOnly = '1' # 只能平仓
TR_Forbidden = '2' # 不能交易
T['OrderSource'] = 'char' # 报单来源
OSRC_Participant = '0' # 来自参与者
OSRC_Administrator = '1' # 来自管理员
T['TradeType'] = 'char' # 成交类型
TRDT_SplitCombination = '#' # 组合持仓拆分为单一持仓,初始化不应包含该类型的持仓
TRDT_Common = '0' # 普通成交
TRDT_OptionsExecution = '1' # 期权执行
TRDT_OTC = '2' # OTC成交
TRDT_EFPDerived = '3' # 期转现衍生成交
TRDT_CombinationDerived = '4' # 组合衍生成交
T['PriceSource'] = 'char' # 成交价来源
PSRC_LastPrice = '0' # 前成交价
PSRC_Buy = '1' # 买委托价
PSRC_Sell = '2' # 卖委托价
T['InstrumentStatus'] = 'char' # 合约交易状态
IS_BeforeTrading = '0' # 开盘前
IS_NoTrading = '1' # 非交易
IS_Continous = '2' # 连续交易
IS_AuctionOrdering = '3' # 集合竞价报单
IS_AuctionBalance = '4' # 集合竞价价格平衡
IS_AuctionMatch = '5' # 集合竞价撮合
IS_Closed = '6' # 收盘
T['InstStatusEnterReason'] = 'char' # 品种进入交易状态原因
IER_Automatic = '1' # 自动切换
IER_Manual = '2' # 手动切换
IER_Fuse = '3' # 熔断
T['OrderActionRef'] = 'int' # 报单操作引用
T['InstallCount'] = 'int' # 安装数量
T['InstallID'] = 'int' # 安装编号
T['ErrorID'] = 'int' # 错误代码
T['SettlementID'] = 'int' # 结算编号
T['Volume'] = 'int' # 数量
T['FrontID'] = 'int' # 前置编号
T['SessionID'] = 'int' # 会话编号
T['SequenceNo'] = 'int' # 序号
T['CommandNo'] = 'int' # DB命令序号
T['Millisec'] = 'int' # 时间(毫秒)
T['VolumeMultiple'] = 'int' # 合约数量乘数
T['TradingSegmentSN'] = 'int' # 交易阶段编号
T['RequestID'] = 'int' # 请求编号
T['Year'] = 'int' # 年份
T['Month'] = 'int' # 月份
T['Bool'] = 'int' # 布尔型
T['Price'] = 'double' # 价格
T['CombOffsetFlag'] = 'char[5]' # 组合开平标志
T['CombHedgeFlag'] = 'char[5]' # 组合投机套保标志
T['Ratio'] = 'double' # 比率
T['Money'] = 'double' # 资金
T['LargeVolume'] = 'double' # 大额数量
T['SequenceSeries'] = 'short' # 序列系列号
T['CommPhaseNo'] = 'short' # 通讯时段编号
T['SequenceLabel'] = 'char[2]' # 序列编号
T['UnderlyingMultiple'] = 'double' # 基础商品乘数
T['Priority'] = 'int' # 优先级
T['ContractCode'] = 'char[41]' # 合同编号
T['City'] = 'char[51]' # 市
T['IsStock'] = 'char[11]' # 是否股民
T['Channel'] = 'char[51]' # 渠道
T['Address'] = 'char[101]' # 通讯地址
T['ZipCode'] = 'char[7]' # 邮政编码
T['Telephone'] = 'char[41]' # 联系电话
T['Fax'] = 'char[41]' # 传真
T['Mobile'] = 'char[41]' # 手机
T['EMail'] = 'char[41]' # 电子邮件
T['Memo'] = 'char[161]' # 备注
T['CompanyCode'] = 'char[51]' # 企业代码
T['Website'] = 'char[51]' # 网站地址
T['TaxNo'] = 'char[31]' # 税务登记号
T['BatchStatus'] = 'char' # 处理状态
BS_NoUpload = '1' # 未上传
BS_Uploaded = '2' # 已上传
BS_Failed = '3' # 审核失败
T['PropertyID'] = 'char[33]' # 属性代码
T['PropertyName'] = 'char[65]' # 属性名称
T['LicenseNo'] = 'char[51]' # 营业执照号
T['AgentID'] = 'char[13]' # 经纪人代码
T['AgentName'] = 'char[41]' # 经纪人名称
T['AgentGroupID'] = 'char[13]' # 经纪人组代码
T['AgentGroupName'] = 'char[41]' # 经纪人组名称
T['ReturnStyle'] = 'char' # 按品种返还方式
RS_All = '1' # 按所有品种
RS_ByProduct = '2' # 按品种
T['ReturnPattern'] = 'char' # 返还模式
RP_ByVolume = '1' # 按成交手数
RP_ByFeeOnHand = '2' # 按留存手续费
T['ReturnLevel'] = 'char' # 返还级别
RL_Level1 = '1' # 级别1
RL_Level2 = '2' # 级别2
RL_Level3 = '3' # 级别3
RL_Level4 = '4' # 级别4
RL_Level5 = '5' # 级别5
RL_Level6 = '6' # 级别6
RL_Level7 = '7' # 级别7
RL_Level8 = '8' # 级别8
RL_Level9 = '9' # 级别9
T['ReturnStandard'] = 'char' # 返还标准
RSD_ByPeriod = '1' # 分阶段返还
RSD_ByStandard = '2' # 按某一标准
T['MortgageType'] = 'char' # 质押类型
MT_Out = '0' # 质出
MT_In = '1' # 质入
T['InvestorSettlementParamID'] = 'char' # 投资者结算参数代码
ISPI_MortgageRatio = '4' # 质押比例
ISPI_MarginWay = '5' # 保证金算法
ISPI_BillDeposit = '9' # 结算单结存是否包含质押
T['ExchangeSettlementParamID'] = 'char' # 交易所结算参数代码
ESPI_MortgageRatio = '1' # 质押比例
ESPI_OtherFundItem = '2' # 分项资金导入项
ESPI_OtherFundImport = '3' # 分项资金入交易所出入金
ESPI_CFFEXMinPrepa = '6' # 中金所开户最低可用金额
ESPI_CZCESettlementType = '7' # 郑商所结算方式
ESPI_ExchDelivFeeMode = '9' # 交易所交割手续费收取方式
ESPI_DelivFeeMode = '0' # 投资者交割手续费收取方式
ESPI_CZCEComMarginType = 'A' # 郑商所组合持仓保证金收取方式
ESPI_DceComMarginType = 'B' # 大商所套利保证金是否优惠
ESPI_OptOutDisCountRate = 'a' # 虚值期权保证金优惠比率
ESPI_OptMiniGuarantee = 'b' # 最低保障系数
T['SystemParamID'] = 'char' # 系统参数代码
SPI_InvestorIDMinLength = '1' # 投资者代码最小长度
SPI_AccountIDMinLength = '2' # 投资者帐号代码最小长度
SPI_UserRightLogon = '3' # 投资者开户默认登录权限
SPI_SettlementBillTrade = '4' # 投资者交易结算单成交汇总方式
SPI_TradingCode = '5' # 统一开户更新交易编码方式
SPI_CheckFund = '6' # 结算是否判断存在未复核的出入金和分项资金
SPI_CommModelRight = '7' # 是否启用手续费模板数据权限
SPI_MarginModelRight = '9' # 是否启用保证金率模板数据权限
SPI_IsStandardActive = '8' # 是否规范用户才能激活
SPI_UploadSettlementFile = 'U' # 上传的交易所结算文件路径
SPI_DownloadCSRCFile = 'D' # 上报保证金监控中心文件路径
SPI_SettlementBillFile = 'S' # 生成的结算单文件路径
SPI_CSRCOthersFile = 'C' # 证监会文件标识
SPI_InvestorPhoto = 'P' # 投资者照片路径
SPI_CSRCData = 'R' # 全结经纪公司上传文件路径
SPI_InvestorPwdModel = 'I' # 开户密码录入方式
SPI_CFFEXInvestorSettleFile = 'F' # 投资者中金所结算文件下载路径
SPI_InvestorIDType = 'a' # 投资者代码编码方式
SPI_FreezeMaxReMain = 'r' # 休眠户最高权益
SPI_IsSync = 'A' # 手续费相关操作实时上场开关
SPI_RelieveOpenLimit = 'O' # 解除开仓权限限制
SPI_IsStandardFreeze = 'X' # 是否规范用户才能休眠
SPI_CZCENormalProductHedge = 'B' # 郑商所是否开放所有品种套保交易
T['TradeParamID'] = 'char' # 交易系统参数代码
TPID_EncryptionStandard = 'E' # 系统加密算法
TPID_RiskMode = 'R' # 系统风险算法
TPID_RiskModeGlobal = 'G' # 系统风险算法是否全局 0-否 1-是
TPID_modeEncode = 'P' # 密码加密算法
TPID_tickMode = 'T' # 价格小数位数参数
TPID_SingleUserSessionMaxNum = 'S' # 用户最大会话数
TPID_LoginFailMaxNum = 'L' # 最大连续登录失败数
TPID_IsAuthForce = 'A' # 是否强制认证
TPID_IsPosiFreeze = 'F' # 是否冻结证券持仓
TPID_IsPosiLimit = 'M' # 是否限仓
TPID_ForQuoteTimeInterval = 'Q' # 郑商所询价时间间隔
T['SettlementParamValue'] = 'char[256]' # 参数代码值
T['CounterID'] = 'char[33]' # 计数器代码
T['InvestorGroupName'] = 'char[41]' # 投资者分组名称
T['BrandCode'] = 'char[257]' # 牌号
T['Warehouse'] = 'char[257]' # 仓库
T['ProductDate'] = 'char[41]' # 产期
T['Grade'] = 'char[41]' # 等级
T['Classify'] = 'char[41]' # 类别
T['Position'] = 'char[41]' # 货位
T['Yieldly'] = 'char[41]' # 产地
T['Weight'] = 'char[41]' # 公定重量
T['SubEntryFundNo'] = 'int' # 分项资金流水号
T['FileID'] = 'char' # 文件标识
FI_SettlementFund = 'F' # 资金数据
FI_Trade = 'T' # 成交数据
FI_InvestorPosition = 'P' # 投资者持仓数据
FI_SubEntryFund = 'O' # 投资者分项资金数据
FI_CZCECombinationPos = 'C' # 组合持仓数据
FI_CSRCData = 'R' # 上报保证金监控中心数据
FI_CZCEClose = 'L' # 郑商所平仓了结数据
FI_CZCENoClose = 'N' # 郑商所非平仓了结数据
FI_PositionDtl = 'D' # 持仓明细数据
FI_OptionStrike = 'S' # 期权执行文件
FI_SettlementPriceComparison = 'M' # 结算价比对文件
FI_NonTradePosChange = 'B' # 上期所非持仓变动明细
T['FileName'] = 'char[257]' # 文件名称
T['FileType'] = 'char' # 文件上传类型
FUT_Settlement = '0' # 结算
FUT_Check = '1' # 核对
T['FileFormat'] = 'char' # 文件格式
FFT_Txt = '0' # 文本文件(.txt)
FFT_Zip = '1' # 压缩文件(.zip)
FFT_DBF = '2' # DBF文件(.dbf)
T['FileUploadStatus'] = 'char' # 文件状态
FUS_SucceedUpload = '1' # 上传成功
FUS_FailedUpload = '2' # 上传失败
FUS_SucceedLoad = '3' # 导入成功
FUS_PartSucceedLoad = '4' # 导入部分成功
FUS_FailedLoad = '5' # 导入失败
T['TransferDirection'] = 'char' # 移仓方向
TD_Out = '0' # 移出
TD_In = '1' # 移入
T['UploadMode'] = 'char[21]' # 上传文件类型
T['AccountID'] = 'char[13]' # 投资者帐号
T['BankFlag'] = 'char[4]' # 银行统一标识类型
T['BankAccount'] = 'char[41]' # 银行账户
T['OpenName'] = 'char[61]' # 银行账户的开户人名称
T['OpenBank'] = 'char[101]' # 银行账户的开户行
T['BankName'] = 'char[101]' # 银行名称
T['PublishPath'] = 'char[257]' # 发布路径
T['OperatorID'] = 'char[65]' # 操作员代码
T['MonthCount'] = 'int' # 月份数量
T['AdvanceMonthArray'] = 'char[13]' # 月份提前数组
T['DateExpr'] = 'char[1025]' # 日期表达式
T['InstrumentIDExpr'] = 'char[41]' # 合约代码表达式
T['InstrumentNameExpr'] = 'char[41]' # 合约名称表达式
T['SpecialCreateRule'] = 'char' # 特殊的创建规则
SC_NoSpecialRule = '0' # 没有特殊创建规则
SC_NoSpringFestival = '1' # 不包含春节
T['BasisPriceType'] = 'char' # 挂牌基准价类型
IPT_LastSettlement = '1' # 上一合约结算价
IPT_LaseClose = '2' # 上一合约收盘价
T['ProductLifePhase'] = 'char' # 产品生命周期状态
PLP_Active = '1' # 活跃
PLP_NonActive = '2' # 不活跃
PLP_Canceled = '3' # 注销
T['DeliveryMode'] = 'char' # 交割方式
DM_CashDeliv = '1' # 现金交割
DM_CommodityDeliv = '2' # 实物交割
T['LogLevel'] = 'char[33]' # 日志级别
T['ProcessName'] = 'char[257]' # 存储过程名称
T['OperationMemo'] = 'char[1025]' # 操作摘要
T['FundIOType'] = 'char' # 出入金类型
FIOT_FundIO = '1' # 出入金
FIOT_Transfer = '2' # 银期转帐
FIOT_SwapCurrency = '3' # 银期换汇
T['FundType'] = 'char' # 资金类型
FT_Deposite = '1' # 银行存款
FT_ItemFund = '2' # 分项资金
FT_Company = '3' # 公司调整
FT_InnerTransfer = '4' # 资金内转
T['FundDirection'] = 'char' # 出入金方向
FD_In = '1' # 入金
FD_Out = '2' # 出金
T['FundStatus'] = 'char' # 资金状态
FS_Record = '1' # 已录入
FS_Check = '2' # 已复核
FS_Charge = '3' # 已冲销
T['BillNo'] = 'char[15]' # 票据号
T['BillName'] = 'char[33]' # 票据名称
T['PublishStatus'] = 'char' # 发布状态
PS_None = '1' # 未发布
PS_Publishing = '2' # 正在发布
PS_Published = '3' # 已发布
T['EnumValueID'] = 'char[65]' # 枚举值代码
T['EnumValueType'] = 'char[33]' # 枚举值类型
T['EnumValueLabel'] = 'char[65]' # 枚举值名称
T['EnumValueResult'] = 'char[33]' # 枚举值结果
T['SystemStatus'] = 'char' # 系统状态
ES_NonActive = '1' # 不活跃
ES_Startup = '2' # 启动
ES_Initialize = '3' # 交易开始初始化
ES_Initialized = '4' # 交易完成初始化
ES_Close = '5' # 收市开始
ES_Closed = '6' # 收市完成
ES_Settlement = '7' # 结算
T['SettlementStatus'] = 'char' # 结算状态
STS_Initialize = '0' # 初始
STS_Settlementing = '1' # 结算中
STS_Settlemented = '2' # 已结算
STS_Finished = '3' # 结算完成
T['RangeIntType'] = 'char[33]' # 限定值类型
T['RangeIntFrom'] = 'char[33]' # 限定值下限
T['RangeIntTo'] = 'char[33]' # 限定值上限
T['FunctionID'] = 'char[25]' # 功能代码
T['FunctionValueCode'] = 'char[257]' # 功能编码
T['FunctionName'] = 'char[65]' # 功能名称
T['RoleID'] = 'char[11]' # 角色编号
T['RoleName'] = 'char[41]' # 角色名称
T['Description'] = 'char[401]' # 描述
T['CombineID'] = 'char[25]' # 组合编号
T['CombineType'] = 'char[25]' # 组合类型
T['InvestorType'] = 'char' # 投资者类型
CT_Person = '0' # 自然人
CT_Company = '1' # 法人
CT_Fund = '2' # 投资基金
CT_SpecialOrgan = '3' # 特殊法人
CT_Asset = '4' # 资管户
T['BrokerType'] = 'char' # 经纪公司类型
BT_Trade = '0' # 交易会员
BT_TradeSettle = '1' # 交易结算会员
T['RiskLevel'] = 'char' # 风险等级
FAS_Low = '1' # 低风险客户
FAS_Normal = '2' # 普通客户
FAS_Focus = '3' # 关注客户
FAS_Risk = '4' # 风险客户
T['FeeAcceptStyle'] = 'char' # 手续费收取方式
FAS_ByTrade = '1' # 按交易收取
FAS_ByDeliv = '2' # 按交割收取
FAS_None = '3' # 不收
FAS_FixFee = '4' # 按指定手续费收取
T['PasswordType'] = 'char' # 密码类型
PWDT_Trade = '1' # 交易密码
PWDT_Account = '2' # 资金密码
T['Algorithm'] = 'char' # 盈亏算法
AG_All = '1' # 浮盈浮亏都计算
AG_OnlyLost = '2' # 浮盈不计,浮亏计
AG_OnlyGain = '3' # 浮盈计,浮亏不计
AG_None = '4' # 浮盈浮亏都不计算
T['IncludeCloseProfit'] = 'char' # 是否包含平仓盈利
ICP_Include = '0' # 包含平仓盈利
ICP_NotInclude = '2' # 不包含平仓盈利
T['AllWithoutTrade'] = 'char' # 是否受可提比例限制
AWT_Enable = '0' # 无仓无成交不受可提比例限制
AWT_Disable = '2' # 受可提比例限制
AWT_NoHoldEnable = '3' # 无仓不受可提比例限制
T['Comment'] = 'char[31]' # 盈亏算法说明
T['Version'] = 'char[4]' # 版本号
T['TradeCode'] = 'char[7]' # 交易代码
T['TradeDate'] = 'char[9]' # 交易日期
T['TradeTime'] = 'char[9]' # 交易时间
T['TradeSerial'] = 'char[9]' # 发起方流水号
T['TradeSerialNo'] = 'int' # 发起方流水号
T['FutureID'] = 'char[11]' # 期货公司代码
T['BankID'] = 'char[4]' # 银行代码
T['BankBrchID'] = 'char[5]' # 银行分中心代码
T['BankBranchID'] = 'char[11]' # 分中心代码
T['OperNo'] = 'char[17]' # 交易柜员
T['DeviceID'] = 'char[3]' # 渠道标志
T['RecordNum'] = 'char[7]' # 记录数
T['FutureAccount'] = 'char[22]' # 期货资金账号
T['FuturePwdFlag'] = 'char' # 资金密码核对标志
FPWD_UnCheck = '0' # 不核对
FPWD_Check = '1' # 核对
T['TransferType'] = 'char' # 银期转账类型
TT_BankToFuture = '0' # 银行转期货
TT_FutureToBank = '1' # 期货转银行
T['FutureAccPwd'] = 'char[17]' # 期货资金密码
T['CurrencyCode'] = 'char[4]' # 币种
T['RetCode'] = 'char[5]' # 响应代码
T['RetInfo'] = 'char[129]' # 响应信息
T['TradeAmt'] = 'char[20]' # 银行总余额
T['UseAmt'] = 'char[20]' # 银行可用余额
T['FetchAmt'] = 'char[20]' # 银行可取余额
T['TransferValidFlag'] = 'char' # 转账有效标志
TVF_Invalid = '0' # 无效或失败
TVF_Valid = '1' # 有效
TVF_Reverse = '2' # 冲正
T['CertCode'] = 'char[21]' # 证件号码
T['Reason'] = 'char' # 事由
RN_CD = '0' # 错单
RN_ZT = '1' # 资金在途
RN_QT = '2' # 其它
T['FundProjectID'] = 'char[5]' # 资金项目编号
T['Sex'] = 'char' # 性别
SEX_None = '0' # 未知
SEX_Man = '1' # 男
SEX_Woman = '2' # 女
T['Profession'] = 'char[101]' # 职业
T['National'] = 'char[31]' # 国籍
T['Province'] = 'char[51]' # 省
T['Region'] = 'char[16]' # 区
T['Country'] = 'char[16]' # 国家
T['LicenseNO'] = 'char[33]' # 营业执照
T['CompanyType'] = 'char[16]' # 企业性质
T['BusinessScope'] = 'char[1001]' # 经营范围
T['CapitalCurrency'] = 'char[4]' # 注册资本币种
T['UserType'] = 'char' # 用户类型
UT_Investor = '0' # 投资者
UT_Operator = '1' # 操作员
UT_SuperUser = '2' # 管理员
T['RateType'] = 'char' # 费率类型
RATETYPE_MarginRate = '2' # 保证金率
T['NoteType'] = 'char' # 通知类型
NOTETYPE_TradeSettleBill = '1' # 交易结算单
NOTETYPE_TradeSettleMonth = '2' # 交易结算月报
NOTETYPE_CallMarginNotes = '3' # 追加保证金通知书
NOTETYPE_ForceCloseNotes = '4' # 强行平仓通知书
NOTETYPE_TradeNotes = '5' # 成交通知书
NOTETYPE_DelivNotes = '6' # 交割通知书
T['SettlementStyle'] = 'char' # 结算单方式
SBS_Day = '1' # 逐日盯市
SBS_Volume = '2' # 逐笔对冲
T['BrokerDNS'] = 'char[256]' # 域名
T['Sentence'] = 'char[501]' # 语句
T['SettlementBillType'] = 'char' # 结算单类型
ST_Day = '0' # 日报
ST_Month = '1' # 月报
T['UserRightType'] = 'char' # 客户权限类型
URT_Logon = '1' # 登录
URT_Transfer = '2' # 银期转帐
URT_EMail = '3' # 邮寄结算单
URT_Fax = '4' # 传真结算单
URT_ConditionOrder = '5' # 条件单
T['MarginPriceType'] = 'char' # 保证金价格类型
MPT_PreSettlementPrice = '1' # 昨结算价
MPT_SettlementPrice = '2' # 最新价
MPT_AveragePrice = '3' # 成交均价
MPT_OpenPrice = '4' # 开仓价
T['BillGenStatus'] = 'char' # 结算单生成状态
BGS_None = '0' # 未生成
BGS_NoGenerated = '1' # 生成中
BGS_Generated = '2' # 已生成
T['AlgoType'] = 'char' # 算法类型
AT_HandlePositionAlgo = '1' # 持仓处理算法
AT_FindMarginRateAlgo = '2' # 寻找保证金率算法
T['HandlePositionAlgoID'] = 'char' # 持仓处理算法编号
HPA_Base = '1' # 基本
HPA_DCE = '2' # 大连商品交易所
HPA_CZCE = '3' # 郑州商品交易所
T['FindMarginRateAlgoID'] = 'char' # 寻找保证金率算法编号
FMRA_Base = '1' # 基本
FMRA_DCE = '2' # 大连商品交易所
FMRA_CZCE = '3' # 郑州商品交易所
T['HandleTradingAccountAlgoID'] = 'char' # 资金处理算法编号
HTAA_Base = '1' # 基本
HTAA_DCE = '2' # 大连商品交易所
HTAA_CZCE = '3' # 郑州商品交易所
T['PersonType'] = 'char' # 联系人类型
PST_Order = '1' # 指定下单人
PST_Open = '2' # 开户授权人
PST_Fund = '3' # 资金调拨人
PST_Settlement = '4' # 结算单确认人
PST_Company = '5' # 法人
PST_Corporation = '6' # 法人代表
PST_LinkMan = '7' # 投资者联系人
PST_Ledger = '8' # 分户管理资产负责人
PST_Trustee = '9' # 托(保)管人
PST_TrusteeCorporation = 'A' # 托(保)管机构法人代表
PST_TrusteeOpen = 'B' # 托(保)管机构开户授权人
PST_TrusteeContact = 'C' # 托(保)管机构联系人
PST_ForeignerRefer = 'D' # 境外自然人参考证件
PST_CorporationRefer = 'E' # 法人代表参考证件
T['QueryInvestorRange'] = 'char' # 查询范围
QIR_All = '1' # 所有
QIR_Group = '2' # 查询分类
QIR_Single = '3' # 单一投资者
T['InvestorRiskStatus'] = 'char' # 投资者风险状态
IRS_Normal = '1' # 正常
IRS_Warn = '2' # 警告
IRS_Call = '3' # 追保
IRS_Force = '4' # 强平
IRS_Exception = '5' # 异常
T['LegID'] = 'int' # 单腿编号
T['LegMultiple'] = 'int' # 单腿乘数
T['ImplyLevel'] = 'int' # 派生层数
T['ClearAccount'] = 'char[33]' # 结算账户
T['OrganNO'] = 'char[6]' # 结算账户
T['ClearbarchID'] = 'char[6]' # 结算账户联行号
T['UserEventType'] = 'char' # 用户事件类型
UET_Login = '1' # 登录
UET_Logout = '2' # 登出
UET_Trading = '3' # 交易成功
UET_TradingError = '4' # 交易失败
UET_UpdatePassword = '5' # 修改密码
UET_Authenticate = '6' # 客户端认证
UET_Other = '9' # 其他
T['UserEventInfo'] = 'char[1025]' # 用户事件信息
T['CloseStyle'] = 'char' # 平仓方式
ICS_Close = '0' # 先开先平
ICS_CloseToday = '1' # 先平今再平昨
T['StatMode'] = 'char' # 统计方式
SM_Non = '0' # ----
SM_Instrument = '1' # 按合约统计
SM_Product = '2' # 按产品统计
SM_Investor = '3' # 按投资者统计
T['ParkedOrderStatus'] = 'char' # 预埋单状态
PAOS_NotSend = '1' # 未发送
PAOS_Send = '2' # 已发送
PAOS_Deleted = '3' # 已删除
T['ParkedOrderID'] = 'char[13]' # 预埋报单编号
T['ParkedOrderActionID'] = 'char[13]' # 预埋撤单编号
T['VirDealStatus'] = 'char' # 处理状态
VDS_Dealing = '1' # 正在处理
VDS_DeaclSucceed = '2' # 处理成功
T['OrgSystemID'] = 'char' # 原有系统代码
ORGS_Standard = '0' # 综合交易平台
ORGS_ESunny = '1' # 易盛系统
ORGS_KingStarV6 = '2' # 金仕达V6系统
T['VirTradeStatus'] = 'char' # 交易状态
VTS_NaturalDeal = '0' # 正常处理中
VTS_SucceedEnd = '1' # 成功结束
VTS_FailedEND = '2' # 失败结束
VTS_Exception = '3' # 异常中
VTS_ManualDeal = '4' # 已人工异常处理
VTS_MesException = '5' # 通讯异常 ,请人工处理
VTS_SysException = '6' # 系统出错,请人工处理
T['VirBankAccType'] = 'char' # 银行帐户类型
VBAT_BankBook = '1' # 存折
VBAT_BankCard = '2' # 储蓄卡
VBAT_CreditCard = '3' # 信用卡
T['VirementStatus'] = 'char' # 银行帐户类型
VMS_Natural = '0' # 正常
VMS_Canceled = '9' # 销户
T['VirementAvailAbility'] = 'char' # 有效标志
VAA_NoAvailAbility = '0' # 未确认
VAA_AvailAbility = '1' # 有效
VAA_Repeal = '2' # 冲正
T['VirementTradeCode'] = 'char[7]' # 交易代码
VTC_BankBankToFuture = '102001' # 银行发起银行资金转期货
VTC_BankFutureToBank = '102002' # 银行发起期货资金转银行
VTC_FutureBankToFuture = '202001' # 期货发起银行资金转期货
VTC_FutureFutureToBank = '202002' # 期货发起期货资金转银行
T['PhotoTypeName'] = 'char[41]' # 影像类型名称
T['PhotoTypeID'] = 'char[5]' # 影像类型代码
T['PhotoName'] = 'char[161]' # 影像名称
T['TopicID'] = 'int' # 主题代码
T['ReportTypeID'] = 'char[3]' # 交易报告类型标识
T['CharacterID'] = 'char[5]' # 交易特征代码
T['AMLParamID'] = 'char[21]' # 参数代码
T['AMLInvestorType'] = 'char[3]' # 投资者类型
T['AMLIdCardType'] = 'char[3]' # 证件类型
T['AMLTradeDirect'] = 'char[3]' # 资金进出方向
T['AMLTradeModel'] = 'char[3]' # 资金进出方式
T['AMLParamID'] = 'char[21]' # 参数代码
T['AMLOpParamValue'] = 'double' # 业务参数代码值
T['AMLCustomerCardType'] = 'char[81]' # 客户身份证件/证明文件类型
T['AMLInstitutionName'] = 'char[65]' # 金融机构网点名称
T['AMLDistrictID'] = 'char[7]' # 金融机构网点所在地区行政区划代码
T['AMLRelationShip'] = 'char[3]' # 金融机构网点与大额交易的关系
T['AMLInstitutionType'] = 'char[3]' # 金融机构网点代码类型
T['AMLInstitutionID'] = 'char[13]' # 金融机构网点代码
T['AMLAccountType'] = 'char[5]' # 账户类型
T['AMLTradingType'] = 'char[7]' # 交易方式
T['AMLTransactClass'] = 'char[7]' # 涉外收支交易分类与代码
T['AMLCapitalIO'] = 'char[3]' # 资金收付标识
T['AMLSite'] = 'char[10]' # 交易地点
T['AMLCapitalPurpose'] = 'char[129]' # 资金用途
T['AMLReportType'] = 'char[2]' # 报文类型
T['AMLSerialNo'] = 'char[5]' # 编号
T['AMLStatus'] = 'char[2]' # 状态
T['AMLGenStatus'] = 'char' # Aml生成方式
GEN_Program = '0' # 程序生成
GEN_HandWork = '1' # 人工生成
T['AMLSeqCode'] = 'char[65]' # 业务标识号
T['AMLFileName'] = 'char[257]' # AML文件名
T['AMLMoney'] = 'double' # 反洗钱资金
T['AMLFileAmount'] = 'int' # 反洗钱资金
T['CFMMCKey'] = 'char[21]' # 密钥类型(保证金监管)
T['CFMMCToken'] = 'char[21]' # 令牌类型(保证金监管)
T['CFMMCKeyKind'] = 'char' # 动态密钥类别(保证金监管)
CFMMCKK_REQUEST = 'R' # 主动请求更新
CFMMCKK_AUTO = 'A' # CFMMC自动更新
CFMMCKK_MANUAL = 'M' # CFMMC手动更新
T['AMLReportName'] = 'char[81]' # 报文名称
T['IndividualName'] = 'char[51]' # 个人姓名
T['CurrencyID'] = 'char[4]' # 币种代码
T['CustNumber'] = 'char[36]' # 客户编号
T['OrganCode'] = 'char[36]' # 机构编码
T['OrganName'] = 'char[71]' # 机构名称
T['SuperOrganCode'] = 'char[12]' # 上级机构编码,即期货公司总部、银行总行
T['SubBranchID'] = 'char[31]' # 分支机构
T['SubBranchName'] = 'char[71]' # 分支机构名称
T['BranchNetCode'] = 'char[31]' # 机构网点号
T['BranchNetName'] = 'char[71]' # 机构网点名称
T['OrganFlag'] = 'char[2]' # 机构标识
T['BankCodingForFuture'] = 'char[33]' # 银行对期货公司的编码
T['BankReturnCode'] = 'char[7]' # 银行对返回码的定义
T['PlateReturnCode'] = 'char[5]' # 银期转帐平台对返回码的定义
T['BankSubBranchID'] = 'char[31]' # 银行分支机构编码
T['FutureBranchID'] = 'char[31]' # 期货分支机构编码
T['ReturnCode'] = 'char[7]' # 返回代码
T['OperatorCode'] = 'char[17]' # 操作员
T['ClearDepID'] = 'char[6]' # 机构结算帐户机构号
T['ClearBrchID'] = 'char[6]' # 机构结算帐户联行号
T['ClearName'] = 'char[71]' # 机构结算帐户名称
T['BankAccountName'] = 'char[71]' # 银行帐户名称
T['InvDepID'] = 'char[6]' # 机构投资人账号机构号
T['InvBrchID'] = 'char[6]' # 机构投资人联行号
T['MessageFormatVersion'] = 'char[36]' # 信息格式版本
T['Digest'] = 'char[36]' # 摘要
T['AuthenticData'] = 'char[129]' # 认证数据
T['PasswordKey'] = 'char[129]' # 密钥
T['FutureAccountName'] = 'char[129]' # 期货帐户名称
T['MobilePhone'] = 'char[21]' # 手机
T['FutureMainKey'] = 'char[129]' # 期货公司主密钥
T['FutureWorkKey'] = 'char[129]' # 期货公司工作密钥
T['FutureTransKey'] = 'char[129]' # 期货公司传输密钥
T['BankMainKey'] = 'char[129]' # 银行主密钥
T['BankWorkKey'] = 'char[129]' # 银行工作密钥
T['BankTransKey'] = 'char[129]' # 银行传输密钥
T['BankServerDescription'] = 'char[129]' # 银行服务器描述信息
T['AddInfo'] = 'char[129]' # 附加信息
T['DescrInfoForReturnCode'] = 'char[129]' # 返回码描述
T['CountryCode'] = 'char[21]' # 国家代码
T['Serial'] = 'int' # 流水号
T['PlateSerial'] = 'int' # 平台流水号
T['BankSerial'] = 'char[13]' # 银行流水号
T['CorrectSerial'] = 'int' # 被冲正交易流水号
T['FutureSerial'] = 'int' # 期货公司流水号
T['ApplicationID'] = 'int' # 应用标识
T['BankProxyID'] = 'int' # 银行代理标识
T['FBTCoreID'] = 'int' # 银期转帐核心系统标识
T['ServerPort'] = 'int' # 服务端口号
T['RepealedTimes'] = 'int' # 已经冲正次数
T['RepealTimeInterval'] = 'int' # 冲正时间间隔
T['TotalTimes'] = 'int' # 每日累计转帐次数
T['FBTRequestID'] = 'int' # 请求ID
T['TID'] = 'int' # 交易ID
T['TradeAmount'] = 'double' # 交易金额(元)
T['CustFee'] = 'double' # 应收客户费用(元)
T['FutureFee'] = 'double' # 应收期货公司费用(元)
T['SingleMaxAmt'] = 'double' # 单笔最高限额
T['SingleMinAmt'] = 'double' # 单笔最低限额
T['TotalAmt'] = 'double' # 每日累计转帐额度
T['CertificationType'] = 'char' # 证件类型
CFT_IDCard = '0' # 身份证
CFT_Passport = '1' # 护照
CFT_OfficerIDCard = '2' # 军官证
CFT_SoldierIDCard = '3' # 士兵证
CFT_HomeComingCard = '4' # 回乡证
CFT_HouseholdRegister = '5' # 户口簿
CFT_LicenseNo = '6' # 营业执照号
CFT_InstitutionCodeCard = '7' # 组织机构代码证
CFT_TempLicenseNo = '8' # 临时营业执照号
CFT_NoEnterpriseLicenseNo = '9' # 民办非企业登记证书
CFT_OtherCard = 'x' # 其他证件
CFT_SuperDepAgree = 'a' # 主管部门批文
T['FileBusinessCode'] = 'char' # 文件业务功能
FBC_Others = '0' # 其他
FBC_TransferDetails = '1' # 转账交易明细对账
FBC_CustAccStatus = '2' # 客户账户状态对账
FBC_AccountTradeDetails = '3' # 账户类交易明细对账
FBC_FutureAccountChangeInfoDetails = '4' # 期货账户信息变更明细对账
FBC_CustMoneyDetail = '5' # 客户资金台账余额明细对账
FBC_CustCancelAccountInfo = '6' # 客户销户结息明细对账
FBC_CustMoneyResult = '7' # 客户资金余额对账结果
FBC_OthersExceptionResult = '8' # 其它对账异常结果文件
FBC_CustInterestNetMoneyDetails = '9' # 客户结息净额明细
FBC_CustMoneySendAndReceiveDetails = 'a' # 客户资金交收明细
FBC_CorporationMoneyTotal = 'b' # 法人存管银行资金交收汇总
FBC_MainbodyMoneyTotal = 'c' # 主体间资金交收汇总
FBC_MainPartMonitorData = 'd' # 总分平衡监管数据
FBC_PreparationMoney = 'e' # 存管银行备付金余额
FBC_BankMoneyMonitorData = 'f' # 协办存管银行资金监管数据
T['CashExchangeCode'] = 'char' # 汇钞标志
CEC_Exchange = '1' # 汇
CEC_Cash = '2' # 钞
T['YesNoIndicator'] = 'char' # 是或否标识
YNI_Yes = '0' # 是
YNI_No = '1' # 否
T['BanlanceType'] = 'char' # 余额类型
BLT_CurrentMoney = '0' # 当前余额
BLT_UsableMoney = '1' # 可用余额
BLT_FetchableMoney = '2' # 可取余额
BLT_FreezeMoney = '3' # 冻结余额
T['Gender'] = 'char' # 性别
GD_Unknown = '0' # 未知状态
GD_Male = '1' # 男
GD_Female = '2' # 女
T['FeePayFlag'] = 'char' # 费用支付标志
FPF_BEN = '0' # 由受益方支付费用
FPF_OUR = '1' # 由发送方支付费用
FPF_SHA = '2' # 由发送方支付发起的费用,受益方支付接受的费用
T['PassWordKeyType'] = 'char' # 密钥类型
PWKT_ExchangeKey = '0' # 交换密钥
PWKT_PassWordKey = '1' # 密码密钥
PWKT_MACKey = '2' # MAC密钥
PWKT_MessageKey = '3' # 报文密钥
T['FBTPassWordType'] = 'char' # 密码类型
PWT_Query = '0' # 查询
PWT_Fetch = '1' # 取款
PWT_Transfer = '2' # 转帐
PWT_Trade = '3' # 交易
T['FBTEncryMode'] = 'char' # 加密方式
EM_NoEncry = '0' # 不加密
EM_DES = '1' # DES
EM_3DES = '2' # 3DES
T['BankRepealFlag'] = 'char' # 银行冲正标志
BRF_BankNotNeedRepeal = '0' # 银行无需自动冲正
BRF_BankWaitingRepeal = '1' # 银行待自动冲正
BRF_BankBeenRepealed = '2' # 银行已自动冲正
T['BrokerRepealFlag'] = 'char' # 期商冲正标志
BRORF_BrokerNotNeedRepeal = '0' # 期商无需自动冲正
BRORF_BrokerWaitingRepeal = '1' # 期商待自动冲正
BRORF_BrokerBeenRepealed = '2' # 期商已自动冲正
T['InstitutionType'] = 'char' # 机构类别
TS_Bank = '0' # 银行
TS_Future = '1' # 期商
TS_Store = '2' # 券商
T['LastFragment'] = 'char' # 最后分片标志
LF_Yes = '0' # 是最后分片
LF_No = '1' # 不是最后分片
T['BankAccStatus'] = 'char' # 银行账户状态
BAS_Normal = '0' # 正常
BAS_Freeze = '1' # 冻结
BAS_ReportLoss = '2' # 挂失
T['MoneyAccountStatus'] = 'char' # 资金账户状态
MAS_Normal = '0' # 正常
MAS_Cancel = '1' # 销户
T['ManageStatus'] = 'char' # 存管状态
MSS_Point = '0' # 指定存管
MSS_PrePoint = '1' # 预指定
MSS_CancelPoint = '2' # 撤销指定
T['SystemType'] = 'char' # 应用系统类型
SYT_FutureBankTransfer = '0' # 银期转帐
SYT_StockBankTransfer = '1' # 银证转帐
SYT_TheThirdPartStore = '2' # 第三方存管
T['TxnEndFlag'] = 'char' # 银期转帐划转结果标志
TEF_NormalProcessing = '0' # 正常处理中
TEF_Success = '1' # 成功结束
TEF_Failed = '2' # 失败结束
TEF_Abnormal = '3' # 异常中
TEF_ManualProcessedForException = '4' # 已人工异常处理
TEF_CommuFailedNeedManualProcess = '5' # 通讯异常 ,请人工处理
TEF_SysErrorNeedManualProcess = '6' # 系统出错,请人工处理
T['ProcessStatus'] = 'char' # 银期转帐服务处理状态
PSS_NotProcess = '0' # 未处理
PSS_StartProcess = '1' # 开始处理
PSS_Finished = '2' # 处理完成
T['CustType'] = 'char' # 客户类型
CUSTT_Person = '0' # 自然人
CUSTT_Institution = '1' # 机构户
T['FBTTransferDirection'] = 'char' # 银期转帐方向
FBTTD_FromBankToFuture = '1' # 入金,银行转期货
FBTTD_FromFutureToBank = '2' # 出金,期货转银行
T['OpenOrDestroy'] = 'char' # 开销户类别
OOD_Open = '1' # 开户
OOD_Destroy = '0' # 销户
T['AvailabilityFlag'] = 'char' # 有效标志
AVAF_Invalid = '0' # 未确认
AVAF_Valid = '1' # 有效
AVAF_Repeal = '2' # 冲正
T['OrganType'] = 'char' # 机构类型
OT_Bank = '1' # 银行代理
OT_Future = '2' # 交易前置
OT_PlateForm = '9' # 银期转帐平台管理
T['OrganLevel'] = 'char' # 机构级别
OL_HeadQuarters = '1' # 银行总行或期商总部
OL_Branch = '2' # 银行分中心或期货公司营业部
T['ProtocalID'] = 'char' # 协议类型
PID_FutureProtocal = '0' # 期商协议
PID_ICBCProtocal = '1' # 工行协议
PID_ABCProtocal = '2' # 农行协议
PID_CBCProtocal = '3' # 中国银行协议
PID_CCBProtocal = '4' # 建行协议
PID_BOCOMProtocal = '5' # 交行协议
PID_FBTPlateFormProtocal = 'X' # 银期转帐平台协议
T['ConnectMode'] = 'char' # 套接字连接方式
CM_ShortConnect = '0' # 短连接
CM_LongConnect = '1' # 长连接
T['SyncMode'] = 'char' # 套接字通信方式
SRM_ASync = '0' # 异步
SRM_Sync = '1' # 同步
T['BankAccType'] = 'char' # 银行帐号类型
BAT_BankBook = '1' # 银行存折
BAT_SavingCard = '2' # 储蓄卡
BAT_CreditCard = '3' # 信用卡
T['FutureAccType'] = 'char' # 期货公司帐号类型
FAT_BankBook = '1' # 银行存折
FAT_SavingCard = '2' # 储蓄卡
FAT_CreditCard = '3' # 信用卡
T['OrganStatus'] = 'char' # 接入机构状态
OS_Ready = '0' # 启用
OS_CheckIn = '1' # 签到
OS_CheckOut = '2' # 签退
OS_CheckFileArrived = '3' # 对帐文件到达
OS_CheckDetail = '4' # 对帐
OS_DayEndClean = '5' # 日终清理
OS_Invalid = '9' # 注销
T['CCBFeeMode'] = 'char' # 建行收费模式
CCBFM_ByAmount = '1' # 按金额扣收
CCBFM_ByMonth = '2' # 按月扣收
T['CommApiType'] = 'char' # 通讯API类型
CAPIT_Client = '1' # 客户端
CAPIT_Server = '2' # 服务端
CAPIT_UserApi = '3' # 交易系统的UserApi
T['ServiceID'] = 'int' # 服务编号
T['ServiceLineNo'] = 'int' # 服务线路编号
T['ServiceName'] = 'char[61]' # 服务名
T['LinkStatus'] = 'char' # 连接状态
LS_Connected = '1' # 已经连接
LS_Disconnected = '2' # 没有连接
T['CommApiPointer'] = 'int' # 通讯API指针
T['PwdFlag'] = 'char' # 密码核对标志
BPWDF_NoCheck = '0' # 不核对
BPWDF_BlankCheck = '1' # 明文核对
BPWDF_EncryptCheck = '2' # 密文核对
T['SecuAccType'] = 'char' # 期货帐号类型
SAT_AccountID = '1' # 资金帐号
SAT_CardID = '2' # 资金卡号
SAT_SHStockholderID = '3' # 上海股东帐号
SAT_SZStockholderID = '4' # 深圳股东帐号
T['TransferStatus'] = 'char' # 转账交易状态
TRFS_Normal = '0' # 正常
TRFS_Repealed = '1' # 被冲正
T['SponsorType'] = 'char' # 发起方
SPTYPE_Broker = '0' # 期商
SPTYPE_Bank = '1' # 银行
T['ReqRspType'] = 'char' # 请求响应类别
REQRSP_Request = '0' # 请求
REQRSP_Response = '1' # 响应
T['FBTUserEventType'] = 'char' # 银期转帐用户事件类型
FBTUET_SignIn = '0' # 签到
FBTUET_FromBankToFuture = '1' # 银行转期货
FBTUET_FromFutureToBank = '2' # 期货转银行
FBTUET_OpenAccount = '3' # 开户
FBTUET_CancelAccount = '4' # 销户
FBTUET_ChangeAccount = '5' # 变更银行账户
FBTUET_RepealFromBankToFuture = '6' # 冲正银行转期货
FBTUET_RepealFromFutureToBank = '7' # 冲正期货转银行
FBTUET_QueryBankAccount = '8' # 查询银行账户
FBTUET_QueryFutureAccount = '9' # 查询期货账户
FBTUET_SignOut = 'A' # 签退
FBTUET_SyncKey = 'B' # 密钥同步
FBTUET_Other = 'Z' # 其他
T['BankIDByBank'] = 'char[21]' # 银行自己的编码
T['BankOperNo'] = 'char[4]' # 银行操作员号
T['BankCustNo'] = 'char[21]' # 银行客户号
T['DBOPSeqNo'] = 'int' # 递增的序列号
T['TableName'] = 'char[61]' # FBT表名
T['PKName'] = 'char[201]' # FBT表操作主键名
T['PKValue'] = 'char[501]' # FBT表操作主键值
T['DBOperation'] = 'char' # 记录操作类型
DBOP_Insert = '0' # 插入
DBOP_Update = '1' # 更新
DBOP_Delete = '2' # 删除
T['SyncFlag'] = 'char' # 同步标记
SYNF_Yes = '0' # 已同步
SYNF_No = '1' # 未同步
T['TargetID'] = 'char[4]' # 同步目标编号
T['SyncType'] = 'char' # 同步类型
SYNT_OneOffSync = '0' # 一次同步
SYNT_TimerSync = '1' # 定时同步
SYNT_TimerFullSync = '2' # 定时完全同步
T['FBETime'] = 'char[7]' # 各种换汇时间
T['FBEBankNo'] = 'char[13]' # 换汇银行行号
T['FBECertNo'] = 'char[13]' # 换汇凭证号
T['ExDirection'] = 'char' # 换汇方向
FBEDIR_Settlement = '0' # 结汇
FBEDIR_Sale = '1' # 售汇
T['FBEBankAccount'] = 'char[33]' # 换汇银行账户
T['FBEBankAccountName'] = 'char[61]' # 换汇银行账户名
T['FBEAmt'] = 'double' # 各种换汇金额
T['FBEBusinessType'] = 'char[3]' # 换汇业务类型
T['FBEPostScript'] = 'char[61]' # 换汇附言
T['FBERemark'] = 'char[71]' # 换汇备注
T['ExRate'] = 'double' # 换汇汇率
T['FBEResultFlag'] = 'char' # 换汇成功标志
FBERES_Success = '0' # 成功
FBERES_InsufficientBalance = '1' # 账户余额不足
FBERES_UnknownTrading = '8' # 交易结果未知
FBERES_Fail = 'x' # 失败
T['FBERtnMsg'] = 'char[61]' # 换汇返回信息
T['FBEExtendMsg'] = 'char[61]' # 换汇扩展信息
T['FBEBusinessSerial'] = 'char[31]' # 换汇记账流水号
T['FBESystemSerial'] = 'char[21]' # 换汇流水号
T['FBETotalExCnt'] = 'int' # 换汇交易总笔数
T['FBEExchStatus'] = 'char' # 换汇交易状态
FBEES_Normal = '0' # 正常
FBEES_ReExchange = '1' # 交易重发
T['FBEFileFlag'] = 'char' # 换汇文件标志
FBEFG_DataPackage = '0' # 数据包
FBEFG_File = '1' # 文件
T['FBEAlreadyTrade'] = 'char' # 换汇已交易标志
FBEAT_NotTrade = '0' # 未交易
FBEAT_Trade = '1' # 已交易
T['FBEOpenBank'] = 'char[61]' # 换汇账户开户行
T['FBEUserEventType'] = 'char' # 银期换汇用户事件类型
FBEUET_SignIn = '0' # 签到
FBEUET_Exchange = '1' # 换汇
FBEUET_ReExchange = '2' # 换汇重发
FBEUET_QueryBankAccount = '3' # 银行账户查询
FBEUET_QueryExchDetial = '4' # 换汇明细查询
FBEUET_QueryExchSummary = '5' # 换汇汇总查询
FBEUET_QueryExchRate = '6' # 换汇汇率查询
FBEUET_CheckBankAccount = '7' # 对账文件通知
FBEUET_SignOut = '8' # 签退
FBEUET_Other = 'Z' # 其他
T['FBEFileName'] = 'char[21]' # 换汇相关文件名
T['FBEBatchSerial'] = 'char[21]' # 换汇批次号
T['FBEReqFlag'] = 'char' # 换汇发送标志
FBERF_UnProcessed = '0' # 未处理
FBERF_WaitSend = '1' # 等待发送
FBERF_SendSuccess = '2' # 发送成功
FBERF_SendFailed = '3' # 发送失败
FBERF_WaitReSend = '4' # 等待重发
T['NotifyClass'] = 'char' # 风险通知类型
NC_NOERROR = '0' # 正常
NC_Warn = '1' # 警示
NC_Call = '2' # 追保
NC_Force = '3' # 强平
NC_CHUANCANG = '4' # 穿仓
NC_Exception = '5' # 异常
T['RiskNofityInfo'] = 'char[257]' # 客户风险通知消息
T['ForceCloseSceneId'] = 'char[24]' # 强平场景编号
T['ForceCloseType'] = 'char' # 强平单类型
FCT_Manual = '0' # 手工强平
FCT_Single = '1' # 单一投资者辅助强平
FCT_Group = '2' # 批量投资者辅助强平
T['InstrumentIDs'] = 'char[101]' # 多个产品代码,用+分隔,如cu+zn
T['RiskNotifyMethod'] = 'char' # 风险通知途径
RNM_System = '0' # 系统通知
RNM_SMS = '1' # 短信通知
RNM_EMail = '2' # 邮件通知
RNM_Manual = '3' # 人工通知
T['RiskNotifyStatus'] = 'char' # 风险通知状态
RNS_NotGen = '0' # 未生成
RNS_Generated = '1' # 已生成未发送
RNS_SendError = '2' # 发送失败
RNS_SendOk = '3' # 已发送未接收
RNS_Received = '4' # 已接收未确认
RNS_Confirmed = '5' # 已确认
T['RiskUserEvent'] = 'char' # 风控用户操作事件
RUE_ExportData = '0' # 导出数据
T['ParamID'] = 'int' # 参数代码
T['ParamName'] = 'char[41]' # 参数名
T['ParamValue'] = 'char[41]' # 参数值
T['ConditionalOrderSortType'] = 'char' # 条件单索引条件
COST_LastPriceAsc = '0' # 使用最新价升序
COST_LastPriceDesc = '1' # 使用最新价降序
COST_AskPriceAsc = '2' # 使用卖价升序
COST_AskPriceDesc = '3' # 使用卖价降序
COST_BidPriceAsc = '4' # 使用买价升序
COST_BidPriceDesc = '5' # 使用买价降序
T['SendType'] = 'char' # 报送状态
UOAST_NoSend = '0' # 未发送
UOAST_Sended = '1' # 已发送
UOAST_Generated = '2' # 已生成
UOAST_SendFail = '3' # 报送失败
UOAST_Success = '4' # 接收成功
UOAST_Fail = '5' # 接收失败
UOAST_Cancel = '6' # 取消报送
T['ClientIDStatus'] = 'char' # 交易编码状态
UOACS_NoApply = '1' # 未申请
UOACS_Submited = '2' # 已提交申请
UOACS_Sended = '3' # 已发送申请
UOACS_Success = '4' # 完成
UOACS_Refuse = '5' # 拒绝
UOACS_Cancel = '6' # 已撤销编码
T['IndustryID'] = 'char[17]' # 行业编码
T['QuestionID'] = 'char[5]' # 特有信息编号
T['QuestionContent'] = 'char[41]' # 特有信息说明
T['OptionID'] = 'char[13]' # 选项编号
T['OptionContent'] = 'char[61]' # 选项说明
T['QuestionType'] = 'char' # 特有信息类型
QT_Radio = '1' # 单选
QT_Option = '2' # 多选
QT_Blank = '3' # 填空
T['ProcessID'] = 'char[33]' # 业务流水号
T['SeqNo'] = 'int' # 流水号
T['UOAProcessStatus'] = 'char[3]' # 流程状态
T['ProcessType'] = 'char[3]' # 流程功能类型
T['BusinessType'] = 'char' # 业务类型
BT_Request = '1' # 请求
BT_Response = '2' # 应答
BT_Notice = '3' # 通知
T['CfmmcReturnCode'] = 'char' # 监控中心返回码
CRC_Success = '0' # 成功
CRC_Working = '1' # 该客户已经有流程在处理中
CRC_InfoFail = '2' # 监控中客户资料检查失败
CRC_IDCardFail = '3' # 监控中实名制检查失败
CRC_OtherFail = '4' # 其他错误
T['ExReturnCode'] = 'int' # 交易所返回码
T['ClientType'] = 'char' # 客户类型
CfMMCCT_All = '0' # 所有
CfMMCCT_Person = '1' # 个人
CfMMCCT_Company = '2' # 单位
CfMMCCT_Other = '3' # 其他
CfMMCCT_SpecialOrgan = '4' # 特殊法人
CfMMCCT_Asset = '5' # 资管户
T['ExchangeIDType'] = 'char' # 交易所编号
EIDT_SHFE = 'S' # 上海期货交易所
EIDT_CZCE = 'Z' # 郑州商品交易所
EIDT_DCE = 'D' # 大连商品交易所
EIDT_CFFEX = 'J' # 中国金融期货交易所
EIDT_INE = 'N' # 上海国际能源交易中心股份有限公司
T['ExClientIDType'] = 'char' # 交易编码类型
ECIDT_Hedge = '1' # 套保
ECIDT_Arbitrage = '2' # 套利
ECIDT_Speculation = '3' # 投机
T['ClientClassify'] = 'char[11]' # 客户分类码
T['UOAOrganType'] = 'char[11]' # 单位性质
T['UOACountryCode'] = 'char[11]' # 国家代码
T['AreaCode'] = 'char[11]' # 区号
T['FuturesID'] = 'char[21]' # 监控中心为客户分配的代码
T['CffmcDate'] = 'char[11]' # 日期
T['CffmcTime'] = 'char[11]' # 时间
T['NocID'] = 'char[21]' # 组织机构代码
T['UpdateFlag'] = 'char' # 更新状态
UF_NoUpdate = '0' # 未更新
UF_Success = '1' # 更新全部信息成功
UF_Fail = '2' # 更新全部信息失败
UF_TCSuccess = '3' # 更新交易编码成功
UF_TCFail = '4' # 更新交易编码失败
UF_Cancel = '5' # 已丢弃
T['ApplyOperateID'] = 'char' # 申请动作
AOID_OpenInvestor = '1' # 开户
AOID_ModifyIDCard = '2' # 修改身份信息
AOID_ModifyNoIDCard = '3' # 修改一般信息
AOID_ApplyTradingCode = '4' # 申请交易编码
AOID_CancelTradingCode = '5' # 撤销交易编码
AOID_CancelInvestor = '6' # 销户
AOID_FreezeAccount = '8' # 账户休眠
AOID_ActiveFreezeAccount = '9' # 激活休眠账户
T['ApplyStatusID'] = 'char' # 申请状态
ASID_NoComplete = '1' # 未补全
ASID_Submited = '2' # 已提交
ASID_Checked = '3' # 已审核
ASID_Refused = '4' # 已拒绝
ASID_Deleted = '5' # 已删除
T['SendMethod'] = 'char' # 发送方式
UOASM_ByAPI = '1' # 文件发送
UOASM_ByFile = '2' # 电子发送
T['EventType'] = 'char[33]' # 业务操作类型
T['EventMode'] = 'char' # 操作方法
EvM_ADD = '1' # 增加
EvM_UPDATE = '2' # 修改
EvM_DELETE = '3' # 删除
EvM_CHECK = '4' # 复核
EvM_COPY = '5' # 复制
EvM_CANCEL = '6' # 注销
EvM_Reverse = '7' # 冲销
T['UOAAutoSend'] = 'char' # 统一开户申请自动发送
UOAA_ASR = '1' # 自动发送并接收
UOAA_ASNR = '2' # 自动发送,不自动接收
UOAA_NSAR = '3' # 不自动发送,自动接收
UOAA_NSR = '4' # 不自动发送,也不自动接收
T['QueryDepth'] = 'int' # 查询深度
T['DataCenterID'] = 'int' # 数据中心代码
T['FlowID'] = 'char' # 流程ID
EvM_InvestorGroupFlow = '1' # 投资者对应投资者组设置
EvM_InvestorRate = '2' # 投资者手续费率设置
EvM_InvestorCommRateModel = '3' # 投资者手续费率模板关系设置
T['CheckLevel'] = 'char' # 复核级别
CL_Zero = '0' # 零级复核
CL_One = '1' # 一级复核
CL_Two = '2' # 二级复核
T['CheckNo'] = 'int' # 操作次数
T['CheckStatus'] = 'char' # 复核级别
CHS_Init = '0' # 未复核
CHS_Checking = '1' # 复核中
CHS_Checked = '2' # 已复核
CHS_Refuse = '3' # 拒绝
CHS_Cancel = '4' # 作废
T['UsedStatus'] = 'char' # 生效状态
CHU_Unused = '0' # 未生效
CHU_Used = '1' # 已生效
CHU_Fail = '2' # 生效失败
T['RateTemplateName'] = 'char[61]' # 模型名称
T['PropertyString'] = 'char[2049]' # 用于查询的投资属性字段
T['BankAcountOrigin'] = 'char' # 账户来源
BAO_ByAccProperty = '0' # 手工录入
BAO_ByFBTransfer = '1' # 银期转账
T['MonthBillTradeSum'] = 'char' # 结算单月报成交汇总方式
MBTS_ByInstrument = '0' # 同日同合约
MBTS_ByDayInsPrc = '1' # 同日同合约同价格
MBTS_ByDayIns = '2' # 同合约
T['FBTTradeCodeEnum'] = 'char[7]' # 银期交易代码枚举
FTC_BankLaunchBankToBroker = '102001' # 银行发起银行转期货
FTC_BrokerLaunchBankToBroker = '202001' # 期货发起银行转期货
FTC_BankLaunchBrokerToBank = '102002' # 银行发起期货转银行
FTC_BrokerLaunchBrokerToBank = '202002' # 期货发起期货转银行
T['RateTemplateID'] = 'char[9]' # 模型代码
T['RiskRate'] = 'char[21]' # 风险度
T['Timestamp'] = 'int' # 时间戳
T['InvestorIDRuleName'] = 'char[61]' # 号段规则名称
T['InvestorIDRuleExpr'] = 'char[513]' # 号段规则表达式
T['LastDrift'] = 'int' # 上次OTP漂移值
T['LastSuccess'] = 'int' # 上次OTP成功值
T['AuthKey'] = 'char[41]' # 令牌密钥
T['SerialNumber'] = 'char[17]' # 序列号
T['OTPType'] = 'char' # 动态令牌类型
OTP_NONE = '0' # 无动态令牌
OTP_TOTP = '1' # 时间令牌
T['OTPVendorsID'] = 'char[2]' # 动态令牌提供商
T['OTPVendorsName'] = 'char[61]' # 动态令牌提供商名称
T['OTPStatus'] = 'char' # 动态令牌状态
OTPS_Unused = '0' # 未使用
OTPS_Used = '1' # 已使用
OTPS_Disuse = '2' # 注销
T['BrokerUserType'] = 'char' # 经济公司用户类型
BUT_Investor = '1' # 投资者
BUT_BrokerUser = '2' # 操作员
T['FutureType'] = 'char' # 期货类型
FUTT_Commodity = '1' # 商品期货
FUTT_Financial = '2' # 金融期货
T['FundEventType'] = 'char' # 资金管理操作类型
FET_Restriction = '0' # 转账限额
FET_TodayRestriction = '1' # 当日转账限额
FET_Transfer = '2' # 期商流水
FET_Credit = '3' # 资金冻结
FET_InvestorWithdrawAlm = '4' # 投资者可提资金比例
FET_BankRestriction = '5' # 单个银行帐户转账限额
FET_Accountregister = '6' # 银期签约账户
FET_ExchangeFundIO = '7' # 交易所出入金
FET_InvestorFundIO = '8' # 投资者出入金
T['AccountSourceType'] = 'char' # 资金账户来源
AST_FBTransfer = '0' # 银期同步
AST_ManualEntry = '1' # 手工录入
T['CodeSourceType'] = 'char' # 交易编码来源
CST_UnifyAccount = '0' # 统一开户(已规范)
CST_ManualEntry = '1' # 手工录入(未规范)
T['UserRange'] = 'char' # 操作员范围
UR_All = '0' # 所有
UR_Single = '1' # 单一操作员
T['TimeSpan'] = 'char[9]' # 时间跨度
T['ImportSequenceID'] = 'char[17]' # 动态令牌导入批次编号
T['ByGroup'] = 'char' # 交易统计表按客户统计方式
BG_Investor = '2' # 按投资者统计
BG_Group = '1' # 按类统计
T['TradeSumStatMode'] = 'char' # 交易统计表按范围统计方式
TSSM_Instrument = '1' # 按合约统计
TSSM_Product = '2' # 按产品统计
TSSM_Exchange = '3' # 按交易所统计
T['ComType'] = 'int' # 组合成交类型
T['UserProductID'] = 'char[33]' # 产品标识
T['UserProductName'] = 'char[65]' # 产品名称
T['UserProductMemo'] = 'char[129]' # 产品说明
T['CSRCCancelFlag'] = 'char[2]' # 新增或变更标志
T['CSRCDate'] = 'char[11]' # 日期
T['CSRCInvestorName'] = 'char[201]' # 客户名称
T['CSRCOpenInvestorName'] = 'char[101]' # 客户名称
T['CSRCInvestorID'] = 'char[13]' # 客户代码
T['CSRCIdentifiedCardNo'] = 'char[51]' # 证件号码
T['CSRCClientID'] = 'char[11]' # 交易编码
T['CSRCBankFlag'] = 'char[3]' # 银行标识
T['CSRCBankAccount'] = 'char[23]' # 银行账户
T['CSRCOpenName'] = 'char[401]' # 开户人
T['CSRCMemo'] = 'char[101]' # 说明
T['CSRCTime'] = 'char[11]' # 时间
T['CSRCTradeID'] = 'char[21]' # 成交流水号
T['CSRCExchangeInstID'] = 'char[31]' # 合约代码
T['CSRCMortgageName'] = 'char[7]' # 质押品名称
T['CSRCReason'] = 'char[3]' # 事由
T['IsSettlement'] = 'char[2]' # 是否为非结算会员
T['CSRCMoney'] = 'double' # 资金
T['CSRCPrice'] = 'double' # 价格
T['CSRCOptionsType'] = 'char[2]' # 期权类型
T['CSRCStrikePrice'] = 'double' # 执行价
T['CSRCTargetProductID'] = 'char[3]' # 标的品种
T['CSRCTargetInstrID'] = 'char[31]' # 标的合约
T['CommModelName'] = 'char[161]' # 手续费率模板名称
T['CommModelMemo'] = 'char[1025]' # 手续费率模板备注
T['ExprSetMode'] = 'char' # 日期表达式设置类型
ESM_Relative = '1' # 相对已有规则设置
ESM_Typical = '2' # 典型设置
T['RateInvestorRange'] = 'char' # 投资者范围
RIR_All = '1' # 公司标准
RIR_Model = '2' # 模板
RIR_Single = '3' # 单一投资者
T['AgentBrokerID'] = 'char[13]' # 代理经纪公司代码
T['DRIdentityID'] = 'int' # 交易中心代码
T['DRIdentityName'] = 'char[65]' # 交易中心名称
T['DBLinkID'] = 'char[31]' # DBLink标识号
T['SyncDataStatus'] = 'char' # 主次用系统数据同步状态
SDS_Initialize = '0' # 未同步
SDS_Settlementing = '1' # 同步中
SDS_Settlemented = '2' # 已同步
T['TradeSource'] = 'char' # 成交来源
TSRC_NORMAL = '0' # 来自交易所普通回报
TSRC_QUERY = '1' # 来自查询
T['FlexStatMode'] = 'char' # 产品合约统计方式
FSM_Product = '1' # 产品统计
FSM_Exchange = '2' # 交易所统计
FSM_All = '3' # 统计所有
T['ByInvestorRange'] = 'char' # 投资者范围统计方式
BIR_Property = '1' # 属性统计
BIR_All = '2' # 统计所有
T['SRiskRate'] = 'char[21]' # 风险度
T['SequenceNo12'] = 'int' # 序号
T['PropertyInvestorRange'] = 'char' # 投资者范围
PIR_All = '1' # 所有
PIR_Property = '2' # 投资者属性
PIR_Single = '3' # 单一投资者
T['FileStatus'] = 'char' # 文件状态
FIS_NoCreate = '0' # 未生成
FIS_Created = '1' # 已生成
FIS_Failed = '2' # 生成失败
T['FileGenStyle'] = 'char' # 文件生成方式
FGS_FileTransmit = '0' # 下发
FGS_FileGen = '1' # 生成
T['SysOperMode'] = 'char' # 系统日志操作方法
SoM_Add = '1' # 增加
SoM_Update = '2' # 修改
SoM_Delete = '3' # 删除
SoM_Copy = '4' # 复制
SoM_AcTive = '5' # 激活
SoM_CanCel = '6' # 注销
SoM_ReSet = '7' # 重置
T['SysOperType'] = 'char' # 系统日志操作类型
SoT_UpdatePassword = '0' # 修改操作员密码
SoT_UserDepartment = '1' # 操作员组织架构关系
SoT_RoleManager = '2' # 角色管理
SoT_RoleFunction = '3' # 角色功能设置
SoT_BaseParam = '4' # 基础参数设置
SoT_SetUserID = '5' # 设置操作员
SoT_SetUserRole = '6' # 用户角色设置
SoT_UserIpRestriction = '7' # 用户IP限制
SoT_DepartmentManager = '8' # 组织架构管理
SoT_DepartmentCopy = '9' # 组织架构向查询分类复制
SoT_Tradingcode = 'A' # 交易编码管理
SoT_InvestorStatus = 'B' # 投资者状态维护
SoT_InvestorAuthority = 'C' # 投资者权限管理
SoT_PropertySet = 'D' # 属性设置
SoT_ReSetInvestorPasswd = 'E' # 重置投资者密码
SoT_InvestorPersonalityInfo = 'F' # 投资者个性信息维护
T['CSRCDataQueyType'] = 'char' # 上报数据查询类型
CSRCQ_Current = '0' # 查询当前交易日报送的数据
CSRCQ_History = '1' # 查询历史报送的代理经纪公司的数据
T['FreezeStatus'] = 'char' # 休眠状态
FRS_Normal = '1' # 活跃
FRS_Freeze = '0' # 休眠
T['StandardStatus'] = 'char' # 规范状态
STST_Standard = '0' # 已规范
STST_NonStandard = '1' # 未规范
T['CSRCFreezeStatus'] = 'char[2]' # 休眠状态
T['RightParamType'] = 'char' # 配置类型
RPT_Freeze = '1' # 休眠户
RPT_FreezeActive = '2' # 激活休眠户
RPT_OpenLimit = '3' # 开仓权限限制
RPT_RelieveOpenLimit = '4' # 解除开仓权限限制
T['RightTemplateID'] = 'char[9]' # 模板代码
T['RightTemplateName'] = 'char[61]' # 模板名称
T['DataStatus'] = 'char' # 反洗钱审核表数据状态
AMLDS_Normal = '0' # 正常
AMLDS_Deleted = '1' # 已删除
T['AMLCheckStatus'] = 'char' # 审核状态
AMLCHS_Init = '0' # 未复核
AMLCHS_Checking = '1' # 复核中
AMLCHS_Checked = '2' # 已复核
AMLCHS_RefuseReport = '3' # 拒绝上报
T['AmlDateType'] = 'char' # 日期类型
AMLDT_DrawDay = '0' # 检查日期
AMLDT_TouchDay = '1' # 发生日期
T['AmlCheckLevel'] = 'char' # 审核级别
AMLCL_CheckLevel0 = '0' # 零级审核
AMLCL_CheckLevel1 = '1' # 一级审核
AMLCL_CheckLevel2 = '2' # 二级审核
AMLCL_CheckLevel3 = '3' # 三级审核
T['AmlCheckFlow'] = 'char[2]' # 反洗钱数据抽取审核流程
T['DataType'] = 'char[129]' # 数据类型
T['ExportFileType'] = 'char' # 导出文件类型
EFT_CSV = '0' # CSV
EFT_EXCEL = '1' # Excel
EFT_DBF = '2' # DBF
T['SettleManagerType'] = 'char' # 结算配置类型
SMT_Before = '1' # 结算前准备
SMT_Settlement = '2' # 结算
SMT_After = '3' # 结算后核对
SMT_Settlemented = '4' # 结算后处理
T['SettleManagerID'] = 'char[33]' # 结算配置代码
T['SettleManagerName'] = 'char[129]' # 结算配置名称
T['SettleManagerLevel'] = 'char' # 结算配置等级
SML_Must = '1' # 必要
SML_Alarm = '2' # 警告
SML_Prompt = '3' # 提示
SML_Ignore = '4' # 不检查
T['SettleManagerGroup'] = 'char' # 模块分组
SMG_Exhcange = '1' # 交易所核对
SMG_ASP = '2' # 内部核对
SMG_CSRC = '3' # 上报数据核对
T['CheckResultMemo'] = 'char[1025]' # 核对结果说明
T['FunctionUrl'] = 'char[1025]' # 功能链接
T['AuthInfo'] = 'char[129]' # 客户端认证信息
T['AuthCode'] = 'char[17]' # 客户端认证码
T['LimitUseType'] = 'char' # 保值额度使用类型
LUT_Repeatable = '1' # 可重复使用
LUT_Unrepeatable = '2' # 不可重复使用
T['DataResource'] = 'char' # 数据来源
DAR_Settle = '1' # 本系统
DAR_Exchange = '2' # 交易所
DAR_CSRC = '3' # 报送数据
T['MarginType'] = 'char' # 保证金类型
MGT_ExchMarginRate = '0' # 交易所保证金率
MGT_InstrMarginRate = '1' # 投资者保证金率
MGT_InstrMarginRateTrade = '2' # 投资者交易保证金率
T['ActiveType'] = 'char' # 生效类型
ACT_Intraday = '1' # 仅当日生效
ACT_Long = '2' # 长期生效
T['MarginRateType'] = 'char' # 冲突保证金率类型
MRT_Exchange = '1' # 交易所保证金率
MRT_Investor = '2' # 投资者保证金率
MRT_InvestorTrade = '3' # 投资者交易保证金率
T['BackUpStatus'] = 'char' # 备份数据状态
BUS_UnBak = '0' # 未生成备份数据
BUS_BakUp = '1' # 备份数据生成中
BUS_BakUped = '2' # 已生成备份数据
BUS_BakFail = '3' # 备份数据失败
T['InitSettlement'] = 'char' # 结算初始化状态
SIS_UnInitialize = '0' # 结算初始化未开始
SIS_Initialize = '1' # 结算初始化中
SIS_Initialized = '2' # 结算初始化完成
T['ReportStatus'] = 'char' # 报表数据生成状态
SRS_NoCreate = '0' # 未生成报表数据
SRS_Create = '1' # 报表数据生成中
SRS_Created = '2' # 已生成报表数据
SRS_CreateFail = '3' # 生成报表数据失败
T['SaveStatus'] = 'char' # 数据归档状态
SSS_UnSaveData = '0' # 归档未完成
SSS_SaveDatad = '1' # 归档完成
T['SettArchiveStatus'] = 'char' # 结算确认数据归档状态
SAS_UnArchived = '0' # 未归档数据
SAS_Archiving = '1' # 数据归档中
SAS_Archived = '2' # 已归档数据
SAS_ArchiveFail = '3' # 归档数据失败
T['CTPType'] = 'char' # CTP交易系统类型
CTPT_Unkown = '0' # 未知类型
CTPT_MainCenter = '1' # 主中心
CTPT_BackUp = '2' # 备中心
T['ToolID'] = 'char[9]' # 工具代码
T['ToolName'] = 'char[81]' # 工具名称
T['CloseDealType'] = 'char' # 平仓处理类型
CDT_Normal = '0' # 正常
CDT_SpecFirst = '1' # 投机平仓优先
T['MortgageFundUseRange'] = 'char' # 货币质押资金可用范围
MFUR_None = '0' # 不能使用
MFUR_Margin = '1' # 用于保证金
MFUR_All = '2' # 用于手续费、盈亏、保证金
T['CurrencyUnit'] = 'double' # 币种单位数量
T['ExchangeRate'] = 'double' # 汇率
T['SpecProductType'] = 'char' # 特殊产品类型
SPT_CzceHedge = '1' # 郑商所套保产品
SPT_IneForeignCurrency = '2' # 货币质押产品
SPT_DceOpenClose = '3' # 大连短线开平仓产品
T['FundMortgageType'] = 'char' # 货币质押类型
FMT_Mortgage = '1' # 质押
FMT_Redemption = '2' # 解质
T['AccountSettlementParamID'] = 'char' # 投资者账户结算参数代码
ASPI_BaseMargin = '1' # 基础保证金
ASPI_LowestInterest = '2' # 最低权益标准
T['CurrencyName'] = 'char[31]' # 币种名称
T['CurrencySign'] = 'char[4]' # 币种符号
T['FundMortDirection'] = 'char' # 货币质押方向
FMD_In = '1' # 货币质入
FMD_Out = '2' # 货币质出
T['BusinessClass'] = 'char' # 换汇类别
BT_Profit = '0' # 盈利
BT_Loss = '1' # 亏损
BT_Other = 'Z' # 其他
T['SwapSourceType'] = 'char' # 换汇数据来源
SST_Manual = '0' # 手工
SST_Automatic = '1' # 自动生成
T['CurrExDirection'] = 'char' # 换汇类型
CED_Settlement = '0' # 结汇
CED_Sale = '1' # 售汇
T['CurrencySwapStatus'] = 'char' # 申请状态
CSS_Entry = '1' # 已录入
CSS_Approve = '2' # 已审核
CSS_Refuse = '3' # 已拒绝
CSS_Revoke = '4' # 已撤销
CSS_Send = '5' # 已发送
CSS_Success = '6' # 换汇成功
CSS_Failure = '7' # 换汇失败
T['CurrExchCertNo'] = 'char[13]' # 凭证号
T['BatchSerialNo'] = 'char[21]' # 批次号
T['ReqFlag'] = 'char' # 换汇发送标志
REQF_NoSend = '0' # 未发送
REQF_SendSuccess = '1' # 发送成功
REQF_SendFailed = '2' # 发送失败
REQF_WaitReSend = '3' # 等待重发
T['ResFlag'] = 'char' # 换汇返回成功标志
RESF_Success = '0' # 成功
RESF_InsuffiCient = '1' # 账户余额不足
RESF_UnKnown = '8' # 交易结果未知
T['PageControl'] = 'char[2]' # 换汇页面控制
T['RecordCount'] = 'int' # 记录数
T['CurrencySwapMemo'] = 'char[101]' # 换汇需确认信息
T['ExStatus'] = 'char' # 修改状态
EXS_Before = '0' # 修改前
EXS_After = '1' # 修改后
T['ClientRegion'] = 'char' # 开户客户地域
CR_Domestic = '1' # 国内客户
CR_GMT = '2' # 港澳台客户
CR_Foreign = '3' # 国外客户
T['WorkPlace'] = 'char[101]' # 工作单位
T['BusinessPeriod'] = 'char[21]' # 经营期限
T['WebSite'] = 'char[101]' # 网址
T['UOAIdCardType'] = 'char[3]' # 统一开户证件类型
T['ClientMode'] = 'char[3]' # 开户模式
T['InvestorFullName'] = 'char[101]' # 投资者全称
T['UOABrokerID'] = 'char[11]' # 境外中介机构ID
T['UOAZipCode'] = 'char[11]' # 邮政编码
T['UOAEMail'] = 'char[101]' # 电子邮箱
T['OldCity'] = 'char[41]' # 城市
T['CorporateIdentifiedCardNo'] = 'char[101]' # 法人代表证件号码
T['HasBoard'] = 'char' # 是否有董事会
HB_No = '0' # 没有
HB_Yes = '1' # 有
T['StartMode'] = 'char' # 启动模式
SM_Normal = '1' # 正常
SM_Emerge = '2' # 应急
SM_Restore = '3' # 恢复
T['TemplateType'] = 'char' # 模型类型
TPT_Full = '1' # 全量
TPT_Increment = '2' # 增量
TPT_BackUp = '3' # 备份
T['LoginMode'] = 'char' # 登录模式
LM_Trade = '0' # 交易
LM_Transfer = '1' # 转账
T['PromptType'] = 'char' # 日历提示类型
CPT_Instrument = '1' # 合约上下市
CPT_Margin = '2' # 保证金分段生效
T['LedgerManageID'] = 'char[51]' # 分户管理资产编码
T['InvestVariety'] = 'char[101]' # 投资品种
T['BankAccountType'] = 'char[2]' # 账户类别
T['LedgerManageBank'] = 'char[101]' # 开户银行
T['CffexDepartmentName'] = 'char[101]' # 开户营业部
T['CffexDepartmentCode'] = 'char[9]' # 营业部代码
T['HasTrustee'] = 'char' # 是否有托管人
HT_Yes = '1' # 有
HT_No = '0' # 没有
T['CSRCMemo1'] = 'char[41]' # 说明
T['AssetmgrCFullName'] = 'char[101]' # 代理资产管理业务的期货公司全称
T['AssetmgrApprovalNO'] = 'char[51]' # 资产管理业务批文号
T['AssetmgrMgrName'] = 'char[401]' # 资产管理业务负责人姓名
T['AmType'] = 'char' # 机构类型
AMT_Bank = '1' # 银行
AMT_Securities = '2' # 证券公司
AMT_Fund = '3' # 基金公司
AMT_Insurance = '4' # 保险公司
AMT_Trust = '5' # 信托公司
AMT_Other = '9' # 其他
T['CSRCAmType'] = 'char[5]' # 机构类型
T['CSRCFundIOType'] = 'char' # 出入金类型
CFIOT_FundIO = '0' # 出入金
CFIOT_SwapCurrency = '1' # 银期换汇
T['CusAccountType'] = 'char' # 结算账户类型
CAT_Futures = '1' # 期货结算账户
CAT_AssetmgrFuture = '2' # 纯期货资管业务下的资管结算账户
CAT_AssetmgrTrustee = '3' # 综合类资管业务下的期货资管托管账户
CAT_AssetmgrTransfer = '4' # 综合类资管业务下的资金中转账户
T['CSRCNational'] = 'char[4]' # 国籍
T['CSRCSecAgentID'] = 'char[11]' # 二级代理ID
T['LanguageType'] = 'char' # 通知语言类型
LT_Chinese = '1' # 中文
LT_English = '2' # 英文
T['AmAccount'] = 'char[23]' # 投资账户
T['AssetmgrClientType'] = 'char' # 资产管理客户类型
AMCT_Person = '1' # 个人资管客户
AMCT_Organ = '2' # 单位资管客户
AMCT_SpecialOrgan = '4' # 特殊单位资管客户
T['AssetmgrType'] = 'char' # 投资类型
ASST_Futures = '3' # 期货类
ASST_SpecialOrgan = '4' # 综合类
T['UOM'] = 'char[11]' # 计量单位
T['SHFEInstLifePhase'] = 'char[3]' # 上期所合约生命周期状态
T['SHFEProductClass'] = 'char[11]' # 产品类型
T['PriceDecimal'] = 'char[2]' # 价格小数位
T['InTheMoneyFlag'] = 'char[2]' # 平值期权标志
T['CheckInstrType'] = 'char' # 合约比较类型
CIT_HasExch = '0' # 合约交易所不存在
CIT_HasATP = '1' # 合约本系统不存在
CIT_HasDiff = '2' # 合约比较不一致
T['DeliveryType'] = 'char' # 交割类型
DT_HandDeliv = '1' # 手工交割
DT_PersonDeliv = '2' # 到期交割
T['BigMoney'] = 'double' # 资金
T['MaxMarginSideAlgorithm'] = 'char' # 大额单边保证金算法
MMSA_NO = '0' # 不使用大额单边保证金算法
MMSA_YES = '1' # 使用大额单边保证金算法
T['DAClientType'] = 'char' # 资产管理客户类型
CACT_Person = '0' # 自然人
CACT_Company = '1' # 法人
CACT_Other = '2' # 其他
T['CombinInstrID'] = 'char[61]' # 套利合约代码
T['CombinSettlePrice'] = 'char[61]' # 各腿结算价
T['DCEPriority'] = 'int' # 优先级
T['TradeGroupID'] = 'int' # 成交组号
T['IsCheckPrepa'] = 'int' # 是否校验开户可用资金
T['UOAAssetmgrType'] = 'char' # 投资类型
UOAAT_Futures = '1' # 期货类
UOAAT_SpecialOrgan = '2' # 综合类
T['DirectionEn'] = 'char' # 买卖方向
DEN_Buy = '0' # Buy
DEN_Sell = '1' # Sell
T['OffsetFlagEn'] = 'char' # 开平标志
OFEN_Open = '0' # Position Opening
OFEN_Close = '1' # Position Close
OFEN_ForceClose = '2' # Forced Liquidation
OFEN_CloseToday = '3' # Close Today
OFEN_CloseYesterday = '4' # Close Prev.
OFEN_ForceOff = '5' # Forced Reduction
OFEN_LocalForceClose = '6' # Local Forced Liquidation
T['HedgeFlagEn'] = 'char' # 投机套保标志
HFEN_Speculation = '1' # Speculation
HFEN_Arbitrage = '2' # Arbitrage
HFEN_Hedge = '3' # Hedge
T['FundIOTypeEn'] = 'char' # 出入金类型
FIOTEN_FundIO = '1' # Deposit/Withdrawal
FIOTEN_Transfer = '2' # Bank-Futures Transfer
FIOTEN_SwapCurrency = '3' # Bank-Futures FX Exchange
T['FundTypeEn'] = 'char' # 资金类型
FTEN_Deposite = '1' # Bank Deposit
FTEN_ItemFund = '2' # Payment/Fee
FTEN_Company = '3' # Brokerage Adj
FTEN_InnerTransfer = '4' # Internal Transfer
T['FundDirectionEn'] = 'char' # 出入金方向
FDEN_In = '1' # Deposit
FDEN_Out = '2' # Withdrawal
T['FundMortDirectionEn'] = 'char' # 货币质押方向
FMDEN_In = '1' # Pledge
FMDEN_Out = '2' # Redemption
T['SwapBusinessType'] = 'char[3]' # 换汇业务种类
T['OptionsType'] = 'char' # 期权类型
CP_CallOptions = '1' # 看涨
CP_PutOptions = '2' # 看跌
T['StrikeMode'] = 'char' # 执行方式
STM_Continental = '0' # 欧式
STM_American = '1' # 美式
STM_Bermuda = '2' # 百慕大
T['StrikeType'] = 'char' # 执行类型
STT_Hedge = '0' # 自身对冲
STT_Match = '1' # 匹配执行
T['ApplyType'] = 'char' # 中金所期权放弃执行申请类型
APPT_NotStrikeNum = '4' # 不执行数量
T['GiveUpDataSource'] = 'char' # 放弃执行申请数据来源
GUDS_Gen = '0' # 系统生成
GUDS_Hand = '1' # 手工添加
T['ExecOrderSysID'] = 'char[21]' # 执行宣告系统编号
T['ExecResult'] = 'char' # 执行结果
OER_NoExec = 'n' # 没有执行
OER_Canceled = 'c' # 已经取消
OER_OK = '0' # 执行成功
OER_NoPosition = '1' # 期权持仓不够
OER_NoDeposit = '2' # 资金不够
OER_NoParticipant = '3' # 会员不存在
OER_NoClient = '4' # 客户不存在
OER_NoInstrument = '6' # 合约不存在
OER_NoRight = '7' # 没有执行权限
OER_InvalidVolume = '8' # 不合理的数量
OER_NoEnoughHistoryTrade = '9' # 没有足够的历史成交
OER_Unknown = 'a' # 未知
T['StrikeSequence'] = 'int' # 执行序号
T['StrikeTime'] = 'char[13]' # 执行时间
T['CombinationType'] = 'char' # 组合类型
COMBT_Future = '0' # 期货组合
COMBT_BUL = '1' # 垂直价差BUL
COMBT_BER = '2' # 垂直价差BER
COMBT_STD = '3' # 跨式组合
COMBT_STG = '4' # 宽跨式组合
COMBT_PRT = '5' # 备兑组合
COMBT_CLD = '6' # 时间价差组合
T['OptionRoyaltyPriceType'] = 'char' # 期权权利金价格类型
ORPT_PreSettlementPrice = '1' # 昨结算价
ORPT_OpenPrice = '4' # 开仓价
T['BalanceAlgorithm'] = 'char' # 权益算法
BLAG_Default = '1' # 不计算期权市值盈亏
BLAG_IncludeOptValLost = '2' # 计算期权市值亏损
T['ActionType'] = 'char' # 执行类型
ACTP_Exec = '1' # 执行
ACTP_Abandon = '2' # 放弃
T['ForQuoteStatus'] = 'char' # 询价状态
FQST_Submitted = 'a' # 已经提交
FQST_Accepted = 'b' # 已经接受
FQST_Rejected = 'c' # 已经被拒绝
T['ValueMethod'] = 'char' # 取值方式
VM_Absolute = '0' # 按绝对值
VM_Ratio = '1' # 按比率
T['ExecOrderPositionFlag'] = 'char' # 期权行权后是否保留期货头寸的标记
EOPF_Reserve = '0' # 保留
EOPF_UnReserve = '1' # 不保留
T['ExecOrderCloseFlag'] = 'char' # 期权行权后生成的头寸是否自动平仓
EOCF_AutoClose = '0' # 自动平仓
EOCF_NotToClose = '1' # 免于自动平仓
T['ProductType'] = 'char' # 产品类型
PTE_Futures = '1' # 期货
PTE_Options = '2' # 期权
T['CZCEUploadFileName'] = 'char' # 郑商所结算文件名
CUFN_CUFN_O = 'O' # ^\d{8}_zz_\d{4}
CUFN_CUFN_T = 'T' # ^\d{8}成交表
CUFN_CUFN_P = 'P' # ^\d{8}单腿持仓表new
CUFN_CUFN_N = 'N' # ^\d{8}非平仓了结表
CUFN_CUFN_L = 'L' # ^\d{8}平仓表
CUFN_CUFN_F = 'F' # ^\d{8}资金表
CUFN_CUFN_C = 'C' # ^\d{8}组合持仓表
CUFN_CUFN_M = 'M' # ^\d{8}保证金参数表
T['DCEUploadFileName'] = 'char' # 大商所结算文件名
DUFN_DUFN_O = 'O' # ^\d{8}_dl_\d{3}
DUFN_DUFN_T = 'T' # ^\d{8}_成交表
DUFN_DUFN_P = 'P' # ^\d{8}_持仓表
DUFN_DUFN_F = 'F' # ^\d{8}_资金结算表
DUFN_DUFN_C = 'C' # ^\d{8}_优惠组合持仓明细表
DUFN_DUFN_D = 'D' # ^\d{8}_持仓明细表
DUFN_DUFN_M = 'M' # ^\d{8}_保证金参数表
DUFN_DUFN_S = 'S' # ^\d{8}_期权执行表
T['SHFEUploadFileName'] = 'char' # 上期所结算文件名
SUFN_SUFN_O = 'O' # ^\d{4}_\d{8}_\d{8}_DailyFundChg
SUFN_SUFN_T = 'T' # ^\d{4}_\d{8}_\d{8}_Trade
SUFN_SUFN_P = 'P' # ^\d{4}_\d{8}_\d{8}_SettlementDetail
SUFN_SUFN_F = 'F' # ^\d{4}_\d{8}_\d{8}_Capital
T['CFFEXUploadFileName'] = 'char' # 中金所结算文件名
CFUFN_SUFN_T = 'T' # ^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade
CFUFN_SUFN_P = 'P' # ^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail
CFUFN_SUFN_F = 'F' # ^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital
CFUFN_SUFN_S = 'S' # ^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec
T['CombDirection'] = 'char' # 组合指令方向
CMDR_Comb = '0' # 申请组合
CMDR_UnComb = '1' # 申请拆分
error = {
'NONE': 0, 0: 'CTP:正确', 'INVALID_DATA_SYNC_STATUS': 1, 1: 'CTP:不在已同步状态', 'INCONSISTENT_INFORMATION': 2,
2: 'CTP:会话信息不一致', 'INVALID_LOGIN': 3, 3: 'CTP:不合法的登录', 'USER_NOT_ACTIVE': 4, 4: 'CTP:用户不活跃',
'DUPLICATE_LOGIN': 5, 5: 'CTP:重复的登录', 'NOT_LOGIN_YET': 6, 6: 'CTP:还没有登录', 'NOT_INITED': 7, 7: 'CTP:还没有初始化',
'FRONT_NOT_ACTIVE': 8, 8: 'CTP:前置不活跃', 'NO_PRIVILEGE': 9, 9: 'CTP:无此权限', 'CHANGE_OTHER_PASSWORD': 10,
10: 'CTP:修改别人的口令', 'USER_NOT_FOUND': 11, 11: 'CTP:找不到该用户', 'BROKER_NOT_FOUND': 12, 12: 'CTP:找不到该经纪公司',
'INVESTOR_NOT_FOUND': 13, 13: 'CTP:找不到投资者', 'OLD_PASSWORD_MISMATCH': 14, 14: 'CTP:原口令不匹配', 'BAD_FIELD': 15,
15: 'CTP:报单字段有误', 'INSTRUMENT_NOT_FOUND': 16, 16: 'CTP:找不到合约', 'INSTRUMENT_NOT_TRADING': 17, 17: 'CTP:合约不能交易',
'NOT_EXCHANGE_PARTICIPANT': 18, 18: 'CTP:经纪公司不是交易所的会员', 'INVESTOR_NOT_ACTIVE': 19, 19: 'CTP:投资者不活跃',
'NOT_EXCHANGE_CLIENT': 20, 20: 'CTP:投资者未在交易所开户', 'NO_VALID_TRADER_AVAILABLE': 21, 21: 'CTP:该交易席位未连接到交易所',
'DUPLICATE_ORDER_REF': 22, 22: 'CTP:报单错误:不允许重复报单', 'BAD_ORDER_ACTION_FIELD': 23, 23: 'CTP:错误的报单操作字段',
'DUPLICATE_ORDER_ACTION_REF': 24, 24: 'CTP:撤单已报送,不允许重复撤单', 'ORDER_NOT_FOUND': 25, 25: 'CTP:撤单找不到相应报单',
'INSUITABLE_ORDER_STATUS': 26, 26: 'CTP:报单已全成交或已撤销,不能再撤', 'UNSUPPORTED_FUNCTION': 27, 27: 'CTP:不支持的功能',
'NO_TRADING_RIGHT': 28, 28: 'CTP:没有报单交易权限', 'CLOSE_ONLY': 29, 29: 'CTP:只能平仓', 'OVER_CLOSE_POSITION': 30,
30: 'CTP:平仓量超过持仓量', 'INSUFFICIENT_MONEY': 31, 31: 'CTP:资金不足', 'DUPLICATE_PK': 32, 32: 'CTP:主键重复',
'CANNOT_FIND_PK': 33, 33: 'CTP:找不到主键', 'CAN_NOT_INACTIVE_BROKER': 34, 34: 'CTP:设置经纪公司不活跃状态失败',
'BROKER_SYNCHRONIZING': 35, 35: 'CTP:经纪公司正在同步', 'BROKER_SYNCHRONIZED': 36, 36: 'CTP:经纪公司已同步', 'SHORT_SELL': 37,
37: 'CTP:现货交易不能卖空', 'INVALID_SETTLEMENT_REF': 38, 38: 'CTP:不合法的结算引用', 'CFFEX_NETWORK_ERROR': 39,
39: 'CTP:交易所网络连接失败', 'CFFEX_OVER_REQUEST': 40, 40: 'CTP:交易所未处理请求超过许可数', 'CFFEX_OVER_REQUEST_PER_SECOND': 41,
41: 'CTP:交易所每秒发送请求数超过许可数', 'SETTLEMENT_INFO_NOT_CONFIRMED': 42, 42: 'CTP:结算结果未确认', 'DEPOSIT_NOT_FOUND': 43,
43: 'CTP:没有对应的入金记录', 'EXCHANG_TRADING': 44, 44: 'CTP:交易所已经进入连续交易状态', 'PARKEDORDER_NOT_FOUND': 45,
45: 'CTP:找不到预埋(撤单)单', 'PARKEDORDER_HASSENDED': 46, 46: 'CTP:预埋(撤单)单已经发送', 'PARKEDORDER_HASDELETE': 47,
47: 'CTP:预埋(撤单)单已经删除', 'INVALID_INVESTORIDORPASSWORD': 48, 48: 'CTP:无效的投资者或者密码', 'INVALID_LOGIN_IPADDRESS': 49,
49: 'CTP:不合法的登录IP地址', 'OVER_CLOSETODAY_POSITION': 50, 50: 'CTP:平今仓位不足', 'OVER_CLOSEYESTERDAY_POSITION': 51,
51: 'CTP:平昨仓位不足', 'BROKER_NOT_ENOUGH_CONDORDER': 52, 52: 'CTP:经纪公司没有足够可用的条件单数量',
'INVESTOR_NOT_ENOUGH_CONDORDER': 53, 53: 'CTP:投资者没有足够可用的条件单数量', 'BROKER_NOT_SUPPORT_CONDORDER': 54,
54: 'CTP:经纪公司不支持条件单', 'RESEND_ORDER_BROKERINVESTOR_NOTMATCH': 55, 55: 'CTP:重发未知单经济公司/投资者不匹配',
'SYC_OTP_FAILED': 56, 56: 'CTP:同步动态令牌失败', 'OTP_MISMATCH': 57, 57: 'CTP:动态令牌校验错误', 'OTPPARAM_NOT_FOUND': 58,
58: 'CTP:找不到动态令牌配置信息', 'UNSUPPORTED_OTPTYPE': 59, 59: 'CTP:不支持的动态令牌类型', 'SINGLEUSERSESSION_EXCEED_LIMIT': 60,
60: 'CTP:用户在线会话超出上限', 'EXCHANGE_UNSUPPORTED_ARBITRAGE': 61, 61: 'CTP:该交易所不支持套利类型报单',
'NO_CONDITIONAL_ORDER_RIGHT': 62, 62: 'CTP:没有条件单交易权限', 'AUTH_FAILED': 63, 63: 'CTP:客户端认证失败', 'NOT_AUTHENT': 64,
64: 'CTP:客户端未认证', 'SWAPORDER_UNSUPPORTED': 65, 65: 'CTP:该合约不支持互换类型报单', 'OPTIONS_ONLY_SUPPORT_SPEC': 66,
66: 'CTP:该期权合约只支持投机类型报单', 'DUPLICATE_EXECORDER_REF': 67, 67: 'CTP:执行宣告错误,不允许重复执行',
'RESEND_EXECORDER_BROKERINVESTOR_NOTMATCH': 68, 68: 'CTP:重发未知执行宣告经纪公司/投资者不匹配', 'EXECORDER_NOTOPTIONS': 69,
69: 'CTP:只有期权合约可执行', 'OPTIONS_NOT_SUPPORT_EXEC': 70, 70: 'CTP:该期权合约不支持执行', 'BAD_EXECORDER_ACTION_FIELD': 71,
71: 'CTP:执行宣告字段有误', 'DUPLICATE_EXECORDER_ACTION_REF': 72, 72: 'CTP:执行宣告撤单已报送,不允许重复撤单',
'EXECORDER_NOT_FOUND': 73, 73: 'CTP:执行宣告撤单找不到相应执行宣告', 'OVER_EXECUTE_POSITION': 74, 74: 'CTP:执行仓位不足',
'LOGIN_FORBIDDEN': 75, 75: 'CTP:连续登录失败次数超限,登录被禁止', 'INVALID_TRANSFER_AGENT': 76, 76: 'CTP:非法银期代理关系',
'NO_FOUND_FUNCTION': 77, 77: 'CTP:无此功能', 'SEND_EXCHANGEORDER_FAILED': 78, 78: 'CTP:发送报单失败',
'SEND_EXCHANGEORDERACTION_FAILED': 79, 79: 'CTP:发送报单操作失败', 'PRICETYPE_NOTSUPPORT_BYEXCHANGE': 80,
80: 'CTP:交易所不支持的价格类型', 'BAD_EXECUTE_TYPE': 81, 81: 'CTP:错误的执行类型', 'BAD_OPTION_INSTR': 82, 82: 'CTP:无效的组合合约',
'INSTR_NOTSUPPORT_FORQUOTE': 83, 83: 'CTP:该合约不支持询价', 'RESEND_QUOTE_BROKERINVESTOR_NOTMATCH': 84,
84: 'CTP:重发未知报价经纪公司/投资者不匹配', 'INSTR_NOTSUPPORT_QUOTE': 85, 85: 'CTP:该合约不支持报价', 'QUOTE_NOT_FOUND': 86,
86: 'CTP:报价撤单找不到相应报价', 'OPTIONS_NOT_SUPPORT_ABANDON': 87, 87: 'CTP:该期权合约不支持放弃执行',
'COMBOPTIONS_SUPPORT_IOC_ONLY': 88, 88: 'CTP:该组合期权合约只支持IOC', 'OPEN_FILE_FAILED': 89, 89: 'CTP:打开文件失败',
'NEED_RETRY': 90, 90: 'CTP:查询未就绪,请稍后重试', 'EXCHANGE_RTNERROR': 91, 91: 'CTP:交易所返回的错误',
'QUOTE_DERIVEDORDER_ACTIONERROR': 92, 92: 'CTP:报价衍生单要等待交易所返回才能撤单', 'INSTRUMENTMAP_NOT_FOUND': 93,
93: 'CTP:找不到组合合约映射', 'NO_TRADING_RIGHT_IN_SEPC_DR': 101, 101: 'CTP:用户在本系统没有报单权限', 'NO_DR_NO': 102,
102: 'CTP:系统缺少灾备标示号', 'BATCHACTION_NOSUPPORT': 103, 103: 'CTP:该交易所不支持批量撤单', 'OUT_OF_TIMEINTERVAL': 113,
113: 'CTP:当前时间禁止询价', 'OUT_OF_PRICEINTERVAL': 114, 114: 'CTP:当前价差禁止询价', 'SEND_INSTITUTION_CODE_ERROR': 1000,
1000: 'CTP:银期转账:发送机构代码错误', 'NO_GET_PLATFORM_SN': 1001, 1001: 'CTP:银期转账:取平台流水号错误',
'ILLEGAL_TRANSFER_BANK': 1002, 1002: 'CTP:银期转账:不合法的转账银行', 'ALREADY_OPEN_ACCOUNT': 1003, 1003: 'CTP:银期转账:已经开户',
'NOT_OPEN_ACCOUNT': 1004, 1004: 'CTP:银期转账:未开户', 'PROCESSING': 1005, 1005: 'CTP:银期转账:处理中', 'OVERTIME': 1006,
1006: 'CTP:银期转账:交易超时', 'RECORD_NOT_FOUND': 1007, 1007: 'CTP:银期转账:找不到记录',
'NO_FOUND_REVERSAL_ORIGINAL_TRANSACTION': 1008, 1008: 'CTP:银期转账:找不到被冲正的原始交易', 'CONNECT_HOST_FAILED': 1009,
1009: 'CTP:银期转账:连接主机失败', 'SEND_FAILED': 1010, 1010: 'CTP:银期转账:发送失败', 'LATE_RESPONSE': 1011,
1011: 'CTP:银期转账:迟到应答', 'REVERSAL_BANKID_NOT_MATCH': 1012, 1012: 'CTP:银期转账:冲正交易银行代码错误',
'REVERSAL_BANKACCOUNT_NOT_MATCH': 1013, 1013: 'CTP:银期转账:冲正交易银行账户错误', 'REVERSAL_BROKERID_NOT_MATCH': 1014,
1014: 'CTP:银期转账:冲正交易经纪公司代码错误', 'REVERSAL_ACCOUNTID_NOT_MATCH': 1015, 1015: 'CTP:银期转账:冲正交易资金账户错误',
'REVERSAL_AMOUNT_NOT_MATCH': 1016, 1016: 'CTP:银期转账:冲正交易交易金额错误', 'DB_OPERATION_FAILED': 1017,
1017: 'CTP:银期转账:数据库操作错误', 'SEND_ASP_FAILURE': 1018, 1018: 'CTP:银期转账:发送到交易系统失败', 'NOT_SIGNIN': 1019,
1019: 'CTP:银期转账:没有签到', 'ALREADY_SIGNIN': 1020, 1020: 'CTP:银期转账:已经签到', 'AMOUNT_OR_TIMES_OVER': 1021,
1021: 'CTP:银期转账:金额或次数超限', 'NOT_IN_TRANSFER_TIME': 1022, 1022: 'CTP:银期转账:这一时间段不能转账', 'BANK_SERVER_ERROR': 1023,
1023: '银行主机错', 'BANK_SERIAL_IS_REPEALED': 1024, 1024: 'CTP:银期转账:银行已经冲正', 'BANK_SERIAL_NOT_EXIST': 1025,
1025: 'CTP:银期转账:银行流水不存在', 'NOT_ORGAN_MAP': 1026, 1026: 'CTP:银期转账:机构没有签约', 'EXIST_TRANSFER': 1027,
1027: 'CTP:银期转账:存在转账,不能销户', 'BANK_FORBID_REVERSAL': 1028, 1028: 'CTP:银期转账:银行不支持冲正', 'DUP_BANK_SERIAL': 1029,
1029: 'CTP:银期转账:重复的银行流水', 'FBT_SYSTEM_BUSY': 1030, 1030: 'CTP:银期转账:转账系统忙,稍后再试', 'MACKEY_SYNCING': 1031,
1031: 'CTP:银期转账:MAC密钥正在同步', 'ACCOUNTID_ALREADY_REGISTER': 1032, 1032: 'CTP:银期转账:资金账户已经登记',
'BANKACCOUNT_ALREADY_REGISTER': 1033, 1033: 'CTP:银期转账:银行账户已经登记', 'DUP_BANK_SERIAL_REDO_OK': 1034,
1034: 'CTP:银期转账:重复的银行流水,重发成功', 'CURRENCYID_NOT_SUPPORTED': 1035, 1035: 'CTP:银期转账:该币种代码不支持',
'INVALID_MAC': 1036, 1036: 'CTP:银期转账:MAC值验证失败', 'NOT_SUPPORT_SECAGENT_BY_BANK': 1037,
1037: 'CTP:银期转账:不支持银行端发起的二级代理商转账和查询', 'PINKEY_SYNCING': 1038, 1038: 'CTP:银期转账:PIN密钥正在同步',
'SECAGENT_QUERY_BY_CCB': 1039, 1039: 'CTP:银期转账:建行发起的二级代理商查询', 'NO_VALID_BANKOFFER_AVAILABLE': 2000,
2000: 'CTP:该报盘未连接到银行', 'PASSWORD_MISMATCH': 2001, 2001: 'CTP:资金密码错误', 'DUPLATION_BANK_SERIAL': 2004,
2004: 'CTP:银行流水号重复', 'DUPLATION_OFFER_SERIAL': 2005, 2005: 'CTP:报盘流水号重复', 'SERIAL_NOT_EXSIT': 2006,
2006: 'CTP:被冲正流水不存在(冲正交易)', 'SERIAL_IS_REPEALED': 2007, 2007: 'CTP:原流水已冲正(冲正交易)', 'SERIAL_MISMATCH': 2008,
2008: 'CTP:与原流水信息不符(冲正交易)', 'IdentifiedCardNo_MISMATCH': 2009, 2009: 'CTP:证件号码或类型错误', 'ACCOUNT_NOT_FUND': 2011,
2011: 'CTP:资金账户不存在', 'ACCOUNT_NOT_ACTIVE': 2012, 2012: 'CTP:资金账户已经销户', 'NOT_ALLOW_REPEAL_BYMANUAL': 2013,
2013: 'CTP:该交易不能执行手工冲正', 'AMOUNT_OUTOFTHEWAY': 2014, 2014: 'CTP:转帐金额错误', 'EXCHANGERATE_NOT_FOUND': 2015,
2015: 'CTP:找不到汇率', 'WAITING_OFFER_RSP': 999999, 999999: 'CTP:等待银期报盘处理结果', 'FBE_NO_GET_PLATFORM_SN': 3001,
3001: 'CTP:银期换汇:取平台流水号错误', 'FBE_ILLEGAL_TRANSFER_BANK': 3002, 3002: 'CTP:银期换汇:不合法的转账银行',
'FBE_PROCESSING': 3005, 3005: 'CTP:银期换汇:处理中', 'FBE_OVERTIME': 3006, 3006: 'CTP:银期换汇:交易超时',
'FBE_RECORD_NOT_FOUND': 3007, 3007: 'CTP:银期换汇:找不到记录', 'FBE_CONNECT_HOST_FAILED': 3009, 3009: 'CTP:银期换汇:连接主机失败',
'FBE_SEND_FAILED': 3010, 3010: 'CTP:银期换汇:发送失败', 'FBE_LATE_RESPONSE': 3011, 3011: 'CTP:银期换汇:迟到应答',
'FBE_DB_OPERATION_FAILED': 3017, 3017: 'CTP:银期换汇:数据库操作错误', 'FBE_NOT_SIGNIN': 3019, 3019: 'CTP:银期换汇:没有签到',
'FBE_ALREADY_SIGNIN': 3020, 3020: 'CTP:银期换汇:已经签到', 'FBE_AMOUNT_OR_TIMES_OVER': 3021, 3021: 'CTP:银期换汇:金额或次数超限',
'FBE_NOT_IN_TRANSFER_TIME': 3022, 3022: 'CTP:银期换汇:这一时间段不能换汇', 'FBE_BANK_SERVER_ERROR': 3023,
3023: 'CTP:银期换汇:银行主机错', 'FBE_NOT_ORGAN_MAP': 3026, 3026: 'CTP:银期换汇:机构没有签约', 'FBE_SYSTEM_BUSY': 3030,
3030: 'CTP:银期换汇:换汇系统忙,稍后再试', 'FBE_CURRENCYID_NOT_SUPPORTED': 3035, 3035: 'CTP:银期换汇:该币种代码不支持',
'FBE_WRONG_BANK_ACCOUNT': 3036, 3036: 'CTP:银期换汇:银行帐号不正确', 'FBE_BANK_ACCOUNT_NO_FUNDS': 3037,
3037: 'CTP:银期换汇:银行帐户余额不足', 'FBE_DUP_CERT_NO': 3038, 3038: 'CTP:银期换汇:凭证号重复'}
================================================
FILE: utils/__init__.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging
import orjson
from decimal import Decimal
import datetime
import math
import re
import socket
import xml.etree.ElementTree as ET
import asyncio
import os
from functools import reduce
from itertools import combinations
from typing import Any, cast
import pytz
import aiohttp
import numpy as np
from django.db.models import Q, F, Max, Min
from django.utils import timezone
from talib import ATR
from tqdm import tqdm
from panel.models import *
from ctp_native.state_store import state_store
from utils import ApiStruct
from utils.read_config import config
logger = logging.getLogger('utils')
max_conn_shfe = asyncio.Semaphore(15)
max_conn_dce = asyncio.Semaphore(5)
max_conn_gfex = asyncio.Semaphore(5)
max_conn_czce = asyncio.Semaphore(15)
max_conn_cffex = asyncio.Semaphore(15)
max_conn_sina = asyncio.Semaphore(15)
cffex_ip = 'www.cffex.com.cn' # www.cffex.com.cn
shfe_ip = 'www.shfe.com.cn' # www.shfe.com.cn
czce_ip = 'www.czce.com.cn' # www.czce.com.cn
dce_ip = 'www.dce.com.cn' # www.dce.com.cn
gfex_ip = 'www.gfex.com.cn'
IGNORE_INST_LIST = config.get('TRADE', 'ignore_inst').split(',')
ORDER_REF_SIGNAL_ID_START = -5
def _create_http_connector() -> aiohttp.TCPConnector:
"""创建更稳定的 HTTP 连接器:优先系统 DNS 解析并固定 IPv4。"""
return aiohttp.TCPConnector(
resolver=aiohttp.ThreadedResolver(),
family=socket.AF_INET,
ttl_dns_cache=300,
enable_cleanup_closed=True,
limit=30,
)
def _create_http_session(timeout_total: float = 20.0) -> aiohttp.ClientSession:
timeout = aiohttp.ClientTimeout(total=timeout_total, connect=8, sock_connect=8, sock_read=15)
return aiohttp.ClientSession(
connector=_create_http_connector(),
timeout=timeout,
trust_env=True,
)
def str_to_number(s):
try:
if not isinstance(s, str):
return s
return int(s)
except ValueError:
return float(s)
def price_round(x: Decimal, base: Decimal):
"""
根据最小精度取整,例如对于IF最小精度是0.2,那么 1.3 -> 1.2, 1.5 -> 1.4
:param x: Decimal 待取整的数
:param base: Decimal 最小精度
:return: float 取整结果
"""
if not type(x) is Decimal:
x = Decimal(x)
if not type(base) is Decimal:
base = Decimal(base)
precision = 0
s = str(round(base, 3) % 1)
s = s.rstrip('0').rstrip('.') if '.' in s else s
p1, *p2 = s.split('.')
if p2:
precision = len(p2[0])
return round(base * round(x / base), precision)
def get_next_id():
if not hasattr(get_next_id, "request_id"):
get_next_id.request_id = 0 # type: ignore[attr-defined]
get_next_id.request_id = 1 if get_next_id.request_id == 65535 else get_next_id.request_id + 1 # type: ignore[attr-defined]
return get_next_id.request_id # type: ignore[attr-defined]
async def is_trading_day(day: datetime.datetime):
"""
判断给定日期是否为交易日。
交易日 = 周一至周五 且 非法定节假日(调休周末交易所也不开盘)。
"""
d = day.date() if hasattr(day, 'date') else day
if d.isoweekday() >= 6:
# 周末一律不交易,即使是调休工作日
return day, False
try:
from chinese_calendar import is_workday
# 工作日中排除法定节假日(如国庆、春节等落在周一~周五的)
return day, is_workday(d)
except Exception:
# chinese_calendar 不可用或日期超范围,回退到仅周末判断
return day, True
async def check_trading_day(day: datetime.datetime) -> tuple[datetime.datetime, bool]:
async with _create_http_session() as session:
await max_conn_cffex.acquire()
async with session.get(
'http://{}/fzjy/mrhq/{}/index.xml'.format(cffex_ip, day.strftime('%Y%m/%d')),
allow_redirects=False) as response:
max_conn_cffex.release()
return day, response.status == 200
def get_expire_date(inst_code: str, day: datetime.datetime):
expire_date = int(re.findall(r'\d+', inst_code)[0])
if expire_date < 1000:
year_exact = math.floor(day.year % 100 / 10)
if expire_date < 100 and day.year % 10 == 9:
year_exact += 1
expire_date += year_exact * 1000
return expire_date
def get_contract_code_regex(product_code: str) -> str:
"""根据 product_code 生成匹配真实合约代码的 regex。"""
pc = str(product_code or '').strip().lower()
if pc.endswith('_f'):
base = re.escape(pc[:-2])
return rf'^{base}[0-9]+[Ff]$'
return rf'^{re.escape(pc)}[0-9]+$'
async def update_from_shfe(day: datetime.datetime) -> bool:
try:
async with _create_http_session() as session:
day_str = day.strftime('%Y%m%d')
await max_conn_shfe.acquire()
async with session.get(f'http://{shfe_ip}/data/tradedata/future/dailydata/kx{day_str}.dat') as response:
rst = await response.read()
rst_json = orjson.loads(rst)
max_conn_shfe.release()
inst_name_dict = {}
for inst_data in rst_json['o_curinstrument']:
"""
{"PRODUCTID":"cu_f ","PRODUCTGROUPID":"cu ","PRODUCTSORTNO":10,"PRODUCTNAME":"铜 ",
"DELIVERYMONTH":"2112","PRESETTLEMENTPRICE":69850,"OPENPRICE":69770,"HIGHESTPRICE":70280,"LOWESTPRICE":69600,
"CLOSEPRICE":69900,"SETTLEMENTPRICE":69950,"ZD1_CHG":50,"ZD2_CHG":100,"VOLUME":19450,"TURNOVER":680294.525,
"TASVOLUME":"","OPENINTEREST":19065,"OPENINTERESTCHG":-5585,"ORDERNO":0,"ORDERNO2":0}
"""
# error_data = inst_data
if inst_data['DELIVERYMONTH'] == '小计' or inst_data['PRODUCTID'] == '总计':
continue
if '_f' not in inst_data['PRODUCTID']:
continue
# logger.info(f'inst_data: {inst_data}')
code = inst_data['PRODUCTGROUPID'].strip()
if code in IGNORE_INST_LIST:
continue
name = inst_data['PRODUCTNAME'].strip()
if code not in inst_name_dict:
inst_name_dict[code] = name
DailyBar.objects.update_or_create(
code=code + inst_data['DELIVERYMONTH'],
exchange=ExchangeType.SHFE, time=day, defaults={
'expire_date': inst_data['DELIVERYMONTH'],
'open': inst_data['OPENPRICE'] if inst_data['OPENPRICE'] else inst_data['CLOSEPRICE'],
'high': inst_data['HIGHESTPRICE'] if inst_data['HIGHESTPRICE'] else
inst_data['CLOSEPRICE'],
'low': inst_data['LOWESTPRICE'] if inst_data['LOWESTPRICE']
else inst_data['CLOSEPRICE'],
'close': inst_data['CLOSEPRICE'],
'settlement': inst_data['SETTLEMENTPRICE'] if inst_data['SETTLEMENTPRICE'] else
inst_data['PRESETTLEMENTPRICE'],
'volume': inst_data['VOLUME'] if inst_data['VOLUME'] else 0,
'open_interest': inst_data['OPENINTEREST'] if inst_data['OPENINTEREST'] else 0})
# 更新上期所合约中文名称
for code, name in inst_name_dict.items():
Instrument.objects.filter(product_code=code).update(name=name)
return True
except Exception as e:
logger.warning(f'update_from_shfe failed: {repr(e)}', exc_info=True)
return False
async def update_from_czce(day: datetime.datetime) -> bool:
try:
async with _create_http_session() as session:
day_str = day.strftime('%Y%m%d')
async with session.get(
f'http://{czce_ip}/cn/DFSStaticFiles/Future/{day.year}/{day_str}/FutureDataDaily.txt') as response:
rst = await response.text()
for lines in rst.split('\n')[1:-3]:
if '小计' in lines or '合约' in lines or '品种' in lines:
continue
inst_data = [x.strip() for x in lines.split('|' if '|' in lines else ',')]
"""
[0'合约代码', 1'昨结算', 2'今开盘', 3'最高价', 4'最低价', 5'今收盘', 6'今结算', 7'涨跌1', 8'涨跌2', 9'成交量(手)',
10'持仓量', 11'增减量', 12'成交额(万元)', 13'交割结算价']
['CF601', '11,970.00', '11,970.00', '11,970.00', '11,800.00', '11,870.00', '11,905.00', '-100.00',
'-65.00', '13,826', '59,140', '-10,760', '82,305.24', '']
"""
# print(f'inst_data: {inst_data}')
if re.findall('[A-Za-z]+', inst_data[0])[0] in IGNORE_INST_LIST:
continue
close = inst_data[5].replace(',', '') if Decimal(inst_data[5].replace(',', '')) > 0.1 \
else inst_data[6].replace(',', '')
DailyBar.objects.update_or_create(
code=inst_data[0],
exchange=ExchangeType.CZCE, time=day, defaults={
'expire_date': get_expire_date(inst_data[0], day),
'open': inst_data[2].replace(',', '') if Decimal(inst_data[2].replace(',', '')) > 0.1
else close,
'high': inst_data[3].replace(',', '') if Decimal(inst_data[3].replace(',', '')) > 0.1
else close,
'low': inst_data[4].replace(',', '') if Decimal(inst_data[4].replace(',', '')) > 0.1
else close,
'close': close,
'settlement': inst_data[6].replace(',', '') if
Decimal(inst_data[6].replace(',', '')) > 0.1 else inst_data[1].replace(',', ''),
'volume': inst_data[9].replace(',', ''),
'open_interest': inst_data[10].replace(',', '')})
return True
except Exception as e:
logger.warning(f'update_from_czce failed: {repr(e)}', exc_info=True)
return False
async def update_from_dce(day: datetime.datetime) -> bool:
try:
def _to_number(value: Any, default: float = 0.0) -> float:
if value is None:
return default
text = str(value).strip().replace(',', '')
if text in ['', '-', '--', 'nan', 'None']:
return default
return float(str_to_number(text))
token = config.get('TUSHARE', 'token', fallback='').strip()
if not token:
logger.warning('update_from_dce skipped: missing tushare.token in config.yaml')
return False
day_str = day.strftime('%Y%m%d')
def _load_daily_df():
import tushare as ts
pro = ts.pro_api(token)
return pro.fut_daily(
trade_date=day_str,
exchange='DCE',
fields='ts_code,trade_date,pre_close,pre_settle,open,high,low,close,settle,vol,oi',
)
async with max_conn_dce:
df = await asyncio.wait_for(asyncio.to_thread(_load_daily_df), timeout=30)
if df is None or df.empty:
logger.warning(f'update_from_dce empty tushare result: day={day.date()}')
return False
parsed_count = 0
fail_count = 0
for _, row in df.iterrows():
ts_code = str(row.get('ts_code') or '').strip()
base_code = ts_code.split('.', maxsplit=1)[0]
m = re.match(r'^([A-Za-z]+)(\d+)([A-Za-z]*)$', base_code)
if not m:
fail_count += 1
continue
raw_pc = m.group(1).lower()
digits = m.group(2)
tail = (m.group(3) or '').upper()
if tail and tail != 'F':
fail_count += 1
continue
product_code = f'{raw_pc}_f' if tail == 'F' else raw_pc
if product_code in IGNORE_INST_LIST:
continue
contract_code = f'{raw_pc}{digits}{tail}' if tail else f'{raw_pc}{digits}'
close = _to_number(row.get('close'), 0)
settlement = _to_number(row.get('settle'), close)
if settlement <= 0:
settlement = _to_number(row.get('pre_settle'), close)
if close <= 0 and settlement > 0:
close = settlement
if close <= 0:
fail_count += 1
continue
open_price = _to_number(row.get('open'), close)
high = _to_number(row.get('high'), close)
low = _to_number(row.get('low'), close)
volume = _to_number(row.get('vol'), 0)
open_interest = _to_number(row.get('oi'), 0)
DailyBar.objects.update_or_create(
code=contract_code,
exchange=ExchangeType.DCE,
time=day,
defaults={
'expire_date': get_expire_date(contract_code, day),
'open': open_price,
'high': high,
'low': low,
'close': close,
'settlement': settlement if settlement > 0 else close,
'volume': volume,
'open_interest': open_interest,
},
)
parsed_count += 1
if parsed_count == 0:
logger.warning(f'update_from_dce no rows parsed by tushare: day={day.date()} fail_count={fail_count}')
return False
logger.info(f'update_from_dce tushare success: day={day.date()} rows={parsed_count} fail_rows={fail_count}')
return True
except Exception as e:
logger.warning(f'update_from_dce failed: {repr(e)}', exc_info=True)
return False
async def update_from_gfex(day: datetime.datetime) -> bool:
try:
async with _create_http_session() as session:
await max_conn_gfex.acquire()
try:
for ids in ['lc', 'si', 'ps']:
async with session.post(f'http://{gfex_ip}/gfexweb/Quote/getQuote_ftr', data={'varietyid': ids}) as response:
rst = await response.text()
rst_json = orjson.loads(rst)
quote_map = rst_json.get('contractQuote') or {}
for inst_code, inst_data in quote_map.items():
expire_date = inst_code.removeprefix(ids)
close_price = inst_data.get('closePrice')
clear_price = inst_data.get('clearPrice')
close = close_price if close_price not in [None, '', '--'] else clear_price
if close in [None, '', '--']:
close = 0
open_price = inst_data.get('openPrice')
high_price = inst_data.get('highPrice')
low_price = inst_data.get('lowPrice')
volume = inst_data.get('matchTotQty')
open_interest = inst_data.get('openInterest')
DailyBar.objects.update_or_create(
code=inst_code,
exchange=ExchangeType.GFEX, time=day, defaults={
'expire_date': expire_date,
'open': open_price if open_price not in [None, '', '--'] else close,
'high': high_price if high_price not in [None, '', '--'] else close,
'low': low_price if low_price not in [None, '', '--'] else close,
'close': close,
'settlement': clear_price if clear_price not in [None, '', '--'] else close,
'volume': volume if volume not in [None, '', '--'] else 0,
'open_interest': open_interest if open_interest not in [None, '', '--'] else 0,
},
)
finally:
max_conn_gfex.release()
except Exception as e:
logger.warning(f'update_from_gfex failed: {repr(e)}', exc_info=True)
return False
return True
async def update_from_cffex(day: datetime.datetime) -> bool:
try:
async with _create_http_session() as session:
await max_conn_cffex.acquire()
async with session.get(f"http://{cffex_ip}/sj/hqsj/rtj/{day.strftime('%Y%m/%d')}/index.xml?id=7") as response:
rst = await response.text()
max_conn_cffex.release()
tree = ET.fromstring(rst)
for inst_data in tree:
"""
IC2112
20211209
7272
7330
7264.4
7302.4
107546
101956
7274.4
7314.2
7314.2
51752
75570943720
IC
20211217
"""
instrument_id = (inst_data.findtext('instrumentid') or '').strip()
if not instrument_id:
continue
# 不存储期权合约
if len(instrument_id) > 6:
continue
product_id = (inst_data.findtext('productid') or '').strip()
if product_id in IGNORE_INST_LIST:
continue
close_price = (inst_data.findtext('closeprice') or '0').replace(',', '')
settlement_price = (inst_data.findtext('settlementprice') or '').replace(',', '')
pre_settlement = (inst_data.findtext('presettlementprice') or close_price).replace(',', '')
DailyBar.objects.update_or_create(
code=instrument_id,
exchange=ExchangeType.CFFEX, time=day, defaults={
'expire_date': ((inst_data.findtext('expiredate') or '')[2:6]),
'open': (inst_data.findtext('openprice') or close_price).replace(',', ''),
'high': (inst_data.findtext('highestprice') or close_price).replace(',', ''),
'low': (inst_data.findtext('lowestprice') or close_price).replace(',', ''),
'close': close_price,
'settlement': settlement_price if settlement_price else pre_settlement,
'volume': (inst_data.findtext('volume') or '0').replace(',', ''),
'open_interest': (inst_data.findtext('openinterest') or '0').replace(',', ''),
},
)
return True
except Exception as e:
logger.warning(f'update_from_cffex failed: {repr(e)}', exc_info=True)
return False
def store_main_bar(inst: Instrument, bar: DailyBar):
MainBar.objects.update_or_create(
exchange=inst.exchange, product_code=inst.product_code, time=bar.time, defaults={
'code': bar.code,
'open': bar.open,
'high': bar.high,
'low': bar.low,
'close': bar.close,
'settlement': bar.settlement,
'volume': bar.volume,
'open_interest': bar.open_interest})
def handle_rollover(inst: Instrument, new_bar: DailyBar):
"""
换月处理, 基差=新合约收盘价-旧合约收盘价, 从今日起之前的所有连续合约的OHLC加上基差
"""
old_bar = DailyBar.objects.filter(exchange=inst.exchange, code=inst.last_main, time=new_bar.time).first()
main_bar = MainBar.objects.get(exchange=inst.exchange, product_code=inst.product_code, time=new_bar.time)
old_close = old_bar.close if old_bar else new_bar.close
basis = new_bar.close - old_close
main_bar.basis = basis
basis = float(basis)
main_bar.save(update_fields=['basis'])
MainBar.objects.filter(exchange=inst.exchange, product_code=inst.product_code, time__lt=new_bar.time).update(
open=F('open') + basis, high=F('high') + basis, low=F('low') + basis, close=F('close') + basis,
settlement=F('settlement') + basis)
def calc_main_inst(inst: Instrument, day: datetime.datetime):
updated = False
expire_date = get_expire_date(inst.main_code, day) if inst.main_code else day.strftime('%y%m')
code_regex = get_contract_code_regex(inst.product_code or '')
# 条件1: 成交量最大 & (成交量>1万 & 持仓量>1万 or 股指) = 主力合约
check_bar = DailyBar.objects.filter(
(Q(exchange=ExchangeType.CFFEX) | (Q(volume__gte=10000) & Q(open_interest__gte=10000))),
exchange=inst.exchange, code__regex=code_regex,
expire_date__gte=expire_date, time=day.date()).order_by('-volume').first()
# 条件2: 不满足条件1但是连续3天成交量最大 = 主力合约
if check_bar is None:
check_bars = DailyBar.objects.raw(
"SELECT a.* from panel_dailybar a INNER JOIN (SELECT time, max(volume) v FROM panel_dailybar "
"WHERE CODE RLIKE %s and time<=%s GROUP BY time ORDER BY time DESC LIMIT 3) b "
"WHERE a.time=b.time and a.volume=b.v ORDER BY a.time DESC LIMIT 3", [code_regex, day])
check_bar = check_bars[0] if len(set(bar.code for bar in check_bars)) == 1 else None
# 条件3: 取当前成交量最大的作为主力
if check_bar is None:
check_bar = DailyBar.objects.filter(
exchange=inst.exchange, code__regex=code_regex,
expire_date__gte=expire_date, time=day.date()).order_by('-volume', '-open_interest', 'code').first()
if check_bar is None:
check_bar = DailyBar.objects.filter(code=inst.main_code).last()
logger.error(f"calc_main_inst 未找到主力合约:{inst} 使用上一个主力合约")
if check_bar is None:
return inst.main_code, updated
if inst.main_code is None: # 之前没有主力合约
inst.main_code = check_bar.code
inst.change_time = day
inst.save(update_fields=['main_code', 'change_time'])
store_main_bar(inst, check_bar)
else:
cur_main_code = cast(str, inst.main_code)
# 主力合约发生变化, 做换月处理
if check_bar.code and cur_main_code != check_bar.code and check_bar.code > cur_main_code:
inst.last_main = cur_main_code
inst.main_code = check_bar.code
inst.change_time = day
inst.save(update_fields=['last_main', 'main_code', 'change_time'])
store_main_bar(inst, check_bar)
handle_rollover(inst, check_bar)
updated = True
else:
# 禁止主力代码回滚:若候选合约不晚于当前主力,优先写当前主力当日bar
if check_bar.code and check_bar.code < cur_main_code:
cur_main_bar = DailyBar.objects.filter(
exchange=inst.exchange,
code=cur_main_code,
time=day.date(),
).first()
if cur_main_bar is not None:
store_main_bar(inst, cur_main_bar)
else:
logger.warning(
'calc_main_inst skip rollback write: %s.%s day=%s cur_main=%s candidate=%s',
inst.exchange,
inst.product_code,
day.date(),
cur_main_code,
check_bar.code,
)
else:
store_main_bar(inst, check_bar)
return inst.main_code, updated
def create_main(inst: Instrument):
print('processing ', inst.product_code)
code_regex = get_contract_code_regex(inst.product_code or '')
if inst.change_time is None:
for day in DailyBar.objects.filter(
# time__gte=datetime.datetime.strptime('20211211', '%Y%m%d'),
exchange=inst.exchange, code__regex=code_regex).order_by(
'time').values_list('time', flat=True).distinct():
print(day, calc_main_inst(inst, timezone.make_aware(datetime.datetime.combine(day, datetime.time.min))))
else:
for day in DailyBar.objects.filter(
time__gt=inst.change_time,
exchange=inst.exchange, code__regex=code_regex).order_by(
'time').values_list('time', flat=True).distinct():
print(day, calc_main_inst(inst, timezone.make_aware(datetime.datetime.combine(day, datetime.time.min))))
return True
def create_main_all():
for inst in Instrument.objects.all():
create_main(inst)
print('all done!')
def is_auction_time(inst: Instrument, status: dict):
if status['InstrumentStatus'] == ApiStruct.IS_AuctionOrdering:
now = timezone.localtime()
if inst.exchange == ExchangeType.CFFEX:
return True
# 夜盘集合竞价时间是 20:55
if inst.night_trade and now.hour == 20:
return True
# 日盘集合竞价时间是 8:55
if not inst.night_trade and now.hour == 8:
return True
return False
def calc_sma(price, period):
return reduce(lambda x, y: ((period - 1) * x + y) / period, price)
def calc_corr(day: datetime.datetime):
price_dict = dict()
begin_day = day.replace(year=day.year - 3)
for code in Strategy.objects.get(name='大哥2.0').instruments.all().order_by('id').values_list(
'product_code', flat=True):
price_dict[code] = to_df(MainBar.objects.filter(
time__gte=begin_day.date(),
product_code=code).order_by('time').values_list('time', 'close'), index_col='time', parse_dates=['time'])
price_dict[code].index = pd.DatetimeIndex(price_dict[code].time)
price_dict[code]['price'] = price_dict[code].close.pct_change()
return pd.DataFrame({k: v.price for k, v in price_dict.items()}).corr()
def nCr(n, r):
f = math.factorial
return f(n) / f(r) / f(n-r)
def find_best_score(n: int = 20):
"""
一秒钟算5个组合,要算100年..
"""
corr_matrix = calc_corr(datetime.datetime.today())
code_list = Strategy.objects.get(name='大哥2.0').instruments.all().order_by('id').values_list(
'product_code', flat=True)
result = list()
for code_list in tqdm(combinations(code_list, n), total=nCr(code_list.count(), n)):
score_df = pd.DataFrame([corr_matrix.iloc[i, j] for i, j in combinations(code_list, 2)])
score = (round((1 - (score_df.abs() ** 2).mean()[0]) * 100, 3) - 50) * 2
result.append((score, ','.join(code_list)))
result.sort(key=lambda tup: tup[0])
print('得分最高: ', result[-3:])
print('得分最低: ', result[:3])
def calc_history_signal(inst: Instrument, day: datetime.datetime, strategy: Strategy):
param_set = cast(Any, strategy).param_set
break_n = param_set.get(code='BreakPeriod').int_value
atr_n = param_set.get(code='AtrPeriod').int_value
long_n = param_set.get(code='LongPeriod').int_value
short_n = param_set.get(code='ShortPeriod').int_value
stop_n = param_set.get(code='StopLoss').int_value
if not all([break_n, atr_n, long_n, short_n, stop_n]):
return
break_n = int(break_n)
atr_n = int(atr_n)
long_n = int(long_n)
short_n = int(short_n)
stop_n = int(stop_n)
df = to_df(MainBar.objects.filter(
time__lte=day.date(),
exchange=inst.exchange, product_code=inst.product_code).order_by('time').values_list(
'time', 'open', 'high', 'low', 'close', 'settlement'), index_col='time', parse_dates=['time'])
df.index = pd.DatetimeIndex(df.time, tz=pytz.FixedOffset(480))
df['atr'] = ATR(
np.asarray(df.high, dtype=np.float64),
np.asarray(df.low, dtype=np.float64),
np.asarray(df.close, dtype=np.float64),
timeperiod=atr_n,
)
# df columns: 0:time,1:open,2:high,3:low,4:close,5:settlement,6:atr,7:short_trend,8:long_trend
df['short_trend'] = df.close
df['long_trend'] = df.close
for idx in range(1, df.shape[0]):
prev_short = cast(float, df.iloc[idx - 1, 7])
prev_long = cast(float, df.iloc[idx - 1, 8])
close_v = cast(float, df.iloc[idx, 4])
df.iloc[idx, 7] = (prev_short * (short_n - 1) + close_v) / short_n
df.iloc[idx, 8] = (prev_long * (long_n - 1) + close_v) / long_n
df['high_line'] = df.close.rolling(window=break_n).max()
df['low_line'] = df.close.rolling(window=break_n).min()
cur_pos = 0
last_trade = None
for cur_idx in range(break_n+1, df.shape[0]):
idx = cur_idx - 1
cur_date = df.index[cur_idx].to_pydatetime()
prev_date = df.index[idx].to_pydatetime()
if cur_pos == 0:
if df.short_trend[idx] > df.long_trend[idx] and int(df.close[idx]) >= int(df.high_line[idx-1]):
new_bar = MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code, time=cur_date).first()
if new_bar is None:
continue
Signal.objects.create(
code=new_bar.code, trigger_value=df.atr[idx],
strategy=strategy, instrument=inst, type=SignalType.BUY, processed=True,
trigger_time=prev_date, price=new_bar.open, volume=1, priority=PriorityType.LOW)
last_trade = Trade.objects.create(
broker=strategy.broker, strategy=strategy, instrument=inst,
code=new_bar.code, direction=DirectionType.LONG,
open_time=cur_date, shares=1, filled_shares=1, avg_entry_price=new_bar.open)
cur_pos = cur_idx
elif df.short_trend[idx] < df.long_trend[idx] and int(df.close[idx]) < int(df.low_line[idx-1]):
new_bar = MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code,
time=df.index[cur_idx].to_pydatetime().date()).first()
if new_bar is None:
continue
Signal.objects.create(
code=new_bar.code, trigger_value=df.atr[idx],
strategy=strategy, instrument=inst, type=SignalType.SELL_SHORT, processed=True,
trigger_time=prev_date, price=new_bar.open, volume=1, priority=PriorityType.LOW)
last_trade = Trade.objects.create(
broker=strategy.broker, strategy=strategy, instrument=inst,
code=new_bar.code, direction=DirectionType.SHORT,
open_time=cur_date, shares=1, filled_shares=1, avg_entry_price=new_bar.open)
cur_pos = cur_idx * -1
elif cur_pos > 0 and last_trade is not None and prev_date > last_trade.open_time:
hh = float(MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code,
time__gte=last_trade.open_time,
time__lt=prev_date).aggregate(Max('high'))['high__max'])
if df.close[idx] <= hh - df.atr[cur_pos-1] * stop_n:
new_bar = MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code,
time=df.index[cur_idx].to_pydatetime().date()).first()
if new_bar is None or last_trade.avg_entry_price is None:
continue
Signal.objects.create(
strategy=strategy, instrument=inst, type=SignalType.SELL, processed=True,
code=new_bar.code,
trigger_time=prev_date, price=new_bar.open, volume=1, priority=PriorityType.LOW)
last_trade.avg_exit_price = new_bar.open
last_trade.close_time = cur_date
last_trade.closed_shares = 1
last_trade.profit = (new_bar.open - last_trade.avg_entry_price) * (inst.volume_multiple or 0)
last_trade.save()
cur_pos = 0
elif cur_pos < 0 and last_trade is not None and prev_date > last_trade.open_time:
ll = float(MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code,
time__gte=last_trade.open_time,
time__lt=prev_date).aggregate(Min('low'))['low__min'])
if df.close[idx] >= ll + df.atr[cur_pos * -1-1] * stop_n:
new_bar = MainBar.objects.filter(
exchange=inst.exchange, product_code=inst.product_code,
time=df.index[cur_idx].to_pydatetime().date()).first()
if new_bar is None or last_trade.avg_entry_price is None:
continue
Signal.objects.create(
code=new_bar.code,
strategy=strategy, instrument=inst, type=SignalType.BUY_COVER, processed=True,
trigger_time=prev_date, price=new_bar.open, volume=1, priority=PriorityType.LOW)
last_trade.avg_exit_price = new_bar.open
last_trade.close_time = cur_date
last_trade.closed_shares = 1
last_trade.profit = (last_trade.avg_entry_price - new_bar.open) * (inst.volume_multiple or 0)
last_trade.save()
cur_pos = 0
if cur_pos != 0 and cur_date.date() == day.date() and last_trade is not None and last_trade.avg_entry_price is not None:
last_trade.avg_exit_price = df.open[cur_idx]
last_trade.close_time = cur_date
last_trade.closed_shares = 1
open_price = Decimal(str(df.open[cur_idx]))
if last_trade.direction == DirectionType.LONG:
last_trade.profit = (last_trade.avg_entry_price - Decimal(df.open[cur_idx])) * \
(inst.volume_multiple or 0)
else:
last_trade.profit = (open_price - last_trade.avg_entry_price) * \
(inst.volume_multiple or 0)
last_trade.save()
def calc_his_all(day: datetime.datetime):
strategy = Strategy.objects.get(name='大哥2.0')
print(f'calc_his_all day: {day} stragety: {strategy}')
for inst in strategy.instruments.all():
print('process', inst)
last_day = Trade.objects.filter(instrument=inst, close_time__isnull=True).values_list(
'open_time', flat=True).first()
if last_day is None:
last_main_day = MainBar.objects.filter(product_code=inst.product_code, time__lte=day).order_by(
'-time').values_list('time', flat=True).first()
if last_main_day is None:
continue
last_day = timezone.make_aware(datetime.datetime.combine(last_main_day, datetime.time.min))
calc_history_signal(inst, last_day, strategy)
def calc_his_up_limit(inst: Instrument, bar: DailyBar):
ratio = Decimal(round(float(inst.up_limit_ratio or Decimal('0')), 3))
settlement = cast(Decimal, bar.settlement or bar.close)
tick = cast(Decimal, inst.price_tick or Decimal('0.001'))
price = price_round(settlement * (Decimal(1) + ratio), tick)
return price - tick
def calc_his_down_limit(inst: Instrument, bar: DailyBar):
ratio = Decimal(round(float(inst.down_limit_ratio or Decimal('0')), 3))
settlement = cast(Decimal, bar.settlement or bar.close)
tick = cast(Decimal, inst.price_tick or Decimal('0.001'))
price = price_round(settlement * (Decimal(1) - ratio), tick)
return price + tick
async def clean_daily_bar():
day = timezone.make_aware(datetime.datetime.strptime('20100416', '%Y%m%d'))
end = timezone.make_aware(datetime.datetime.strptime('20160118', '%Y%m%d'))
tasks = []
while day <= end:
tasks.append(is_trading_day(day))
day += datetime.timedelta(days=1)
trading_days = []
for f in tqdm(asyncio.as_completed(tasks), total=len(tasks)):
rst = await f
trading_days.append(rst)
tasks.clear()
for day, trading in trading_days:
if not trading:
DailyBar.objects.filter(time=day.date()).delete()
print('done!')
def load_kt_data(directory: str = r'D:\test'):
"""PK99.txt
1210224,10944.000 ,10992.000 ,10758.000 ,10904.000 ,10702.000 ,42202 ,20897 ,PK2110
"""
try:
for filename in os.listdir(directory):
if not filename.endswith(".txt"):
continue
code = filename.split('9', maxsplit=1)[0]
inst = Instrument.objects.get(product_code=code)
print('process', inst)
cur_main = last_main = change_time = None
insert_list = []
with open(os.path.join(directory, filename)) as f:
for line in f:
date, oo, hh, ll, cc, se, oi, vo, main_code = [part.strip() for part in line.split(',')]
date = f'{int(date[:3])+1900}-{date[3:5]}-{date[5:7]}'
date = timezone.make_aware(datetime.datetime.strptime(date, '%Y-%m-%d'))
if cur_main != main_code:
if last_main != main_code:
last_main = cur_main
cur_main = main_code
change_time = date
insert_list.append(MainBar(
exchange=inst.exchange, product_code=code, code=main_code, time=date, open=oo, high=hh, low=ll,
close=cc, settlement=se, open_interest=oi, volume=vo, basis=None))
MainBar.objects.bulk_create(insert_list)
Instrument.objects.filter(product_code=code).update(
last_main=last_main, main_code=cur_main, change_time=change_time)
return True
except Exception as e:
logger.warning(f'load_kt_data failed: {repr(e)}', exc_info=True)
return False
# 从交易所获取合约当日的涨跌停幅度 TODO: 广期所
async def get_contracts_argument(day: datetime.datetime | None = None) -> bool:
try:
if day is None:
day = timezone.localtime()
day_str = day.strftime('%Y%m%d')
async with aiohttp.ClientSession() as session:
# 上期所
async with session.get(
f'http://{shfe_ip}/data/busiparamdata/future/ContractDailyTradeArgument{day_str}.dat') as response:
rst = await response.read()
rst_json = orjson.loads(rst)
for inst_data in rst_json['ContractDailyTradeArgument']:
"""
{"HDEGE_LONGMARGINRATIO":".10000000","HDEGE_SHORTMARGINRATIO":".10000000","INSTRUMENTID":"cu2201",
"LOWER_VALUE":".08000000","PRICE_LIMITS":"","SPEC_LONGMARGINRATIO":".10000000","SPEC_SHORTMARGINRATIO":".10000000",
"TRADINGDAY":"20211217","UPDATE_DATE":"2021-12-17 09:51:20","UPPER_VALUE":".08000000","id":124468118}
"""
# logger.info(f'inst_data: {inst_data}')
code = re.findall('[A-Za-z]+', inst_data['INSTRUMENTID'])[0]
if code in IGNORE_INST_LIST:
continue
limit_ratio = str_to_number(inst_data['UPPER_VALUE'])
key = f"LIMITRATIO:{ExchangeType.SHFE}:{code}:{inst_data['INSTRUMENTID']}"
state_store.set(key, limit_ratio)
# 大商所
async with session.post(f'http://{dce_ip}/publicweb/notificationtips/exportDayTradPara.html',
data={'exportFlag': 'txt'}) as response:
rst = await response.text()
for lines in rst.split('\r\n')[3:400]:
# 跳过期权合约
if '本系列限额' in lines:
break
inst_data_raw = [x.strip() for x in lines.split('\t')]
inst_data = []
for cell in inst_data_raw:
if len(cell) > 0:
inst_data.append(cell)
if len(inst_data) == 0:
continue
"""
[0合约,1交易保证金比例(投机),2交易保证金金额(元/手)(投机),3交易保证金比例(套保),4交易保证金金额(元/手)(套保),5涨跌停板比例,
6涨停板价位(元),7跌停板价位(元)]
['a2201','0.12','7,290','0.08','4,860','0.08','6,561','5,589','30,000','15,000']
"""
code = re.findall('[A-Za-z]+', inst_data[0])[0]
if code in IGNORE_INST_LIST:
continue
limit_ratio = str_to_number(inst_data[5])
key = f"LIMITRATIO:{ExchangeType.DCE}:{code}:{inst_data[0]}"
state_store.set(key, limit_ratio)
# 郑商所
async with session.get(f'http://{czce_ip}/cn/DFSStaticFiles/Future/{day.year}/{day_str}/'
f'FutureDataClearParams.txt') as response:
rst = await response.text()
for lines in rst.split('\n')[2:]:
if not lines:
continue
inst_data = [x.strip() for x in lines.split('|' if '|' in lines else ',')]
"""
[0合约代码,1当日结算价,2是否单边市,3连续单边市天数,4交易保证金率(%),5涨跌停板(%),6交易手续费,7交割手续费,8日内平今仓交易手续费,9日持仓限额]
['AP201','8,148.00','N','0','10','±9','5.00','0.00','20.00','200','']
"""
code = re.findall('[A-Za-z]+', inst_data[0])[0]
if code in IGNORE_INST_LIST:
continue
limit_ratio = str_to_number(inst_data[5][1:]) / 100
key = f"LIMITRATIO:{ExchangeType.CZCE}:{code}:{inst_data[0]}"
state_store.set(key, limit_ratio)
# 中金所
async with session.get(f"http://{cffex_ip}/sj/jycs/{day.strftime('%Y%m/%d')}/index.xml") as response:
rst = await response.text()
max_conn_cffex.release()
tree = ET.fromstring(rst)
for inst_data in tree:
"""
20211216
IC
IC2112
2112
6072.8
20210419
20211217
0.1
0.1
8063.6
6597.6
1200
"""
inst_id = (inst_data.findtext('INSTRUMENT_ID') or '').strip()
# 不存储期权合约
if len(inst_id) > 6:
continue
code = (inst_data.findtext('PRODUCT_ID') or '').strip()
if code in IGNORE_INST_LIST:
continue
limit_ratio = str_to_number((inst_data.findtext('UPPER_VALUE') or '0').strip())
key = f"LIMITRATIO:{ExchangeType.CFFEX}:{code}:{inst_id}"
state_store.set(key, limit_ratio)
# 保存数据
for inst in Instrument.objects.all():
key = f"LIMITRATIO:{inst.exchange}:{inst.product_code}:{inst.main_code}"
ratio = state_store.get(key)
if ratio:
ratio = str_to_number(ratio)
ratio_decimal = Decimal(str(ratio))
inst.up_limit_ratio = ratio_decimal
inst.down_limit_ratio = ratio_decimal
inst.save(update_fields=['up_limit_ratio', 'down_limit_ratio'])
return True
except Exception as e:
logger.warning(f'get_contracts_argument failed: {repr(e)}', exc_info=True)
return False
================================================
FILE: utils/fetch_data.py
================================================
import sys
import os
import datetime
import asyncio
import pytz
from tqdm import tqdm
import django
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if ROOT not in sys.path:
sys.path.insert(0, ROOT)
os.environ["DJANGO_SETTINGS_MODULE"] = "dashboard.settings"
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
django.setup()
from utils import update_from_shfe, update_from_dce, update_from_czce, update_from_cffex, \
create_main_all, check_trading_day
from django.utils import timezone
async def fetch_bar():
day_end = timezone.localtime()
day_start = day_end - datetime.timedelta(days=365)
tasks = []
while day_start <= day_end:
tasks.append(check_trading_day(day_start))
day_start += datetime.timedelta(days=1)
trading_days = []
for f in tqdm(asyncio.as_completed(tasks), total=len(tasks)):
rst = await f
trading_days.append(rst)
tasks.clear()
for day, trading in trading_days:
if trading:
tasks += [
asyncio.ensure_future(update_from_shfe(day)),
asyncio.ensure_future(update_from_dce(day)),
asyncio.ensure_future(update_from_czce(day)),
asyncio.ensure_future(update_from_cffex(day)),
]
print('task len=', len(tasks))
for f in tqdm(asyncio.as_completed(tasks), total=len(tasks)):
await f
async def fetch_bar2():
day_end = timezone.localtime()
day_start = day_end - datetime.timedelta(days=365)
while day_start <= day_end:
day, trading = await check_trading_day(day_start)
if trading:
print('process ', day)
tasks = [
asyncio.ensure_future(update_from_shfe(day)),
asyncio.ensure_future(update_from_dce(day)),
asyncio.ensure_future(update_from_czce(day)),
asyncio.ensure_future(update_from_cffex(day)),
]
await asyncio.wait(tasks)
day_start += datetime.timedelta(days=1)
print('all done!')
# asyncio.get_event_loop().run_until_complete(fetch_bar2())
create_main_all()
# fetch_from_quandl_all()
# clean_dailybar()
# load_kt_data()
# calc_his_all(timezone.localtime()-datetime.timedelta(days=1))
================================================
FILE: utils/func_container.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from abc import ABCMeta
from functools import wraps
def RegisterCallback(**out_kwargs):
def _callback_handler(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
return func(self, *args, *kwargs)
for key, value in out_kwargs.items():
setattr(wrapper, f'arg_{key}', value)
setattr(wrapper, 'is_callback_function', True)
return wrapper
return _callback_handler
class CallbackFunctionContainer(object, metaclass=ABCMeta):
def __init__(self):
self.callback_fun_args = dict()
self._collect_all()
def _collect_all(self):
for fun_name in dir(self):
fun = getattr(self, fun_name)
if hasattr(fun, 'is_callback_function'):
params = dict()
for arg in dir(fun):
if arg.startswith('arg_'):
params[arg[4:]] = getattr(fun, arg)
self.callback_fun_args[fun_name] = params
================================================
FILE: utils/model/__init__.py
================================================
from .kronos import KronosTokenizer, Kronos, KronosPredictor
model_dict = {
'kronos_tokenizer': KronosTokenizer,
'kronos': Kronos,
'kronos_predictor': KronosPredictor
}
def get_model_class(model_name):
if model_name in model_dict:
return model_dict[model_name]
else:
print(f"Model {model_name} not found in model_dict")
raise NotImplementedError
================================================
FILE: utils/model/kronos.py
================================================
import numpy as np
import pandas as pd
import torch
from huggingface_hub import PyTorchModelHubMixin
from tqdm import trange
from .module import *
class KronosTokenizer(nn.Module, PyTorchModelHubMixin):
"""
KronosTokenizer module for tokenizing input data using a hybrid quantization approach.
This tokenizer utilizes a combination of encoder and decoder Transformer blocks
along with the Binary Spherical Quantization (BSQuantizer) to compress and decompress input data.
Args:
d_in (int): Input dimension.
d_model (int): Model dimension.
n_heads (int): Number of attention heads.
ff_dim (int): Feed-forward dimension.
n_enc_layers (int): Number of encoder layers.
n_dec_layers (int): Number of decoder layers.
ffn_dropout_p (float): Dropout probability for feed-forward networks.
attn_dropout_p (float): Dropout probability for attention mechanisms.
resid_dropout_p (float): Dropout probability for residual connections.
s1_bits (int): Number of bits for the pre token in BSQuantizer.
s2_bits (int): Number of bits for the post token in BSQuantizer.
beta (float): Beta parameter for BSQuantizer.
gamma0 (float): Gamma0 parameter for BSQuantizer.
gamma (float): Gamma parameter for BSQuantizer.
zeta (float): Zeta parameter for BSQuantizer.
group_size (int): Group size parameter for BSQuantizer.
"""
def __init__(self, d_in, d_model, n_heads, ff_dim, n_enc_layers, n_dec_layers, ffn_dropout_p, attn_dropout_p, resid_dropout_p, s1_bits, s2_bits, beta, gamma0, gamma, zeta, group_size):
super().__init__()
self.d_in = d_in
self.d_model = d_model
self.n_heads = n_heads
self.ff_dim = ff_dim
self.enc_layers = n_enc_layers
self.dec_layers = n_dec_layers
self.ffn_dropout_p = ffn_dropout_p
self.attn_dropout_p = attn_dropout_p
self.resid_dropout_p = resid_dropout_p
self.s1_bits = s1_bits
self.s2_bits = s2_bits
self.codebook_dim = s1_bits + s2_bits # Total dimension of the codebook after quantization
self.embed = nn.Linear(self.d_in, self.d_model)
self.head = nn.Linear(self.d_model, self.d_in)
# Encoder Transformer Blocks
self.encoder = nn.ModuleList([
TransformerBlock(self.d_model, self.n_heads, self.ff_dim, self.ffn_dropout_p, self.attn_dropout_p, self.resid_dropout_p)
for _ in range(self.enc_layers - 1)
])
# Decoder Transformer Blocks
self.decoder = nn.ModuleList([
TransformerBlock(self.d_model, self.n_heads, self.ff_dim, self.ffn_dropout_p, self.attn_dropout_p, self.resid_dropout_p)
for _ in range(self.dec_layers - 1)
])
self.quant_embed = nn.Linear(in_features=self.d_model, out_features=self.codebook_dim) # Linear layer before quantization
self.post_quant_embed_pre = nn.Linear(in_features=self.s1_bits, out_features=self.d_model) # Linear layer after quantization (pre part - s1 bits)
self.post_quant_embed = nn.Linear(in_features=self.codebook_dim, out_features=self.d_model) # Linear layer after quantization (full codebook)
self.tokenizer = BSQuantizer(self.s1_bits, self.s2_bits, beta, gamma0, gamma, zeta, group_size) # BSQuantizer module
def forward(self, x):
"""
Forward pass of the KronosTokenizer.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, seq_len, d_in).
Returns:
tuple: A tuple containing:
- tuple: (z_pre, z) - Reconstructed outputs from decoder with s1_bits and full codebook respectively,
both of shape (batch_size, seq_len, d_in).
- torch.Tensor: bsq_loss - Loss from the BSQuantizer.
- torch.Tensor: quantized - Quantized representation from BSQuantizer.
- torch.Tensor: z_indices - Indices from the BSQuantizer.
"""
z = self.embed(x)
for layer in self.encoder:
z = layer(z)
z = self.quant_embed(z) # (B, T, codebook)
bsq_loss, quantized, z_indices = self.tokenizer(z)
quantized_pre = quantized[:, :, :self.s1_bits] # Extract the first part of quantized representation (s1_bits)
z_pre = self.post_quant_embed_pre(quantized_pre)
z = self.post_quant_embed(quantized)
# Decoder layers (for pre part - s1 bits)
for layer in self.decoder:
z_pre = layer(z_pre)
z_pre = self.head(z_pre)
# Decoder layers (for full codebook)
for layer in self.decoder:
z = layer(z)
z = self.head(z)
return (z_pre, z), bsq_loss, quantized, z_indices
def indices_to_bits(self, x, half=False):
"""
Converts indices to bit representations and scales them.
Args:
x (torch.Tensor): Indices tensor.
half (bool, optional): Whether to process only half of the codebook dimension. Defaults to False.
Returns:
torch.Tensor: Bit representation tensor.
"""
if half:
x1 = x[0] # Assuming x is a tuple of indices if half is True
x2 = x[1]
mask = 2 ** torch.arange(self.codebook_dim//2, device=x1.device, dtype=torch.long) # Create a mask for bit extraction
x1 = (x1.unsqueeze(-1) & mask) != 0 # Extract bits for the first half
x2 = (x2.unsqueeze(-1) & mask) != 0 # Extract bits for the second half
x = torch.cat([x1, x2], dim=-1) # Concatenate the bit representations
else:
mask = 2 ** torch.arange(self.codebook_dim, device=x.device, dtype=torch.long) # Create a mask for bit extraction
x = (x.unsqueeze(-1) & mask) != 0 # Extract bits
x = x.float() * 2 - 1 # Convert boolean to bipolar (-1, 1)
q_scale = 1. / (self.codebook_dim ** 0.5) # Scaling factor
x = x * q_scale
return x
def encode(self, x, half=False):
"""
Encodes the input data into quantized indices.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, seq_len, d_in).
half (bool, optional): Whether to use half quantization in BSQuantizer. Defaults to False.
Returns:
torch.Tensor: Quantized indices from BSQuantizer.
"""
z = self.embed(x)
for layer in self.encoder:
z = layer(z)
z = self.quant_embed(z)
bsq_loss, quantized, z_indices = self.tokenizer(z, half)
return z_indices
def decode(self, x, half=False):
"""
Decodes quantized indices back to the input data space.
Args:
x (torch.Tensor): Quantized indices tensor.
half (bool, optional): Whether the indices were generated with half quantization. Defaults to False.
Returns:
torch.Tensor: Reconstructed output tensor of shape (batch_size, seq_len, d_in).
"""
quantized = self.indices_to_bits(x, half)
z = self.post_quant_embed(quantized)
for layer in self.decoder:
z = layer(z)
z = self.head(z)
return z
class Kronos(nn.Module, PyTorchModelHubMixin):
"""
Kronos Model.
Args:
s1_bits (int): Number of bits for pre tokens.
s2_bits (int): Number of bits for post tokens.
n_layers (int): Number of Transformer blocks.
d_model (int): Dimension of the model's embeddings and hidden states.
n_heads (int): Number of attention heads in the MultiheadAttention layers.
ff_dim (int): Dimension of the feedforward network in the Transformer blocks.
ffn_dropout_p (float): Dropout probability for the feedforward network.
attn_dropout_p (float): Dropout probability for the attention layers.
resid_dropout_p (float): Dropout probability for residual connections.
token_dropout_p (float): Dropout probability for token embeddings.
learn_te (bool): Whether to use learnable temporal embeddings.
"""
def __init__(self, s1_bits, s2_bits, n_layers, d_model, n_heads, ff_dim, ffn_dropout_p, attn_dropout_p, resid_dropout_p, token_dropout_p, learn_te):
super().__init__()
self.s1_bits = s1_bits
self.s2_bits = s2_bits
self.n_layers = n_layers
self.d_model = d_model
self.n_heads = n_heads
self.learn_te = learn_te
self.ff_dim = ff_dim
self.ffn_dropout_p = ffn_dropout_p
self.attn_dropout_p = attn_dropout_p
self.resid_dropout_p = resid_dropout_p
self.token_dropout_p = token_dropout_p
self.s1_vocab_size = 2 ** self.s1_bits
self.token_drop = nn.Dropout(self.token_dropout_p)
self.embedding = HierarchicalEmbedding(self.s1_bits, self.s2_bits, self.d_model)
self.time_emb = TemporalEmbedding(self.d_model, self.learn_te)
self.transformer = nn.ModuleList([
TransformerBlock(self.d_model, self.n_heads, self.ff_dim, self.ffn_dropout_p, self.attn_dropout_p, self.resid_dropout_p)
for _ in range(self.n_layers)
])
self.norm = RMSNorm(self.d_model)
self.dep_layer = DependencyAwareLayer(self.d_model)
self.head = DualHead(self.s1_bits, self.s2_bits, self.d_model)
self.apply(self._init_weights)
def _init_weights(self, module):
if isinstance(module, nn.Linear):
nn.init.xavier_normal_(module.weight)
if module.bias is not None:
nn.init.zeros_(module.bias)
elif isinstance(module, nn.Embedding):
nn.init.normal_(module.weight, mean=0, std=self.embedding.d_model ** -0.5)
elif isinstance(module, nn.LayerNorm):
nn.init.ones_(module.weight)
nn.init.zeros_(module.bias)
elif isinstance(module, RMSNorm):
nn.init.ones_(module.weight)
def forward(self, s1_ids, s2_ids, stamp=None, padding_mask=None, use_teacher_forcing=False, s1_targets=None):
"""
Args:
s1_ids (torch.Tensor): Input tensor of s1 token IDs. Shape: [batch_size, seq_len]
s2_ids (torch.Tensor): Input tensor of s2 token IDs. Shape: [batch_size, seq_len]
stamp (torch.Tensor, optional): Temporal stamp tensor. Shape: [batch_size, seq_len]. Defaults to None.
padding_mask (torch.Tensor, optional): Mask for padding tokens. Shape: [batch_size, seq_len]. Defaults to None.
use_teacher_forcing (bool, optional): Whether to use teacher forcing for s1 decoding. Defaults to False.
s1_targets (torch.Tensor, optional): Target s1 token IDs for teacher forcing. Shape: [batch_size, seq_len]. Defaults to None.
Returns:
Tuple[torch.Tensor, torch.Tensor]:
- s1 logits: Logits for s1 token predictions. Shape: [batch_size, seq_len, s1_vocab_size]
- s2_logits: Logits for s2 token predictions, conditioned on s1. Shape: [batch_size, seq_len, s2_vocab_size]
"""
x = self.embedding([s1_ids, s2_ids])
if stamp is not None:
time_embedding = self.time_emb(stamp)
x = x + time_embedding
x = self.token_drop(x)
for layer in self.transformer:
x = layer(x, key_padding_mask=padding_mask)
x = self.norm(x)
s1_logits = self.head(x)
if use_teacher_forcing:
sibling_embed = self.embedding.emb_s1(s1_targets)
else:
s1_probs = F.softmax(s1_logits.detach(), dim=-1)
sample_s1_ids = torch.multinomial(s1_probs.view(-1, self.s1_vocab_size), 1).view(s1_ids.shape)
sibling_embed = self.embedding.emb_s1(sample_s1_ids)
x2 = self.dep_layer(x, sibling_embed, key_padding_mask=padding_mask) # Dependency Aware Layer: Condition on s1 embeddings
s2_logits = self.head.cond_forward(x2)
return s1_logits, s2_logits
def decode_s1(self, s1_ids, s2_ids, stamp=None, padding_mask=None):
"""
Decodes only the s1 tokens.
This method performs a forward pass to predict only s1 tokens. It returns the s1 logits
and the context representation from the Transformer, which can be used for subsequent s2 decoding.
Args:
s1_ids (torch.Tensor): Input tensor of s1 token IDs. Shape: [batch_size, seq_len]
s2_ids (torch.Tensor): Input tensor of s2 token IDs. Shape: [batch_size, seq_len]
stamp (torch.Tensor, optional): Temporal stamp tensor. Shape: [batch_size, seq_len]. Defaults to None.
padding_mask (torch.Tensor, optional): Mask for padding tokens. Shape: [batch_size, seq_len]. Defaults to None.
Returns:
Tuple[torch.Tensor, torch.Tensor]:
- s1 logits: Logits for s1 token predictions. Shape: [batch_size, seq_len, s1_vocab_size]
- context: Context representation from the Transformer. Shape: [batch_size, seq_len, d_model]
"""
x = self.embedding([s1_ids, s2_ids])
if stamp is not None:
time_embedding = self.time_emb(stamp)
x = x + time_embedding
x = self.token_drop(x)
for layer in self.transformer:
x = layer(x, key_padding_mask=padding_mask)
x = self.norm(x)
s1_logits = self.head(x)
return s1_logits, x
def decode_s2(self, context, s1_ids, padding_mask=None):
"""
Decodes the s2 tokens, conditioned on the context and s1 tokens.
This method decodes s2 tokens based on a pre-computed context representation (typically from `decode_s1`)
and the s1 token IDs. It uses the dependency-aware layer and the conditional s2 head to predict s2 tokens.
Args:
context (torch.Tensor): Context representation from the transformer (output of decode_s1).
Shape: [batch_size, seq_len, d_model]
s1_ids (torch.torch.Tensor): Input tensor of s1 token IDs. Shape: [batch_size, seq_len]
padding_mask (torch.Tensor, optional): Mask for padding tokens. Shape: [batch_size, seq_len]. Defaults to None.
Returns:
torch.Tensor: s2 logits. Shape: [batch_size, seq_len, s2_vocab_size]
"""
sibling_embed = self.embedding.emb_s1(s1_ids)
x2 = self.dep_layer(context, sibling_embed, key_padding_mask=padding_mask)
return self.head.cond_forward(x2)
def top_k_top_p_filtering(
logits,
top_k: int = 0,
top_p: float = 1.0,
filter_value: float = -float("Inf"),
min_tokens_to_keep: int = 1,
):
"""Filter a distribution of logits using top-k and/or nucleus (top-p) filtering
Args:
logits: logits distribution shape (batch size, vocabulary size)
if top_k > 0: keep only top k tokens with highest probability (top-k filtering).
if top_p < 1.0: keep the top tokens with cumulative probability >= top_p (nucleus filtering).
Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751)
Make sure we keep at least min_tokens_to_keep per batch example in the output
From: https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317
"""
if top_k > 0:
top_k = min(max(top_k, min_tokens_to_keep), logits.size(-1)) # Safety check
# Remove all tokens with a probability less than the last token of the top-k
indices_to_remove = logits < torch.topk(logits, top_k)[0][..., -1, None]
logits[indices_to_remove] = filter_value
return logits
if top_p < 1.0:
sorted_logits, sorted_indices = torch.sort(logits, descending=True)
cumulative_probs = torch.cumsum(F.softmax(sorted_logits, dim=-1), dim=-1)
# Remove tokens with cumulative probability above the threshold (token with 0 are kept)
sorted_indices_to_remove = cumulative_probs > top_p
if min_tokens_to_keep > 1:
# Keep at least min_tokens_to_keep (set to min_tokens_to_keep-1 because we add the first one below)
sorted_indices_to_remove[..., :min_tokens_to_keep] = 0
# Shift the indices to the right to keep also the first token above the threshold
sorted_indices_to_remove[..., 1:] = sorted_indices_to_remove[..., :-1].clone()
sorted_indices_to_remove[..., 0] = 0
# scatter sorted tensors to original indexing
indices_to_remove = sorted_indices_to_remove.scatter(1, sorted_indices, sorted_indices_to_remove)
logits[indices_to_remove] = filter_value
return logits
def sample_from_logits(logits, temperature=1.0, top_k=None, top_p=None, sample_logits=True):
logits = logits / temperature
if top_k is not None or top_p is not None:
if top_k > 0 or top_p < 1.0:
logits = top_k_top_p_filtering(logits, top_k=top_k, top_p=top_p)
probs = F.softmax(logits, dim=-1)
if not sample_logits:
_, x = top_k(probs, k=1, dim=-1)
else:
x = torch.multinomial(probs, num_samples=1)
return x
def auto_regressive_inference(tokenizer, model, x, x_stamp, y_stamp, max_context, pred_len, clip=5, T=1.0, top_k=0, top_p=0.99, sample_count=5, verbose=False):
with torch.no_grad():
batch_size = x.size(0)
initial_seq_len = x.size(1)
x = torch.clip(x, -clip, clip)
device = x.device
x = x.unsqueeze(1).repeat(1, sample_count, 1, 1).reshape(-1, x.size(1), x.size(2)).to(device)
x_stamp = x_stamp.unsqueeze(1).repeat(1, sample_count, 1, 1).reshape(-1, x_stamp.size(1), x_stamp.size(2)).to(device)
y_stamp = y_stamp.unsqueeze(1).repeat(1, sample_count, 1, 1).reshape(-1, y_stamp.size(1), y_stamp.size(2)).to(device)
x_token = tokenizer.encode(x, half=True)
def get_dynamic_stamp(x_stamp, y_stamp, current_seq_len, pred_step):
if current_seq_len <= max_context - pred_step:
return torch.cat([x_stamp, y_stamp[:, :pred_step, :]], dim=1)
else:
start_idx = max_context - pred_step
return torch.cat([x_stamp[:, -start_idx:, :], y_stamp[:, :pred_step, :]], dim=1)
if verbose:
ran = trange
else:
ran = range
for i in ran(pred_len):
current_seq_len = initial_seq_len + i
if current_seq_len <= max_context:
input_tokens = x_token
else:
input_tokens = [t[:, -max_context:].contiguous() for t in x_token]
current_stamp = get_dynamic_stamp(x_stamp, y_stamp, current_seq_len, i)
s1_logits, context = model.decode_s1(input_tokens[0], input_tokens[1], current_stamp)
s1_logits = s1_logits[:, -1, :]
sample_pre = sample_from_logits(s1_logits, temperature=T, top_k=top_k, top_p=top_p, sample_logits=True)
s2_logits = model.decode_s2(context, sample_pre)
s2_logits = s2_logits[:, -1, :]
sample_post = sample_from_logits(s2_logits, temperature=T, top_k=top_k, top_p=top_p, sample_logits=True)
x_token[0] = torch.cat([x_token[0], sample_pre], dim=1)
x_token[1] = torch.cat([x_token[1], sample_post], dim=1)
torch.cuda.empty_cache()
input_tokens = [t[:, -max_context:].contiguous() for t in x_token]
z = tokenizer.decode(input_tokens, half=True)
z = z.reshape(batch_size, sample_count, z.size(1), z.size(2))
preds = z.cpu().numpy()
preds = np.mean(preds, axis=1)
return preds
def calc_time_stamps(x_timestamp):
time_df = pd.DataFrame()
time_df['minute'] = x_timestamp.dt.minute
time_df['hour'] = x_timestamp.dt.hour
time_df['weekday'] = x_timestamp.dt.weekday
time_df['day'] = x_timestamp.dt.day
time_df['month'] = x_timestamp.dt.month
return time_df
class KronosPredictor:
def __init__(self, model, tokenizer, device="cuda:0", max_context=512, clip=5):
self.tokenizer = tokenizer
self.model = model
self.max_context = max_context
self.clip = clip
self.price_cols = ['open', 'high', 'low', 'close']
self.vol_col = 'volume'
self.amt_vol = 'amount'
self.time_cols = ['minute', 'hour', 'weekday', 'day', 'month']
self.device = device
self.tokenizer = self.tokenizer.to(self.device)
self.model = self.model.to(self.device)
def generate(self, x, x_stamp, y_stamp, pred_len, T, top_k, top_p, sample_count, verbose):
x_tensor = torch.from_numpy(np.array(x).astype(np.float32)).to(self.device)
x_stamp_tensor = torch.from_numpy(np.array(x_stamp).astype(np.float32)).to(self.device)
y_stamp_tensor = torch.from_numpy(np.array(y_stamp).astype(np.float32)).to(self.device)
preds = auto_regressive_inference(self.tokenizer, self.model, x_tensor, x_stamp_tensor, y_stamp_tensor, self.max_context, pred_len,
self.clip, T, top_k, top_p, sample_count, verbose)
preds = preds[:, -pred_len:, :]
return preds
def predict(self, df, x_timestamp, y_timestamp, pred_len, T=1.0, top_k=0, top_p=0.9, sample_count=1, verbose=True):
if not isinstance(df, pd.DataFrame):
raise ValueError("Input must be a pandas DataFrame.")
if not all(col in df.columns for col in self.price_cols):
raise ValueError(f"Price columns {self.price_cols} not found in DataFrame.")
df = df.copy()
if self.vol_col not in df.columns:
df[self.vol_col] = 0.0 # Fill missing volume with zeros
df[self.amt_vol] = 0.0 # Fill missing amount with zeros
if self.amt_vol not in df.columns and self.vol_col in df.columns:
df[self.amt_vol] = df[self.vol_col] * df[self.price_cols].mean(axis=1)
if df[self.price_cols + [self.vol_col, self.amt_vol]].isnull().values.any():
raise ValueError("Input DataFrame contains NaN values in price or volume columns.")
x_time_df = calc_time_stamps(x_timestamp)
y_time_df = calc_time_stamps(y_timestamp)
x = df[self.price_cols + [self.vol_col, self.amt_vol]].values.astype(np.float32)
x_stamp = x_time_df.values.astype(np.float32)
y_stamp = y_time_df.values.astype(np.float32)
x_mean, x_std = np.mean(x, axis=0), np.std(x, axis=0)
x = (x - x_mean) / (x_std + 1e-5)
x = np.clip(x, -self.clip, self.clip)
x = x[np.newaxis, :]
x_stamp = x_stamp[np.newaxis, :]
y_stamp = y_stamp[np.newaxis, :]
preds = self.generate(x, x_stamp, y_stamp, pred_len, T, top_k, top_p, sample_count, verbose)
preds = preds.squeeze(0)
preds = preds * (x_std + 1e-5) + x_mean
pred_df = pd.DataFrame(preds, columns=self.price_cols + [self.vol_col, self.amt_vol], index=y_timestamp)
return pred_df
def predict_batch(self, df_list, x_timestamp_list, y_timestamp_list, pred_len, T=1.0, top_k=0, top_p=0.9, sample_count=1, verbose=True):
"""
Perform parallel (batch) prediction on multiple time series. All series must have the same historical length and prediction length (pred_len).
Args:
df_list (List[pd.DataFrame]): List of input DataFrames, each containing price columns and optional volume/amount columns.
x_timestamp_list (List[pd.DatetimeIndex or Series]): List of timestamps corresponding to historical data, length should match the number of rows in each DataFrame.
y_timestamp_list (List[pd.DatetimeIndex or Series]): List of future prediction timestamps, length should equal pred_len.
pred_len (int): Number of prediction steps.
T (float): Sampling temperature.
top_k (int): Top-k filtering threshold.
top_p (float): Top-p (nucleus sampling) threshold.
sample_count (int): Number of parallel samples per series, automatically averaged internally.
verbose (bool): Whether to display autoregressive progress.
Returns:
List[pd.DataFrame]: List of prediction results in the same order as input, each DataFrame contains
`open, high, low, close, volume, amount` columns, indexed by corresponding `y_timestamp`.
"""
# Basic validation
if not isinstance(df_list, (list, tuple)) or not isinstance(x_timestamp_list, (list, tuple)) or not isinstance(y_timestamp_list, (list, tuple)):
raise ValueError("df_list, x_timestamp_list, y_timestamp_list must be list or tuple types.")
if not (len(df_list) == len(x_timestamp_list) == len(y_timestamp_list)):
raise ValueError("df_list, x_timestamp_list, y_timestamp_list must have consistent lengths.")
num_series = len(df_list)
x_list = []
x_stamp_list = []
y_stamp_list = []
means = []
stds = []
seq_lens = []
y_lens = []
for i in range(num_series):
df = df_list[i]
if not isinstance(df, pd.DataFrame):
raise ValueError(f"Input at index {i} is not a pandas DataFrame.")
if not all(col in df.columns for col in self.price_cols):
raise ValueError(f"DataFrame at index {i} is missing price columns {self.price_cols}.")
df = df.copy()
if self.vol_col not in df.columns:
df[self.vol_col] = 0.0
df[self.amt_vol] = 0.0
if self.amt_vol not in df.columns and self.vol_col in df.columns:
df[self.amt_vol] = df[self.vol_col] * df[self.price_cols].mean(axis=1)
if df[self.price_cols + [self.vol_col, self.amt_vol]].isnull().values.any():
raise ValueError(f"DataFrame at index {i} contains NaN values in price or volume columns.")
x_timestamp = x_timestamp_list[i]
y_timestamp = y_timestamp_list[i]
x_time_df = calc_time_stamps(x_timestamp)
y_time_df = calc_time_stamps(y_timestamp)
x = df[self.price_cols + [self.vol_col, self.amt_vol]].values.astype(np.float32)
x_stamp = x_time_df.values.astype(np.float32)
y_stamp = y_time_df.values.astype(np.float32)
if x.shape[0] != x_stamp.shape[0]:
raise ValueError(f"Inconsistent lengths at index {i}: x has {x.shape[0]} vs x_stamp has {x_stamp.shape[0]}.")
if y_stamp.shape[0] != pred_len:
raise ValueError(f"y_timestamp length at index {i} should equal pred_len={pred_len}, got {y_stamp.shape[0]}.")
x_mean, x_std = np.mean(x, axis=0), np.std(x, axis=0)
x_norm = (x - x_mean) / (x_std + 1e-5)
x_norm = np.clip(x_norm, -self.clip, self.clip)
x_list.append(x_norm)
x_stamp_list.append(x_stamp)
y_stamp_list.append(y_stamp)
means.append(x_mean)
stds.append(x_std)
seq_lens.append(x_norm.shape[0])
y_lens.append(y_stamp.shape[0])
# Require all series to have consistent historical and prediction lengths for batch processing
if len(set(seq_lens)) != 1:
raise ValueError(f"Parallel prediction requires all series to have consistent historical lengths, got: {seq_lens}")
if len(set(y_lens)) != 1:
raise ValueError(f"Parallel prediction requires all series to have consistent prediction lengths, got: {y_lens}")
x_batch = np.stack(x_list, axis=0).astype(np.float32) # (B, seq_len, feat)
x_stamp_batch = np.stack(x_stamp_list, axis=0).astype(np.float32) # (B, seq_len, time_feat)
y_stamp_batch = np.stack(y_stamp_list, axis=0).astype(np.float32) # (B, pred_len, time_feat)
preds = self.generate(x_batch, x_stamp_batch, y_stamp_batch, pred_len, T, top_k, top_p, sample_count, verbose)
# preds: (B, pred_len, feat)
pred_dfs = []
for i in range(num_series):
preds_i = preds[i] * (stds[i] + 1e-5) + means[i]
pred_df = pd.DataFrame(preds_i, columns=self.price_cols + [self.vol_col, self.amt_vol], index=y_timestamp_list[i])
pred_dfs.append(pred_df)
return pred_dfs
================================================
FILE: utils/model/module.py
================================================
import math
from einops import rearrange, reduce
import torch
import torch.nn as nn
from torch.autograd import Function
import torch.nn.functional as F
class DifferentiableEntropyFunction(Function):
@staticmethod
def forward(ctx, zq, basis, K, eps):
zb = (zq + 1) / 2
zi = ((zb * basis).sum(-1)).to(torch.int64)
cnt = torch.scatter_reduce(torch.zeros(2 ** K, device=zq.device, dtype=zq.dtype),
0,
zi.flatten(),
torch.ones_like(zi.flatten()).to(zq.dtype),
'sum')
prob = (cnt + eps) / (cnt + eps).sum()
H = -(prob * torch.log(prob)).sum()
ctx.save_for_backward(zq, zi, prob)
ctx.K = K
return H
@staticmethod
def backward(ctx, grad_output):
zq, zi, prob = ctx.saved_tensors
grad_array = -grad_output * (torch.log(prob) + 1) / zi.numel() / ctx.K
reord_grad = grad_array[zi.flatten()].reshape(zi.shape)
grad_input = reord_grad.unsqueeze(-1) * zq
return grad_input, None, None, None, None
def codebook_entropy(zq, basis, K, eps=1e-4):
return DifferentiableEntropyFunction.apply(zq, basis, K, eps)
class BinarySphericalQuantizer(nn.Module):
def __init__(self, embed_dim, beta, gamma0, gamma, zeta,
input_format='bchw',
soft_entropy=True, group_size=9,
persample_entropy_compute='analytical',
cb_entropy_compute='group',
l2_norm=True,
inv_temperature=1):
"""
Paper link: https://arxiv.org/pdf/2406.07548.pdf
Here we use the official implementation of the BinarySphericalQuantizer.
"""
super().__init__()
self.embed_dim = embed_dim
self.beta = beta # loss weight for commit loss
self.gamma0 = gamma0 # loss weight for entropy penalty
self.gamma = gamma # loss weight for entropy penalty
self.zeta = zeta # loss weight for entire entropy penalty
self.input_format = input_format
assert self.embed_dim % group_size == 0, "embed_dim must be divisible by group_size"
self.num_groups = self.embed_dim // group_size
self.group_size = group_size
assert persample_entropy_compute in ['group', 'analytical'], "persample_entropy_compute must be either 'group' or 'analytical'"
assert cb_entropy_compute in ['group', 'nce'], "cb_entropy_compute must be either 'group' or 'nce'"
self.persample_entropy_compute = persample_entropy_compute
self.cb_entropy_compute = cb_entropy_compute
self.l2_norm = l2_norm
self.inv_temperature = inv_temperature
self.register_buffer('basis', 2 ** torch.arange(embed_dim - 1, -1, -1))
self.register_buffer('group_basis', 2 ** torch.arange(group_size - 1, -1, -1))
self.num_dimensions = 2 ** embed_dim
self.bits_per_index = embed_dim
# we only need to keep the codebook portion up to the group size
# because we approximate the H loss with this subcode
group_codes = torch.arange(2 ** self.group_size)
group_codebook = self.indexes_to_codes(group_codes).float()[:, -group_size:]
self.register_buffer('group_codebook', group_codebook, persistent=False)
self.soft_entropy = soft_entropy # soft_entropy: Sec 3.2 of https://arxiv.org/pdf/1911.05894.pdf
def quantize(self, z):
assert z.shape[-1] == self.embed_dim, f"Expected {self.embed_dim} dimensions, got {z.shape[-1]}"
zhat = torch.where(z > 0,
torch.tensor(1, dtype=z.dtype, device=z.device),
torch.tensor(-1, dtype=z.dtype, device=z.device))
return z + (zhat - z).detach()
def forward(self, z):
# if self.input_format == 'bchw':
# z = rearrange(z, 'b c h w -> b h w c')
zq = self.quantize(z)
indices = self.codes_to_indexes(zq.detach())
group_indices = self.codes_to_group_indexes(zq.detach())
if not self.training:
used_codes = torch.unique(indices, return_counts=False)
else:
used_codes = None
q_scale = 1. / (self.embed_dim ** 0.5) if self.l2_norm else 1.
if self.soft_entropy:
persample_entropy, cb_entropy, avg_prob = self.soft_entropy_loss(z)
entropy_penalty = self.gamma0 * persample_entropy - self.gamma * cb_entropy
else:
zb_by_sample = ((zq + 1) / 2).reshape(z.shape[0], -1, z.shape[-1]).to(torch.float32)
persample_entropy = self.get_hard_per_sample_entropy(zb_by_sample)
cb_entropy = codebook_entropy(zq, self.basis, self.embed_dim)
entropy_penalty = self.gamma0 * persample_entropy - self.gamma * cb_entropy
zq = zq * q_scale
# commit loss
commit_loss = self.beta * torch.mean(((zq.detach() - z) ** 2).sum(dim=-1))
# if self.input_format == 'bchw':
# zq = rearrange(zq, 'b h w c -> b c h w')
return (
zq,
commit_loss + self.zeta * entropy_penalty / self.inv_temperature,
{"H": cb_entropy, "used_codes": used_codes, "indices": indices, "group_indices": group_indices,
"avg_prob": avg_prob}
)
def soft_entropy_loss(self, z):
# if we divide the code in subgroups of size group_size, the codebook will be of size 2 ** group_size
# the sub-code is the last group_size bits of the full code
group_code_book = self.group_codebook / (self.embed_dim ** 0.5 if self.l2_norm else 1)
divided_z = rearrange(z, '... (g c) -> ... g c', c=self.group_size)
# we calculate the distance between the divided_z and the codebook for each subgroup
distance = - 2 * torch.einsum('... g c, d c ->... g d', divided_z, group_code_book)
prob = (-distance * self.inv_temperature).softmax(dim=-1)
if self.persample_entropy_compute == 'analytical':
if self.l2_norm:
p = torch.sigmoid(-4 * z / (self.embed_dim ** 0.5) * self.inv_temperature)
else:
p = torch.sigmoid(-4 * z * self.inv_temperature)
prob = torch.stack([p, 1 - p], dim=-1)
per_sample_entropy = self.get_entropy(prob, dim=-1, normalize=False).sum(dim=-1).mean()
else:
per_sample_entropy = self.get_entropy(prob, dim=-1, normalize=False).sum(dim=-1).mean()
# macro average of the probability of each subgroup
avg_prob = reduce(prob, '... g d ->g d', 'mean')
codebook_entropy = self.get_entropy(avg_prob, dim=-1, normalize=False)
# the approximation of the entropy is the sum of the entropy of each subgroup
return per_sample_entropy, codebook_entropy.sum(), avg_prob
def get_hard_per_sample_entropy(self, zb_by_sample):
probs_per_dim = zb_by_sample.sum(1) / zb_by_sample.shape[1]
persample_entropy = - probs_per_dim * torch.log(probs_per_dim + 1e-8) - (1 - probs_per_dim) * torch.log(1 - probs_per_dim + 1e-8)
persample_entropy = persample_entropy.sum(-1)
return persample_entropy.mean()
def codes_to_indexes(self, zhat):
"""Converts a `code` to an index in the codebook.
Args:
zhat: A tensor of shape (B, ..., C) containing the codes. must be in {-1, 1}
"""
assert zhat.shape[-1] == self.embed_dim, f"Expected {self.embed_dim} dimensions, got {zhat.shape[-1]}"
return ((zhat + 1) / 2 * self.basis).sum(axis=-1).to(torch.int64)
def codes_to_group_indexes(self, zhat):
"""Converts a `code` to a list of indexes (in groups) in the codebook.
Args:
zhat: A tensor of shape (B, ..., C) containing the codes. must be in {-1, 1}
"""
zhat_in_group = rearrange(zhat, 'b ... (g c) -> b ... g c', c=self.group_size)
return ((zhat_in_group + 1) / 2 * self.group_basis).sum(axis=-1).to(torch.int64)
def indexes_to_codes(self, indices):
"""Inverse of `indexes_to_codes`."""
indices = indices.unsqueeze(-1)
codes_non_centered = torch.remainder(
torch.floor_divide(indices, self.basis), 2
)
return codes_non_centered * 2 - 1
def group_indexes_to_codes(self, group_indices):
"""Inverse of `group_indexes_to_codes`."""
group_indices = group_indices.unsqueeze(-1)
codes_non_centered = torch.remainder(
torch.floor_divide(group_indices, self.group_basis), 2
)
codes_non_centered = rearrange(codes_non_centered, 'b ... g c -> b ... (g c)')
return codes_non_centered * 2 - 1
def get_entropy(self, count, dim=-1, eps=1e-4, normalize=True):
if normalize:
probs = (count + eps) / (count + eps).sum(dim=dim, keepdim=True)
else:
probs = count
H = -(probs * torch.log(probs + 1e-8)).sum(dim=dim)
return H
def get_group_codebook_entry(self, group_indices):
z_q = self.group_indexes_to_codes(group_indices)
q_scale = 1. / (self.embed_dim ** 0.5) if self.l2_norm else 1.
z_q = z_q * q_scale
if self.input_format == 'bchw':
h, w = int(z_q.shape[1] ** 0.5)
assert h * w == z_q.shape[1], 'Invalid sequence length'
z_q = rearrange(z_q, 'b (h w) c -> b c h w', h=h)
return z_q
def get_codebook_entry(self, indices):
z_q = self.indexes_to_codes(indices)
q_scale = 1. / (self.embed_dim ** 0.5) if self.l2_norm else 1.
z_q = z_q * q_scale
if self.input_format == 'bchw':
h, w = int(z_q.shape[1] ** 0.5)
assert h * w == z_q.shape[1], 'Invalid sequence length'
z_q = rearrange(z_q, 'b (h w) c -> b c h w', h=h)
return z_q
class BSQuantizer(nn.Module):
def __init__(self, s1_bits, s2_bits, beta, gamma0, gamma, zeta, group_size):
super().__init__()
self.codebook_dim = s1_bits + s2_bits
self.s1_bits = s1_bits
self.s2_bits = s2_bits
self.bsq = BinarySphericalQuantizer(self.codebook_dim, beta, gamma0, gamma, zeta, group_size=group_size)
def bits_to_indices(self, bits):
bits = (bits >= 0).to(torch.long)
indices = 2 ** torch.arange(
0,
bits.shape[-1],
1,
dtype=torch.long,
device=bits.device,
)
return (bits * indices).sum(-1)
def forward(self, z, half=False):
z = F.normalize(z, dim=-1)
quantized, bsq_loss, metrics = self.bsq(z)
if half:
q_pre = quantized[:, :, :self.s1_bits]
q_post = quantized[:, :, self.s1_bits:]
z_indices = [self.bits_to_indices(q_pre), self.bits_to_indices(q_post)]
else:
z_indices = self.bits_to_indices(quantized)
return bsq_loss, quantized, z_indices
class RMSNorm(torch.nn.Module):
def __init__(self, dim: int, eps: float = 1e-5):
super().__init__()
self.eps = eps
self.weight = nn.Parameter(torch.ones(dim))
def _norm(self, x):
return x * torch.rsqrt(torch.mean(x * x, dim=-1, keepdim=True) + self.eps)
def forward(self, x):
output = self._norm(x.float()).type_as(x)
return output * self.weight
class FeedForward(nn.Module):
def __init__(self, d_model, ff_dim, ffn_dropout_p=0.0):
super().__init__()
self.w1 = nn.Linear(d_model, ff_dim, bias=False)
self.w3 = nn.Linear(d_model, ff_dim, bias=False)
self.w2 = nn.Linear(ff_dim, d_model, bias=False)
self.ffn_dropout = nn.Dropout(ffn_dropout_p)
def forward(self, x):
return self.ffn_dropout(self.w2(F.silu(self.w1(x)) * self.w3(x)))
class RotaryPositionalEmbedding(nn.Module):
def __init__(self, dim):
super().__init__()
inv_freq = 1.0 / (10000 ** (torch.arange(0, dim, 2).float() / dim))
self.register_buffer("inv_freq", inv_freq)
self.seq_len_cached = None
self.cos_cached = None
self.sin_cached = None
def _update_cos_sin_cache(self, x, seq_len):
if seq_len != self.seq_len_cached:
self.seq_len_cached = seq_len
t = torch.arange(seq_len, device=x.device).type_as(self.inv_freq)
freqs = torch.einsum('i,j->ij', t, self.inv_freq)
emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
self.cos_cached = emb.cos()[None, None, :, :]
self.sin_cached = emb.sin()[None, None, :, :]
return self.cos_cached, self.sin_cached
def forward(self, q, k):
cos, sin = self._update_cos_sin_cache(q, q.shape[-2])
return (
(q * cos) + (self._rotate_half(q) * sin),
(k * cos) + (self._rotate_half(k) * sin),
)
def _rotate_half(self, x):
x1, x2 = x.chunk(2, dim=-1)
return torch.cat((-x2, x1), dim=-1)
def scaled_dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, scale=None) -> torch.Tensor:
L, S = query.size(-2), key.size(-2)
scale_factor = 1 / math.sqrt(query.size(-1)) if scale is None else scale
attn_bias = torch.zeros(L, S, dtype=query.dtype).to(query.device)
if is_causal:
assert attn_mask is None
temp_mask = torch.ones(L, S, dtype=torch.bool).tril(diagonal=0).to(query.device)
attn_bias.masked_fill_(temp_mask.logical_not(), float("-inf"))
attn_bias.to(query.dtype)
attn_weight = query @ key.transpose(-2, -1) * scale_factor
attn_weight += attn_bias
if attn_mask is not None:
attn_mask_bias = torch.zeros_like(attn_weight)
if attn_mask.dtype == torch.bool:
attn_mask_bias.masked_fill_(attn_mask, float("-inf"))
else:
attn_mask_bias += attn_mask
attn_weight += attn_mask_bias
attn_weight = torch.softmax(attn_weight, dim=-1)
attn_weight = torch.dropout(attn_weight, dropout_p, train=True)
return attn_weight @ value
class MultiHeadAttentionWithRoPE(nn.Module):
def __init__(self, d_model, n_heads, attn_dropout_p=0.0, resid_dropout_p=0.0):
super().__init__()
self.d_model = d_model
self.n_heads = n_heads
self.head_dim = d_model // n_heads
self.q_proj = nn.Linear(d_model, d_model)
self.k_proj = nn.Linear(d_model, d_model)
self.v_proj = nn.Linear(d_model, d_model)
self.out_proj = nn.Linear(d_model, d_model)
self.rotary = RotaryPositionalEmbedding(self.head_dim)
self.attn_dropout_p = attn_dropout_p
self.resid_dropout = nn.Dropout(resid_dropout_p)
def forward(self, x, key_padding_mask=None):
batch_size, seq_len, _ = x.shape
q = self.q_proj(x).view(batch_size, seq_len, self.n_heads, self.head_dim).transpose(1, 2)
k = self.k_proj(x).view(batch_size, seq_len, self.n_heads, self.head_dim).transpose(1, 2)
v = self.v_proj(x).view(batch_size, seq_len, self.n_heads, self.head_dim).transpose(1, 2)
q, k = self.rotary(q, k)
if key_padding_mask is not None:
attn_mask = key_padding_mask.unsqueeze(1).unsqueeze(2) # [batch, 1, 1, seq_len]
attn_mask = attn_mask.expand(-1, self.n_heads, seq_len, -1) # [batch, n_heads, q_len, k_len]
else:
attn_mask = None
attn_output = scaled_dot_product_attention(
q, k, v,
attn_mask=attn_mask,
dropout_p=self.attn_dropout_p,
is_causal=True
)
attn_output = attn_output.transpose(1, 2).contiguous().view(batch_size, seq_len, self.d_model)
return self.resid_dropout(self.out_proj(attn_output))
class MultiHeadCrossAttentionWithRoPE(nn.Module):
def __init__(self, d_model, n_heads, attn_dropout_p=0.0, resid_dropout=0.0):
super().__init__()
self.d_model = d_model
self.n_heads = n_heads
self.head_dim = d_model // n_heads
self.q_proj = nn.Linear(d_model, d_model)
self.k_proj = nn.Linear(d_model, d_model)
self.v_proj = nn.Linear(d_model, d_model)
self.out_proj = nn.Linear(d_model, d_model)
self.rotary = RotaryPositionalEmbedding(self.head_dim)
self.attn_dropout_p = attn_dropout_p
self.resid_dropout = nn.Dropout(resid_dropout)
def forward(self, query, key, value, key_padding_mask=None):
batch_size, q_len, _ = query.shape
_, seq_len, _ = key.shape
q = self.q_proj(query).view(batch_size, q_len, self.n_heads, self.head_dim).transpose(1, 2)
k = self.k_proj(key).view(batch_size, seq_len, self.n_heads, self.head_dim).transpose(1, 2)
v = self.v_proj(value).view(batch_size, seq_len, self.n_heads, self.head_dim).transpose(1, 2)
q, k = self.rotary(q, k)
if key_padding_mask is not None:
attn_mask = key_padding_mask.unsqueeze(1).unsqueeze(2)
attn_mask = attn_mask.expand(-1, self.n_heads, q_len, -1)
else:
attn_mask = None
is_causal_flag = self.training
attn_output = scaled_dot_product_attention(
q, k, v,
attn_mask=attn_mask,
dropout_p=self.attn_dropout_p,
is_causal=is_causal_flag
)
attn_output = attn_output.transpose(1, 2).contiguous().view(batch_size, q_len, self.d_model)
return self.resid_dropout(self.out_proj(attn_output))
class HierarchicalEmbedding(nn.Module):
def __init__(self, s1_bits, s2_bits, d_model=256):
super().__init__()
self.s1_bits = s1_bits
self.s2_bits = s2_bits
vocab_s1 = 2 ** s1_bits
vocab_s2 = 2 ** s2_bits
self.emb_s1 = nn.Embedding(vocab_s1, d_model)
self.emb_s2 = nn.Embedding(vocab_s2, d_model)
self.d_model = d_model
self.fusion_proj = nn.Linear(d_model * 2, d_model)
nn.init.normal_(self.emb_s1.weight, mean=0, std=d_model ** -0.5)
nn.init.normal_(self.emb_s2.weight, mean=0, std=d_model ** -0.5)
def forward(self, token_ids):
"""Inputs:
token_ids: [batch_size, seq_len] token ID
Output: [batch_size, seq_len, d_model]
"""
if isinstance(token_ids, tuple) or isinstance(token_ids, list):
s1_ids, s2_ids = token_ids
else:
s1_ids, s2_ids = self.split_token(token_ids, self.s2_bits)
s1_emb = self.emb_s1(s1_ids) * math.sqrt(self.d_model)
s2_emb = self.emb_s2(s2_ids) * math.sqrt(self.d_model)
return self.fusion_proj(torch.cat([s1_emb, s2_emb], dim=-1))
class DependencyAwareLayer(nn.Module):
def __init__(self, d_model, n_heads=4, attn_dropout_p=0.0, resid_dropout=0.0):
super().__init__()
self.cross_attn = MultiHeadCrossAttentionWithRoPE(d_model, n_heads, attn_dropout_p, resid_dropout)
self.norm = RMSNorm(d_model)
def forward(self, hidden_states, sibling_embed, key_padding_mask=None):
"""hidden_states: [batch, seq_len, d_model]
sibling_embed: Embedding from another subtoken
"""
attn_out = self.cross_attn(
query=sibling_embed,
key=hidden_states,
value=hidden_states,
key_padding_mask=key_padding_mask
)
return self.norm(hidden_states + attn_out)
class TransformerBlock(nn.Module):
def __init__(self, d_model, n_heads, ff_dim=1024, ffn_dropout_p=0.0, attn_dropout_p=0.0, resid_dropout_p=0.0):
super().__init__()
self.norm1 = RMSNorm(d_model)
self.self_attn = MultiHeadAttentionWithRoPE(d_model, n_heads, attn_dropout_p, resid_dropout_p)
self.norm2 = RMSNorm(d_model)
self.ffn = FeedForward(d_model, ff_dim, ffn_dropout_p)
def forward(self, x, key_padding_mask=None):
residual = x
x = self.norm1(x)
attn_out = self.self_attn(x, key_padding_mask=key_padding_mask)
x = residual + attn_out
residual = x
x = self.norm2(x)
ffn_out = self.ffn(x)
x = residual + ffn_out
return x
class DualHead(nn.Module):
def __init__(self, s1_bits, s2_bits, d_model):
super().__init__()
self.vocab_s1 = 2 ** s1_bits
self.vocab_s2 = 2 ** s2_bits
self.proj_s1 = nn.Linear(d_model, self.vocab_s1)
self.proj_s2 = nn.Linear(d_model, self.vocab_s2)
def compute_loss(self, s1_logits, s2_logits, s1_targets, s2_targets, padding_mask=None):
if padding_mask is not None:
valid_mask = (padding_mask == 0)
s1_logits = s1_logits[valid_mask]
s2_logits = s2_logits[valid_mask]
s1_targets = s1_targets[valid_mask]
s2_targets = s2_targets[valid_mask]
ce_s1 = F.cross_entropy(s1_logits, s1_targets)
ce_s2 = F.cross_entropy(s2_logits, s2_targets)
else:
ce_s1 = F.cross_entropy(s1_logits.reshape(-1, self.vocab_s1), s1_targets.reshape(-1))
ce_s2 = F.cross_entropy(s2_logits.reshape(-1, self.vocab_s2), s2_targets.reshape(-1))
ce_loss = (ce_s1 + ce_s2) / 2
return ce_loss, ce_s1, ce_s2
def forward(self, x):
return self.proj_s1(x)
def cond_forward(self, x2):
return self.proj_s2(x2)
class FixedEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(FixedEmbedding, self).__init__()
w = torch.zeros(c_in, d_model).float()
w.require_grad = False
position = torch.arange(0, c_in).float().unsqueeze(1)
div_term = (torch.arange(0, d_model, 2).float() * -(math.log(10000.0) / d_model)).exp()
w[:, 0::2] = torch.sin(position * div_term)
w[:, 1::2] = torch.cos(position * div_term)
self.emb = nn.Embedding(c_in, d_model)
self.emb.weight = nn.Parameter(w, requires_grad=False)
def forward(self, x):
return self.emb(x).detach()
class TemporalEmbedding(nn.Module):
def __init__(self, d_model, learn_pe):
super(TemporalEmbedding, self).__init__()
minute_size = 60
hour_size = 24
weekday_size = 7
day_size = 32
month_size = 13
Embed = FixedEmbedding if not learn_pe else nn.Embedding
self.minute_embed = Embed(minute_size, d_model)
self.hour_embed = Embed(hour_size, d_model)
self.weekday_embed = Embed(weekday_size, d_model)
self.day_embed = Embed(day_size, d_model)
self.month_embed = Embed(month_size, d_model)
def forward(self, x):
x = x.long()
minute_x = self.minute_embed(x[:, :, 0])
hour_x = self.hour_embed(x[:, :, 1])
weekday_x = self.weekday_embed(x[:, :, 2])
day_x = self.day_embed(x[:, :, 3])
month_x = self.month_embed(x[:, :, 4])
return hour_x + weekday_x + day_x + month_x + minute_x
================================================
FILE: utils/my_logger.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging
from utils.read_config import *
def get_my_logger(logger_name='main'):
logger = logging.getLogger(logger_name)
if logger.handlers:
return logger
log_file = os.path.join(app_dir.user_log_dir, '{}.log'.format(logger_name))
if not os.path.exists(app_dir.user_log_dir):
os.makedirs(app_dir.user_log_dir)
formatter = logging.Formatter(config.get('LOG', 'format',
fallback="%(asctime)s %(name)s [%(levelname)s] %(message)s"))
file_handler = logging.FileHandler(log_file, encoding='utf-8')
file_handler.setFormatter(formatter)
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
logger.setLevel(config.get('LOG', 'level', fallback='ERROR'))
logger.addHandler(file_handler)
logger.addHandler(console_handler)
return logger
================================================
FILE: utils/read_config.py
================================================
# coding=utf-8
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import sys
import os
import copy
import xml.etree.ElementTree as ET
import configparser
from configparser import MissingSectionHeaderError
from appdirs import AppDirs
import yaml
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_CONFIG_DATA = {
'trade': {
'command_timeout': 5,
'ignore_inst': '',
'transport': 'native',
},
'ctp_native': {
'gateway': 'pybind',
'module': 'ctp_bridge_native',
'client_class': 'CtpClient',
'module_path': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'build').replace('\\', '/'),
'dll_dir': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'api', 'win').replace('\\', '/'),
'trade_front': 'tcp://xxx:xxx',
'market_front': 'tcp://xxx:xxx',
'broker_id': '9999',
'investor_id': '123456',
'password': 'passwd',
'appid': 'xxx',
'authcode': 'xxx',
'userinfo': 'xxx',
'flow_path': os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'flow').replace('\\', '/'),
'request_timeout_ms': 10000,
'test_instrument': 'IF99',
},
'log': {
'level': 'DEBUG',
'format': '%(asctime)s %(name)s [%(levelname)s] %(message)s',
'weixin_level': 'INFO',
'weixin_format': '[%(levelname)s] %(message)s',
},
'host': {
'ip': '1.2.3.4',
'mac': '02:03:04:5a:6b:7c',
},
'ssh_tunnel': {
'enabled': False,
'host': '127.0.0.1',
'port': 22,
'local_node': 'localhost',
'private_key_linux': '/root/.ssh/id_ed25519',
'private_key_win': 'C:\\Users\\timer\\.ssh\\id_ed25519.ppk',
},
'weixin': {
'Token': '',
'EncodingAESKey': '',
'CorpID': '',
'Secret': '',
},
}
app_dir = AppDirs('trader')
root_yaml_file = os.path.join(REPO_ROOT, 'config.yaml')
root_ini_file = os.path.join(REPO_ROOT, 'config.ini')
def _deep_merge_dict(base: dict, override: dict) -> dict:
merged = copy.deepcopy(base)
for key, value in override.items():
if isinstance(value, dict) and isinstance(merged.get(key), dict):
merged[key] = _deep_merge_dict(merged[key], value)
else:
merged[key] = value
return merged
def _normalize_yaml_data(data: dict | None) -> dict:
if not isinstance(data, dict):
return {}
normalized = {}
for section, section_values in data.items():
section_name = str(section).strip().lower()
if not section_name or not isinstance(section_values, dict):
continue
normalized[section_name] = {}
for key, value in section_values.items():
normalized[section_name][str(key).strip()] = value
return normalized
def _load_ini_data(path: str) -> dict:
parser = configparser.ConfigParser(interpolation=None)
try:
try:
parser.read(path, encoding='utf-8')
except UnicodeDecodeError:
parser.read(path, encoding='gb18030')
if parser.sections():
out = {}
for section in parser.sections():
out[section.lower()] = {k: v for k, v in parser.items(section)}
return out
except MissingSectionHeaderError:
pass
raw = {}
with open(path, 'rt', encoding='utf-8', errors='ignore') as file_obj:
for line in file_obj:
s = line.strip()
if not s or s.startswith(';') or s.startswith('#') or '=' not in s:
continue
key, value = s.split('=', 1)
raw[key.strip()] = value.strip()
mapped = copy.deepcopy(DEFAULT_CONFIG_DATA)
ctp_mapping = {
'trade': 'trade_front',
'market': 'market_front',
'broker': 'broker_id',
'investor': 'investor_id',
'passwd': 'password',
'appid': 'appid',
'authcode': 'authcode',
'userinfo': 'userinfo',
'module_path': 'module_path',
}
for src_key, dst_key in ctp_mapping.items():
if src_key in raw:
mapped['ctp_native'][dst_key] = raw[src_key]
if 'ip' in raw:
mapped['host']['ip'] = raw['ip']
if 'mac' in raw:
mapped['host']['mac'] = raw['mac']
return mapped
def _write_yaml(path: str, data: dict):
with open(path, 'wt', encoding='utf-8') as file_obj:
yaml.safe_dump(data, file_obj, allow_unicode=True, sort_keys=False)
def _ensure_yaml_config() -> tuple[str, dict]:
if os.path.exists(root_yaml_file):
with open(root_yaml_file, 'rt', encoding='utf-8') as file_obj:
yaml_data = yaml.safe_load(file_obj) or {}
return root_yaml_file, _normalize_yaml_data(yaml_data)
if os.path.exists(root_ini_file):
ini_data = _load_ini_data(root_ini_file)
merged = _deep_merge_dict(DEFAULT_CONFIG_DATA, _normalize_yaml_data(ini_data))
_write_yaml(root_yaml_file, merged)
print('migrate config file:', root_ini_file, '->', root_yaml_file)
return root_yaml_file, merged
_write_yaml(root_yaml_file, DEFAULT_CONFIG_DATA)
print('create config file:', root_yaml_file)
return root_yaml_file, copy.deepcopy(DEFAULT_CONFIG_DATA)
def _to_config_parser(data: dict) -> configparser.ConfigParser:
parser = configparser.ConfigParser(interpolation=None)
for section, section_values in data.items():
section_name = section.upper()
if not parser.has_section(section_name):
parser.add_section(section_name)
for key, value in section_values.items():
parser.set(section_name, key, '' if value is None else str(value))
return parser
config_file, _config_data = _ensure_yaml_config()
config = _to_config_parser(_config_data)
ctp_errors = {}
if os.name == 'nt':
ctp_xml_path = os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'api', 'win', 'error.xml')
else:
ctp_xml_path = os.path.join(REPO_ROOT, 'native', 'ctp_bridge', 'api', 'linux', 'error.xml')
with open(ctp_xml_path, 'rb') as f:
xml_text = f.read().decode('utf-8', errors='replace')
if xml_text.lstrip().startswith(' bool:
return bool(self._corp_id and self._secret)
def start(self):
if not self.enabled:
logger.info('企业微信推送未启用:缺少 weixin.CorpID 或 weixin.Secret')
return
_silence_http_library_debug_logs()
if self._thread and self._thread.is_alive():
return
self._thread = threading.Thread(target=self._run, name='weixin-notifier', daemon=True)
self._thread.start()
atexit.register(self.stop)
def stop(self):
self._stop_event.set()
if self._thread and self._thread.is_alive():
self._thread.join(timeout=2)
def enqueue(self, message: str):
if not self.enabled:
return
text = (message or '').strip()
if not text:
return
try:
self._queue.put_nowait(text)
except queue.Full:
try:
_ = self._queue.get_nowait()
except queue.Empty:
pass
try:
self._queue.put_nowait(text)
except queue.Full:
pass
def _run(self):
while not self._stop_event.is_set():
try:
message = self._queue.get(timeout=0.5)
except queue.Empty:
continue
try:
self._send_text(message)
except Exception as e:
logger.warning('企业微信消息发送失败: %s', repr(e), exc_info=True)
def _get_access_token(self) -> str:
now = time.time()
if self._token and now < self._token_expire_at - 60:
return self._token
resp = requests.get(
'https://qyapi.weixin.qq.com/cgi-bin/gettoken',
params={'corpid': self._corp_id, 'corpsecret': self._secret},
timeout=10,
)
data = resp.json()
err_code = data.get('errcode', -1)
if err_code != 0:
raise RuntimeError(f'gettoken failed: errcode={err_code}, errmsg={data.get("errmsg", "")!r}')
token = str(data.get('access_token', '') or '').strip()
if not token:
raise RuntimeError('gettoken failed: empty access_token')
self._token = token
expires_in = int(data.get('expires_in', 7200) or 7200)
self._token_expire_at = now + expires_in
return token
def _send_text(self, text: str):
token = self._get_access_token()
payload = {
'touser': self._to_user,
'msgtype': 'text',
'agentid': self._agent_id,
'text': {'content': text},
'safe': 0,
}
resp = requests.post(
f'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={token}',
data=orjson.dumps(payload),
headers={'Content-Type': 'application/json; charset=utf-8'},
timeout=10,
)
data = resp.json()
err_code = data.get('errcode', -1)
if err_code != 0:
raise RuntimeError(f'send message failed: errcode={err_code}, errmsg={data.get("errmsg", "")!r}')
class WeixinLogHandler(logging.Handler):
def __init__(self, notifier: WeixinNotifier):
super().__init__()
self._notifier = notifier
def emit(self, record: logging.LogRecord):
try:
self._notifier.enqueue(self.format(record))
except Exception:
self.handleError(record)
_notifier_singleton: Optional[WeixinNotifier] = None
def get_weixin_notifier() -> WeixinNotifier:
global _notifier_singleton
if _notifier_singleton is None:
_notifier_singleton = WeixinNotifier()
return _notifier_singleton
def install_weixin_log_handler(root_logger: logging.Logger):
notifier = get_weixin_notifier()
notifier.start()
if not notifier.enabled:
return
for handler in root_logger.handlers:
if isinstance(handler, WeixinLogHandler):
return
handler = WeixinLogHandler(notifier)
handler.setLevel(runtime_config.get('LOG', 'weixin_level', fallback='ERROR'))
handler.setFormatter(logging.Formatter(runtime_config.get('LOG', 'weixin_format', fallback='[%(levelname)s] %(message)s')))
root_logger.addHandler(handler)