vnpy/examples/notebook_trading/demo_notebook.ipynb
2019-07-02 17:53:35 +08:00

1897 lines
68 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"该Jupyter Notebook用于展示如何使用ScriptTraderApp模块在CLI命令行下进行交易指令的调用"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from vnpy.app.script_trader import init_cli_trading\n",
"from vnpy.gateway.oes import OesGateway"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2019-07-02 17:30:22.289718\t成功连接到行情服务器\n",
"2019-07-02 17:30:22.427419\t成功连接到交易服务器\n",
"2019-07-02 17:30:26.294755\t合约信息查询成功\n",
"2019-07-02 17:30:26.327959\t撤单失败订单号 1000107。原因无效的订单状态\n",
"2019-07-02 17:30:26.328936\t撤单失败订单号 1000115。原因未找到委托信息\n",
"2019-07-02 17:30:26.328936\t撤单失败订单号 1000117。原因无效的订单状态\n"
]
}
],
"source": [
"# 连接到服务器\n",
"setting = {\n",
" \"td_ord_server\": \"tcp://106.15.58.119:6101\",\n",
" \"td_rpt_server\": \"tcp://106.15.58.119:6301\",\n",
" \"td_qry_server\": \"tcp://106.15.58.119:6401\",\n",
" \"md_tcp_server\": \"tcp://139.196.228.232:5103\",\n",
" \"md_qry_server\": \"tcp://139.196.228.232:5203\",\n",
" \"username\": \"\",\n",
" \"password\": \"\",\n",
" \"hdd_serial\": \"\",\n",
" \"customize_ip\": \"\",\n",
" \"customize_mac\": \"\"\n",
"}\n",
"\n",
"engine = init_cli_trading([OesGateway])\n",
"engine.connect_gateway(setting, \"OES\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>exchange</th>\n",
" <th>gateway_name</th>\n",
" <th>history_data</th>\n",
" <th>min_volume</th>\n",
" <th>name</th>\n",
" <th>net_position</th>\n",
" <th>option_expiry</th>\n",
" <th>option_strike</th>\n",
" <th>option_type</th>\n",
" <th>option_underlying</th>\n",
" <th>pricetick</th>\n",
" <th>product</th>\n",
" <th>size</th>\n",
" <th>stop_supported</th>\n",
" <th>symbol</th>\n",
" <th>vt_symbol</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>21国债⑺</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010107</td>\n",
" <td>010107.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>03国债⑶</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010303</td>\n",
" <td>010303.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>05国债⑷</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010504</td>\n",
" <td>010504.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>05国债⑿</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010512</td>\n",
" <td>010512.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>06国债⑼</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010609</td>\n",
" <td>010609.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>06国债⒆</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010619</td>\n",
" <td>010619.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>07国债06</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010706</td>\n",
" <td>010706.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>07国债13</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>010713</td>\n",
" <td>010713.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>国开1401</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>018003</td>\n",
" <td>018003.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>国开1702</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>018006</td>\n",
" <td>018006.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>国开1801</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>018007</td>\n",
" <td>018007.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>国开1802</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>018008</td>\n",
" <td>018008.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>国开1803</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>018009</td>\n",
" <td>018009.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债02</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019002</td>\n",
" <td>019002.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债03</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019003</td>\n",
" <td>019003.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债07</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019007</td>\n",
" <td>019007.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债09</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019009</td>\n",
" <td>019009.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债12</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019012</td>\n",
" <td>019012.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债14</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019014</td>\n",
" <td>019014.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债18</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019018</td>\n",
" <td>019018.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债19</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019019</td>\n",
" <td>019019.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债23</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019023</td>\n",
" <td>019023.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债24</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019024</td>\n",
" <td>019024.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债26</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019026</td>\n",
" <td>019026.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债29</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019029</td>\n",
" <td>019029.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债31</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019031</td>\n",
" <td>019031.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债34</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019034</td>\n",
" <td>019034.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债37</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019037</td>\n",
" <td>019037.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债40</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019040</td>\n",
" <td>019040.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Exchange.SSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>10国债41</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>10</td>\n",
" <td>False</td>\n",
" <td>019041</td>\n",
" <td>019041.SSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16289</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>越博动力</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300742</td>\n",
" <td>300742.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16290</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>天地数码</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300743</td>\n",
" <td>300743.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16291</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>欣锐科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300745</td>\n",
" <td>300745.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16292</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>汉嘉设计</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300746</td>\n",
" <td>300746.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16293</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>锐科激光</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300747</td>\n",
" <td>300747.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16294</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>金力永磁</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300748</td>\n",
" <td>300748.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16295</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>顶固集创</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300749</td>\n",
" <td>300749.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16296</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>宁德时代</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300750</td>\n",
" <td>300750.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16297</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>迈为股份</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300751</td>\n",
" <td>300751.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16298</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>隆利科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300752</td>\n",
" <td>300752.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16299</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>爱朋医疗</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300753</td>\n",
" <td>300753.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16300</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>华致酒行</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300755</td>\n",
" <td>300755.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16301</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>中山金马</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300756</td>\n",
" <td>300756.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16302</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>罗博特科</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300757</td>\n",
" <td>300757.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16303</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>七彩化学</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300758</td>\n",
" <td>300758.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16304</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>康龙化成</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300759</td>\n",
" <td>300759.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16305</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>迈瑞医疗</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300760</td>\n",
" <td>300760.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16306</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>立华股份</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300761</td>\n",
" <td>300761.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16307</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>上海瀚讯</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300762</td>\n",
" <td>300762.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16308</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>锦浪科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300763</td>\n",
" <td>300763.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16309</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>新诺威</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300765</td>\n",
" <td>300765.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16310</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>每日互动</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300766</td>\n",
" <td>300766.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16311</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>震安科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300767</td>\n",
" <td>300767.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16312</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>迪普科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300768</td>\n",
" <td>300768.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16313</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>德方纳米</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300769</td>\n",
" <td>300769.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16314</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>新媒股份</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300770</td>\n",
" <td>300770.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16315</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>智莱科技</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300771</td>\n",
" <td>300771.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16316</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>运达股份</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300772</td>\n",
" <td>300772.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16317</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>拉卡拉</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>100</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>100</td>\n",
" <td>False</td>\n",
" <td>300773</td>\n",
" <td>300773.SZSE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16318</th>\n",
" <td>Exchange.SZSE</td>\n",
" <td>OES</td>\n",
" <td>False</td>\n",
" <td>100</td>\n",
" <td>标准券</td>\n",
" <td>True</td>\n",
" <td>None</td>\n",
" <td>0</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" <td>0</td>\n",
" <td>Product.EQUITY</td>\n",
" <td>0</td>\n",
" <td>False</td>\n",
" <td>131990</td>\n",
" <td>131990.SZSE</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>16319 rows × 16 columns</p>\n",
"</div>"
],
"text/plain": [
" exchange gateway_name history_data min_volume name \\\n",
"0 Exchange.SSE OES False 100 21国债⑺ \n",
"1 Exchange.SSE OES False 100 03国债⑶ \n",
"2 Exchange.SSE OES False 100 05国债⑷ \n",
"3 Exchange.SSE OES False 100 05国债⑿ \n",
"4 Exchange.SSE OES False 100 06国债⑼ \n",
"5 Exchange.SSE OES False 100 06国债⒆ \n",
"6 Exchange.SSE OES False 100 07国债06 \n",
"7 Exchange.SSE OES False 100 07国债13 \n",
"8 Exchange.SSE OES False 100 国开1401 \n",
"9 Exchange.SSE OES False 100 国开1702 \n",
"10 Exchange.SSE OES False 100 国开1801 \n",
"11 Exchange.SSE OES False 100 国开1802 \n",
"12 Exchange.SSE OES False 100 国开1803 \n",
"13 Exchange.SSE OES False 100 10国债02 \n",
"14 Exchange.SSE OES False 100 10国债03 \n",
"15 Exchange.SSE OES False 100 10国债07 \n",
"16 Exchange.SSE OES False 100 10国债09 \n",
"17 Exchange.SSE OES False 100 10国债12 \n",
"18 Exchange.SSE OES False 100 10国债14 \n",
"19 Exchange.SSE OES False 100 10国债18 \n",
"20 Exchange.SSE OES False 100 10国债19 \n",
"21 Exchange.SSE OES False 100 10国债23 \n",
"22 Exchange.SSE OES False 100 10国债24 \n",
"23 Exchange.SSE OES False 100 10国债26 \n",
"24 Exchange.SSE OES False 100 10国债29 \n",
"25 Exchange.SSE OES False 100 10国债31 \n",
"26 Exchange.SSE OES False 100 10国债34 \n",
"27 Exchange.SSE OES False 100 10国债37 \n",
"28 Exchange.SSE OES False 100 10国债40 \n",
"29 Exchange.SSE OES False 100 10国债41 \n",
"... ... ... ... ... ... \n",
"16289 Exchange.SZSE OES False 100 越博动力 \n",
"16290 Exchange.SZSE OES False 100 天地数码 \n",
"16291 Exchange.SZSE OES False 100 欣锐科技 \n",
"16292 Exchange.SZSE OES False 100 汉嘉设计 \n",
"16293 Exchange.SZSE OES False 100 锐科激光 \n",
"16294 Exchange.SZSE OES False 100 金力永磁 \n",
"16295 Exchange.SZSE OES False 100 顶固集创 \n",
"16296 Exchange.SZSE OES False 100 宁德时代 \n",
"16297 Exchange.SZSE OES False 100 迈为股份 \n",
"16298 Exchange.SZSE OES False 100 隆利科技 \n",
"16299 Exchange.SZSE OES False 100 爱朋医疗 \n",
"16300 Exchange.SZSE OES False 100 华致酒行 \n",
"16301 Exchange.SZSE OES False 100 中山金马 \n",
"16302 Exchange.SZSE OES False 100 罗博特科 \n",
"16303 Exchange.SZSE OES False 100 七彩化学 \n",
"16304 Exchange.SZSE OES False 100 康龙化成 \n",
"16305 Exchange.SZSE OES False 100 迈瑞医疗 \n",
"16306 Exchange.SZSE OES False 100 立华股份 \n",
"16307 Exchange.SZSE OES False 100 上海瀚讯 \n",
"16308 Exchange.SZSE OES False 100 锦浪科技 \n",
"16309 Exchange.SZSE OES False 100 新诺威 \n",
"16310 Exchange.SZSE OES False 100 每日互动 \n",
"16311 Exchange.SZSE OES False 100 震安科技 \n",
"16312 Exchange.SZSE OES False 100 迪普科技 \n",
"16313 Exchange.SZSE OES False 100 德方纳米 \n",
"16314 Exchange.SZSE OES False 100 新媒股份 \n",
"16315 Exchange.SZSE OES False 100 智莱科技 \n",
"16316 Exchange.SZSE OES False 100 运达股份 \n",
"16317 Exchange.SZSE OES False 100 拉卡拉 \n",
"16318 Exchange.SZSE OES False 100 标准券 \n",
"\n",
" net_position option_expiry option_strike option_type \\\n",
"0 True None 0 None \n",
"1 True None 0 None \n",
"2 True None 0 None \n",
"3 True None 0 None \n",
"4 True None 0 None \n",
"5 True None 0 None \n",
"6 True None 0 None \n",
"7 True None 0 None \n",
"8 True None 0 None \n",
"9 True None 0 None \n",
"10 True None 0 None \n",
"11 True None 0 None \n",
"12 True None 0 None \n",
"13 True None 0 None \n",
"14 True None 0 None \n",
"15 True None 0 None \n",
"16 True None 0 None \n",
"17 True None 0 None \n",
"18 True None 0 None \n",
"19 True None 0 None \n",
"20 True None 0 None \n",
"21 True None 0 None \n",
"22 True None 0 None \n",
"23 True None 0 None \n",
"24 True None 0 None \n",
"25 True None 0 None \n",
"26 True None 0 None \n",
"27 True None 0 None \n",
"28 True None 0 None \n",
"29 True None 0 None \n",
"... ... ... ... ... \n",
"16289 True None 0 None \n",
"16290 True None 0 None \n",
"16291 True None 0 None \n",
"16292 True None 0 None \n",
"16293 True None 0 None \n",
"16294 True None 0 None \n",
"16295 True None 0 None \n",
"16296 True None 0 None \n",
"16297 True None 0 None \n",
"16298 True None 0 None \n",
"16299 True None 0 None \n",
"16300 True None 0 None \n",
"16301 True None 0 None \n",
"16302 True None 0 None \n",
"16303 True None 0 None \n",
"16304 True None 0 None \n",
"16305 True None 0 None \n",
"16306 True None 0 None \n",
"16307 True None 0 None \n",
"16308 True None 0 None \n",
"16309 True None 0 None \n",
"16310 True None 0 None \n",
"16311 True None 0 None \n",
"16312 True None 0 None \n",
"16313 True None 0 None \n",
"16314 True None 0 None \n",
"16315 True None 0 None \n",
"16316 True None 0 None \n",
"16317 True None 0 None \n",
"16318 True None 0 None \n",
"\n",
" option_underlying pricetick product size stop_supported \\\n",
"0 100 Product.EQUITY 10 False \n",
"1 100 Product.EQUITY 10 False \n",
"2 100 Product.EQUITY 10 False \n",
"3 100 Product.EQUITY 10 False \n",
"4 100 Product.EQUITY 10 False \n",
"5 100 Product.EQUITY 10 False \n",
"6 100 Product.EQUITY 10 False \n",
"7 100 Product.EQUITY 10 False \n",
"8 100 Product.EQUITY 10 False \n",
"9 100 Product.EQUITY 10 False \n",
"10 100 Product.EQUITY 10 False \n",
"11 100 Product.EQUITY 10 False \n",
"12 100 Product.EQUITY 10 False \n",
"13 100 Product.EQUITY 10 False \n",
"14 100 Product.EQUITY 10 False \n",
"15 100 Product.EQUITY 10 False \n",
"16 100 Product.EQUITY 10 False \n",
"17 100 Product.EQUITY 10 False \n",
"18 100 Product.EQUITY 10 False \n",
"19 100 Product.EQUITY 10 False \n",
"20 100 Product.EQUITY 10 False \n",
"21 100 Product.EQUITY 10 False \n",
"22 100 Product.EQUITY 10 False \n",
"23 100 Product.EQUITY 10 False \n",
"24 100 Product.EQUITY 10 False \n",
"25 100 Product.EQUITY 10 False \n",
"26 100 Product.EQUITY 10 False \n",
"27 100 Product.EQUITY 10 False \n",
"28 100 Product.EQUITY 10 False \n",
"29 100 Product.EQUITY 10 False \n",
"... ... ... ... ... ... \n",
"16289 100 Product.EQUITY 100 False \n",
"16290 100 Product.EQUITY 100 False \n",
"16291 100 Product.EQUITY 100 False \n",
"16292 100 Product.EQUITY 100 False \n",
"16293 100 Product.EQUITY 100 False \n",
"16294 100 Product.EQUITY 100 False \n",
"16295 100 Product.EQUITY 100 False \n",
"16296 100 Product.EQUITY 100 False \n",
"16297 100 Product.EQUITY 100 False \n",
"16298 100 Product.EQUITY 100 False \n",
"16299 100 Product.EQUITY 100 False \n",
"16300 100 Product.EQUITY 100 False \n",
"16301 100 Product.EQUITY 100 False \n",
"16302 100 Product.EQUITY 100 False \n",
"16303 100 Product.EQUITY 100 False \n",
"16304 100 Product.EQUITY 100 False \n",
"16305 100 Product.EQUITY 100 False \n",
"16306 100 Product.EQUITY 100 False \n",
"16307 100 Product.EQUITY 100 False \n",
"16308 100 Product.EQUITY 100 False \n",
"16309 100 Product.EQUITY 100 False \n",
"16310 100 Product.EQUITY 100 False \n",
"16311 100 Product.EQUITY 100 False \n",
"16312 100 Product.EQUITY 100 False \n",
"16313 100 Product.EQUITY 100 False \n",
"16314 100 Product.EQUITY 100 False \n",
"16315 100 Product.EQUITY 100 False \n",
"16316 100 Product.EQUITY 100 False \n",
"16317 100 Product.EQUITY 100 False \n",
"16318 0 Product.EQUITY 0 False \n",
"\n",
" symbol vt_symbol \n",
"0 010107 010107.SSE \n",
"1 010303 010303.SSE \n",
"2 010504 010504.SSE \n",
"3 010512 010512.SSE \n",
"4 010609 010609.SSE \n",
"5 010619 010619.SSE \n",
"6 010706 010706.SSE \n",
"7 010713 010713.SSE \n",
"8 018003 018003.SSE \n",
"9 018006 018006.SSE \n",
"10 018007 018007.SSE \n",
"11 018008 018008.SSE \n",
"12 018009 018009.SSE \n",
"13 019002 019002.SSE \n",
"14 019003 019003.SSE \n",
"15 019007 019007.SSE \n",
"16 019009 019009.SSE \n",
"17 019012 019012.SSE \n",
"18 019014 019014.SSE \n",
"19 019018 019018.SSE \n",
"20 019019 019019.SSE \n",
"21 019023 019023.SSE \n",
"22 019024 019024.SSE \n",
"23 019026 019026.SSE \n",
"24 019029 019029.SSE \n",
"25 019031 019031.SSE \n",
"26 019034 019034.SSE \n",
"27 019037 019037.SSE \n",
"28 019040 019040.SSE \n",
"29 019041 019041.SSE \n",
"... ... ... \n",
"16289 300742 300742.SZSE \n",
"16290 300743 300743.SZSE \n",
"16291 300745 300745.SZSE \n",
"16292 300746 300746.SZSE \n",
"16293 300747 300747.SZSE \n",
"16294 300748 300748.SZSE \n",
"16295 300749 300749.SZSE \n",
"16296 300750 300750.SZSE \n",
"16297 300751 300751.SZSE \n",
"16298 300752 300752.SZSE \n",
"16299 300753 300753.SZSE \n",
"16300 300755 300755.SZSE \n",
"16301 300756 300756.SZSE \n",
"16302 300757 300757.SZSE \n",
"16303 300758 300758.SZSE \n",
"16304 300759 300759.SZSE \n",
"16305 300760 300760.SZSE \n",
"16306 300761 300761.SZSE \n",
"16307 300762 300762.SZSE \n",
"16308 300763 300763.SZSE \n",
"16309 300765 300765.SZSE \n",
"16310 300766 300766.SZSE \n",
"16311 300767 300767.SZSE \n",
"16312 300768 300768.SZSE \n",
"16313 300769 300769.SZSE \n",
"16314 300770 300770.SZSE \n",
"16315 300771 300771.SZSE \n",
"16316 300772 300772.SZSE \n",
"16317 300773 300773.SZSE \n",
"16318 131990 131990.SZSE \n",
"\n",
"[16319 rows x 16 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 查询所有合约\n",
"engine.get_all_contracts(use_df=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>accountid</th>\n",
" <th>available</th>\n",
" <th>balance</th>\n",
" <th>frozen</th>\n",
" <th>gateway_name</th>\n",
" <th>vt_accountid</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1888000315</td>\n",
" <td>10011029372761</td>\n",
" <td>10011029372761</td>\n",
" <td>0</td>\n",
" <td>OES</td>\n",
" <td>OES.1888000315</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" accountid available balance frozen gateway_name \\\n",
"0 1888000315 10011029372761 10011029372761 0 OES \n",
"\n",
" vt_accountid \n",
"0 OES.1888000315 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 查询资金\n",
"engine.get_all_accounts(use_df=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>direction</th>\n",
" <th>exchange</th>\n",
" <th>frozen</th>\n",
" <th>gateway_name</th>\n",
" <th>pnl</th>\n",
" <th>price</th>\n",
" <th>symbol</th>\n",
" <th>volume</th>\n",
" <th>vt_positionid</th>\n",
" <th>vt_symbol</th>\n",
" <th>yd_volume</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Direction.NET</td>\n",
" <td>Exchange.SSE</td>\n",
" <td>0</td>\n",
" <td>OES</td>\n",
" <td>0</td>\n",
" <td>4.1881</td>\n",
" <td>600010</td>\n",
" <td>296900</td>\n",
" <td>600010.SSE.Direction.NET</td>\n",
" <td>600010.SSE</td>\n",
" <td>1000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Direction.NET</td>\n",
" <td>Exchange.SSE</td>\n",
" <td>0</td>\n",
" <td>OES</td>\n",
" <td>0</td>\n",
" <td>32.0068</td>\n",
" <td>600036</td>\n",
" <td>2300</td>\n",
" <td>600036.SSE.Direction.NET</td>\n",
" <td>600036.SSE</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" direction exchange frozen gateway_name pnl price symbol \\\n",
"0 Direction.NET Exchange.SSE 0 OES 0 4.1881 600010 \n",
"1 Direction.NET Exchange.SSE 0 OES 0 32.0068 600036 \n",
"\n",
" volume vt_positionid vt_symbol yd_volume \n",
"0 296900 600010.SSE.Direction.NET 600010.SSE 1000000 \n",
"1 2300 600036.SSE.Direction.NET 600036.SSE 0 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 查询持仓\n",
"engine.get_all_positions(use_df=True)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# 查询活动委托\n",
"engine.get_all_active_orders(use_df=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# 订阅行情\n",
"engine.subscribe([\"600036.SSE\"])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>ask_price_1</th>\n",
" <th>ask_price_2</th>\n",
" <th>ask_price_3</th>\n",
" <th>ask_price_4</th>\n",
" <th>ask_price_5</th>\n",
" <th>ask_volume_1</th>\n",
" <th>ask_volume_2</th>\n",
" <th>ask_volume_3</th>\n",
" <th>ask_volume_4</th>\n",
" <th>ask_volume_5</th>\n",
" <th>...</th>\n",
" <th>limit_down</th>\n",
" <th>limit_up</th>\n",
" <th>low_price</th>\n",
" <th>name</th>\n",
" <th>open_interest</th>\n",
" <th>open_price</th>\n",
" <th>pre_close</th>\n",
" <th>symbol</th>\n",
" <th>volume</th>\n",
" <th>vt_symbol</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>34.6</td>\n",
" <td>34.62</td>\n",
" <td>34.63</td>\n",
" <td>34.64</td>\n",
" <td>34.65</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>33.85</td>\n",
" <td></td>\n",
" <td>0</td>\n",
" <td>34.57</td>\n",
" <td>0.0</td>\n",
" <td>600036</td>\n",
" <td>1900</td>\n",
" <td>600036.SSE</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows × 36 columns</p>\n",
"</div>"
],
"text/plain": [
" ask_price_1 ask_price_2 ask_price_3 ask_price_4 ask_price_5 \\\n",
"0 34.6 34.62 34.63 34.64 34.65 \n",
"\n",
" ask_volume_1 ask_volume_2 ask_volume_3 ask_volume_4 ask_volume_5 ... \\\n",
"0 0 0 0 0 0 ... \n",
"\n",
" limit_down limit_up low_price name open_interest open_price \\\n",
"0 0 0 33.85 0 34.57 \n",
"\n",
" pre_close symbol volume vt_symbol \n",
"0 0.0 600036 1900 600036.SSE \n",
"\n",
"[1 rows x 36 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 查询行情\n",
"engine.get_tick(\"600036.SSE\", use_df=True)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OES.1000124\n"
]
}
],
"source": [
"# 委托下单\n",
"vt_orderid = engine.buy(\"600036.SSE\", 32, 1000)\n",
"print(vt_orderid)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"OrderData(gateway_name='OES', symbol='600036', exchange=<Exchange.SSE: 'SSE'>, orderid='1000124', type=<OrderType.LIMIT: '限价'>, direction=<Direction.NET: '净'>, offset=<Offset.OPEN: '开'>, price=32, volume=1000, traded=1000, status=<Status.ALLTRADED: '全部成交'>, time=datetime.datetime(2019, 4, 30, 17, 31, 56, 965000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800))))"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 查询特定委托\n",
"engine.get_order(vt_orderid)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"# 委托撤单\n",
"engine.cancel_order(vt_orderid)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}