You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dataloader/dolphindb-read-data.ipynb

1836 lines
75 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import dolphindb as ddb\n",
"import dolphindb.settings as keys\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"\n",
"sess = ddb.session('192.168.1.7',8848)\n",
"sess.login('admin','123456')\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'/hft_futuremarket_ts': 'TickPartitioned:3:0:TickPartitioned_3; MinKlinePartitioned:2:0:MinKlinePartitioned_2; ',\n",
" '/daily_stock_ts': 'idx_daily_kline:11:0:idx_daily_kline_11; idx_daily_concept:6:0:idx_daily_concept_6; hft_daily_factor:16:0:hft_daily_factor_16; daily_kline:2:0:daily_kline_2; ',\n",
" '/hft_stock_ts': 'Calendar:2:0:Calendar_2; KLinePartitioned:3:0:KLinePartitioned_3; OrderPartitioned:4:0:OrderPartitioned_4; TickPartitioned:5:0:TickPartitioned_5; TickQueuePartitioned:6:0:TickQueuePartitioned_6; TransePartitioned:7:0:TransePartitioned_7; '}"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run('getAllDBs()')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"ddb_hft_dbPath=\"dfs://hft_futuremarket_ts\"\n",
"tbName=\"TickPartitioned\" # MinKlinePartitioned\n",
"code_list=['AP2211']\n",
"df = sess.run(f\"\"\"pt=loadTable(\"{ddb_hft_dbPath}\",\"{tbName}\");\n",
" select * from pt where m_nDatetime.date()=2022.06.01d and code in ({\" \".join([\"`\"+c for c in code_list])});\n",
" \"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"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>code</th>\n",
" <th>m_nDatetime</th>\n",
" <th>m_nPrice</th>\n",
" <th>m_nOpen</th>\n",
" <th>m_nHigh</th>\n",
" <th>m_nLow</th>\n",
" <th>m_nClose</th>\n",
" <th>m_nAccHigh</th>\n",
" <th>m_nAccLow</th>\n",
" <th>m_iVolume</th>\n",
" <th>...</th>\n",
" <th>m_nActAskTurnover</th>\n",
" <th>m_nAccActAskTurnover</th>\n",
" <th>m_nBidOrder</th>\n",
" <th>m_nAccBidOrder</th>\n",
" <th>m_nAskOrder</th>\n",
" <th>m_nAccAskOrder</th>\n",
" <th>m_nABOrderRate</th>\n",
" <th>m_nAccABOrderRate</th>\n",
" <th>m_nMItemsVolRate</th>\n",
" <th>code_init</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>AP2211</td>\n",
" <td>2022-06-01 08:55:00</td>\n",
" <td>8701.0</td>\n",
" <td>8701.0</td>\n",
" <td>8701.0</td>\n",
" <td>8701.0</td>\n",
" <td>8701.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>AP2211</td>\n",
" <td>2022-06-01 08:59:00</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>8623.0</td>\n",
" <td>505</td>\n",
" <td>...</td>\n",
" <td>2177307.5</td>\n",
" <td>2177307.5</td>\n",
" <td>2.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>2.000000</td>\n",
" <td>2.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>AP2211</td>\n",
" <td>2022-06-01 09:00:01</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8623.0</td>\n",
" <td>4</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>2177307.5</td>\n",
" <td>1.0</td>\n",
" <td>3.0</td>\n",
" <td>2.0</td>\n",
" <td>3.0</td>\n",
" <td>0.500000</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>AP2211</td>\n",
" <td>2022-06-01 09:00:02</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8623.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>2177307.5</td>\n",
" <td>1.0</td>\n",
" <td>4.0</td>\n",
" <td>1.0</td>\n",
" <td>4.0</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>AP2211</td>\n",
" <td>2022-06-01 09:00:03</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8691.0</td>\n",
" <td>8623.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>2177307.5</td>\n",
" <td>1.0</td>\n",
" <td>5.0</td>\n",
" <td>3.0</td>\n",
" <td>7.0</td>\n",
" <td>0.333333</td>\n",
" <td>0.714286</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 38 columns</p>\n",
"</div>"
],
"text/plain": [
" code m_nDatetime m_nPrice m_nOpen m_nHigh m_nLow m_nClose \\\n",
"0 AP2211 2022-06-01 08:55:00 8701.0 8701.0 8701.0 8701.0 8701.0 \n",
"1 AP2211 2022-06-01 08:59:00 8623.0 8623.0 8623.0 8623.0 8623.0 \n",
"2 AP2211 2022-06-01 09:00:01 8691.0 8691.0 8691.0 8691.0 8691.0 \n",
"3 AP2211 2022-06-01 09:00:02 8691.0 8691.0 8691.0 8691.0 8691.0 \n",
"4 AP2211 2022-06-01 09:00:03 8691.0 8691.0 8691.0 8691.0 8691.0 \n",
"\n",
" m_nAccHigh m_nAccLow m_iVolume ... m_nActAskTurnover \\\n",
"0 0.0 0.0 0 ... 0.0 \n",
"1 8623.0 8623.0 505 ... 2177307.5 \n",
"2 8691.0 8623.0 4 ... 0.0 \n",
"3 8691.0 8623.0 0 ... 0.0 \n",
"4 8691.0 8623.0 0 ... 0.0 \n",
"\n",
" m_nAccActAskTurnover m_nBidOrder m_nAccBidOrder m_nAskOrder \\\n",
"0 0.0 0.0 0.0 0.0 \n",
"1 2177307.5 2.0 2.0 1.0 \n",
"2 2177307.5 1.0 3.0 2.0 \n",
"3 2177307.5 1.0 4.0 1.0 \n",
"4 2177307.5 1.0 5.0 3.0 \n",
"\n",
" m_nAccAskOrder m_nABOrderRate m_nAccABOrderRate m_nMItemsVolRate \\\n",
"0 0.0 0.000000 0.000000 0.0 \n",
"1 1.0 2.000000 2.000000 0.0 \n",
"2 3.0 0.500000 1.000000 0.0 \n",
"3 4.0 1.000000 1.000000 0.0 \n",
"4 7.0 0.333333 0.714286 0.0 \n",
"\n",
" code_init \n",
"0 AP \n",
"1 AP \n",
"2 AP \n",
"3 AP \n",
"4 AP \n",
"\n",
"[5 rows x 38 columns]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'partitionType': array([1, 1], dtype=int32),\n",
" 'partitionColumnName': array(['m_nDatetime', 'code_init'], dtype=object),\n",
" 'partitionTypeName': array(['VALUE', 'VALUE'], dtype=object),\n",
" 'partitionColumnIndex': array([ 1, 37], dtype=int32),\n",
" 'colDefs': name typeString typeInt comment\n",
" 0 code STRING 18 \n",
" 1 m_nDatetime NANOTIMESTAMP 14 \n",
" 2 m_nPrice DOUBLE 16 \n",
" 3 m_nOpen DOUBLE 16 \n",
" 4 m_nHigh DOUBLE 16 \n",
" 5 m_nLow DOUBLE 16 \n",
" 6 m_nClose DOUBLE 16 \n",
" 7 m_nAccHigh DOUBLE 16 \n",
" 8 m_nAccLow DOUBLE 16 \n",
" 9 m_iVolume SHORT 3 \n",
" 10 m_iAccVolume SHORT 3 \n",
" 11 m_nMatchItems SHORT 3 \n",
" 12 m_nAccMatchItems SHORT 3 \n",
" 13 m_iTurnover DOUBLE 16 \n",
" 14 m_iAccTurnover DOUBLE 16 \n",
" 15 m_nPreClose DOUBLE 16 \n",
" 16 m_nAccPreClose DOUBLE 16 \n",
" 17 m_nBidPrice DOUBLE 16 \n",
" 18 m_nBidVolume SHORT 3 \n",
" 19 m_nAskPrice DOUBLE 16 \n",
" 20 m_nAskVolume SHORT 3 \n",
" 21 m_iABFlag CHAR 2 \n",
" 22 m_nActBidVolume SHORT 3 \n",
" 23 m_nAccActBidVolume SHORT 3 \n",
" 24 m_nActBidTurnover DOUBLE 16 \n",
" 25 m_nAccActBidTurnover DOUBLE 16 \n",
" 26 m_nActAskVolume SHORT 3 \n",
" 27 m_nAccActAskVolume SHORT 3 \n",
" 28 m_nActAskTurnover DOUBLE 16 \n",
" 29 m_nAccActAskTurnover DOUBLE 16 \n",
" 30 m_nBidOrder DOUBLE 16 \n",
" 31 m_nAccBidOrder DOUBLE 16 \n",
" 32 m_nAskOrder DOUBLE 16 \n",
" 33 m_nAccAskOrder DOUBLE 16 \n",
" 34 m_nABOrderRate DOUBLE 16 \n",
" 35 m_nAccABOrderRate DOUBLE 16 \n",
" 36 m_nMItemsVolRate DOUBLE 16 \n",
" 37 code_init STRING 18 ,\n",
" 'chunkGranularity': 'TABLE',\n",
" 'engineType': 'TSDB',\n",
" 'keepDuplicates': 'ALL',\n",
" 'partitionSchema': [array(['2050-11', '2050-10', '2050-09', '2050-08', '2050-07', '2050-06',\n",
" '2050-05', '2050-04', '2050-03', '2050-02', '2050-01', '2049-12',\n",
" '2049-11', '2049-10', '2049-09', '2049-08', '2049-07', '2049-06',\n",
" '2049-05', '2049-04', '2049-03', '2049-02', '2049-01', '2048-12',\n",
" '2048-11', '2048-10', '2048-09', '2048-08', '2048-07', '2048-06',\n",
" '2048-05', '2048-04', '2048-03', '2048-02', '2048-01', '2047-12',\n",
" '2047-11', '2047-10', '2047-09', '2047-08', '2047-07', '2047-06',\n",
" '2047-05', '2047-04', '2047-03', '2047-02', '2047-01', '2046-12',\n",
" '2046-11', '2046-10', '2046-09', '2046-08', '2046-07', '2046-06',\n",
" '2046-05', '2046-04', '2046-03', '2046-02', '2046-01', '2045-12',\n",
" '2045-11', '2045-10', '2045-09', '2045-08', '2045-07', '2045-06',\n",
" '2045-05', '2045-04', '2045-03', '2045-02', '2045-01', '2044-12',\n",
" '2044-11', '2044-10', '2044-09', '2044-08', '2044-07', '2044-06',\n",
" '2044-05', '2044-04', '2044-03', '2044-02', '2044-01', '2043-12',\n",
" '2043-11', '2043-10', '2043-09', '2043-08', '2043-07', '2043-06',\n",
" '2043-05', '2043-04', '2043-03', '2043-02', '2043-01', '2042-12',\n",
" '2042-11', '2042-10', '2042-09', '2042-08', '2042-07', '2042-06',\n",
" '2042-05', '2042-04', '2042-03', '2042-02', '2042-01', '2041-12',\n",
" '2041-11', '2041-10', '2041-09', '2041-08', '2041-07', '2041-06',\n",
" '2041-05', '2041-04', '2041-03', '2041-02', '2041-01', '2040-12',\n",
" '2040-11', '2040-10', '2040-09', '2040-08', '2040-07', '2040-06',\n",
" '2040-05', '2040-04', '2040-03', '2040-02', '2040-01', '2039-12',\n",
" '2039-11', '2039-10', '2039-09', '2039-08', '2039-07', '2039-06',\n",
" '2039-05', '2039-04', '2039-03', '2039-02', '2039-01', '2038-12',\n",
" '2038-11', '2038-10', '2038-09', '2038-08', '2038-07', '2038-06',\n",
" '2038-05', '2038-04', '2038-03', '2038-02', '2038-01', '2037-12',\n",
" '2037-11', '2037-10', '2037-09', '2037-08', '2037-07', '2037-06',\n",
" '2037-05', '2037-04', '2037-03', '2037-02', '2037-01', '2036-12',\n",
" '2036-11', '2036-10', '2036-09', '2036-08', '2036-07', '2036-06',\n",
" '2036-05', '2036-04', '2036-03', '2036-02', '2036-01', '2035-12',\n",
" '2035-11', '2035-10', '2035-09', '2035-08', '2035-07', '2035-06',\n",
" '2035-05', '2035-04', '2035-03', '2035-02', '2035-01', '2034-12',\n",
" '2034-11', '2034-10', '2034-09', '2034-08', '2034-07', '2034-06',\n",
" '2034-05', '2034-04', '2034-03', '2034-02', '2034-01', '2033-12',\n",
" '2033-11', '2033-10', '2033-09', '2033-08', '2033-07', '2033-06',\n",
" '2033-05', '2033-04', '2033-03', '2033-02', '2033-01', '2032-12',\n",
" '2032-11', '2032-10', '2032-09', '2032-08', '2032-07', '2032-06',\n",
" '2032-05', '2032-04', '2032-03', '2032-02', '2032-01', '2031-12',\n",
" '2031-11', '2031-10', '2031-09', '2031-08', '2031-07', '2031-06',\n",
" '2031-05', '2031-04', '2031-03', '2031-02', '2031-01', '2030-12',\n",
" '2030-11', '2030-10', '2030-09', '2030-08', '2030-07', '2030-06',\n",
" '2030-05', '2030-04', '2030-03', '2030-02', '2030-01', '2029-12',\n",
" '2029-11', '2029-10', '2029-09', '2029-08', '2029-07', '2029-06',\n",
" '2029-05', '2029-04', '2029-03', '2029-02', '2029-01', '2028-12',\n",
" '2028-11', '2028-10', '2028-09', '2028-08', '2028-07', '2028-06',\n",
" '2028-05', '2028-04', '2028-03', '2028-02', '2028-01', '2027-12',\n",
" '2027-11', '2027-10', '2027-09', '2027-08', '2027-07', '2027-06',\n",
" '2027-05', '2027-04', '2027-03', '2027-02', '2027-01', '2026-12',\n",
" '2026-11', '2026-10', '2026-09', '2026-08', '2026-07', '2026-06',\n",
" '2026-05', '2026-04', '2026-03', '2026-02', '2026-01', '2025-12',\n",
" '2025-11', '2025-10', '2025-09', '2025-08', '2025-07', '2025-06',\n",
" '2025-05', '2025-04', '2025-03', '2025-02', '2025-01', '2024-12',\n",
" '2024-11', '2024-10', '2024-09', '2024-08', '2024-07', '2024-06',\n",
" '2024-05', '2024-04', '2024-03', '2024-02', '2024-01', '2023-12',\n",
" '2023-11', '2023-10', '2023-09', '2023-08', '2023-07', '2023-06',\n",
" '2023-05', '2023-04', '2023-03', '2023-02', '2023-01', '2022-12',\n",
" '2022-11', '2022-10', '2022-09', '2022-08', '2022-07', '2022-06',\n",
" '2022-05', '2022-04', '2022-03', '2022-02', '2022-01', '2021-12',\n",
" '2021-11', '2021-10', '2021-09', '2021-08', '2021-07', '2021-06',\n",
" '2021-05', '2021-04', '2021-03', '2021-02', '2021-01', '2020-12',\n",
" '2020-11', '2020-10', '2020-09', '2020-08', '2020-07', '2020-06',\n",
" '2020-05', '2020-04', '2020-03', '2020-02', '2020-01', '2019-12',\n",
" '2019-11', '2019-10', '2019-09', '2019-08', '2019-07', '2019-06',\n",
" '2019-05', '2019-04', '2019-03', '2019-02', '2019-01', '2018-12',\n",
" '2018-11', '2018-10', '2018-09', '2018-08', '2018-07', '2018-06',\n",
" '2018-05', '2018-04', '2018-03', '2018-02', '2018-01', '2017-12',\n",
" '2017-11', '2017-10', '2017-09', '2017-08', '2017-07', '2017-06',\n",
" '2017-05', '2017-04', '2017-03', '2017-02', '2017-01', '2016-12',\n",
" '2016-11', '2016-10', '2016-09', '2016-08', '2016-07', '2016-06',\n",
" '2016-05', '2016-04', '2016-03', '2016-02', '2016-01', '2015-12',\n",
" '2015-11', '2015-10', '2015-09', '2015-08', '2015-07', '2015-06',\n",
" '2015-05', '2015-04', '2015-03', '2015-02', '2015-01', '2014-12',\n",
" '2014-11', '2014-10', '2014-09', '2014-08', '2014-07', '2014-06',\n",
" '2014-05', '2014-04', '2014-03', '2014-02', '2014-01', '2013-12',\n",
" '2013-11', '2013-10', '2013-09', '2013-08', '2013-07', '2013-06',\n",
" '2013-05', '2013-04', '2013-03', '2013-02', '2013-01', '2012-12',\n",
" '2012-11', '2012-10', '2012-09', '2012-08', '2012-07', '2012-06',\n",
" '2012-05', '2012-04', '2012-03', '2012-02', '2012-01', '2011-12',\n",
" '2011-11', '2011-10', '2011-09', '2011-08', '2011-07', '2011-06',\n",
" '2011-05', '2011-04', '2011-03', '2011-02', '2011-01', '2010-12',\n",
" '2010-11', '2010-10', '2010-09', '2010-08', '2010-07', '2010-06',\n",
" '2010-05', '2010-04', '2010-03', '2010-02', '2010-01', '2009-12',\n",
" '2009-11', '2009-10', '2009-09', '2009-08', '2009-07', '2009-06',\n",
" '2009-05', '2009-04', '2009-03', '2009-02', '2009-01', '2008-12',\n",
" '2008-11', '2008-10', '2008-09', '2008-08', '2008-07', '2008-06',\n",
" '2008-05', '2008-04', '2008-03', '2008-02', '2008-01', '2007-12',\n",
" '2007-11', '2007-10', '2007-09', '2007-08', '2007-07', '2007-06',\n",
" '2007-05', '2007-04', '2007-03', '2007-02', '2007-01', '2006-12',\n",
" '2006-11', '2006-10', '2006-09', '2006-08', '2006-07', '2006-06',\n",
" '2006-05', '2006-04', '2006-03', '2006-02', '2006-01', '2005-12',\n",
" '2005-11', '2005-10', '2005-09', '2005-08', '2005-07', '2005-06',\n",
" '2005-05', '2005-04', '2005-03', '2005-02', '2005-01', '2004-12',\n",
" '2004-11', '2004-10', '2004-09', '2004-08', '2004-07', '2004-06',\n",
" '2004-05', '2004-04', '2004-03', '2004-02', '2004-01', '2003-12',\n",
" '2003-11', '2003-10', '2003-09', '2003-08', '2003-07', '2003-06',\n",
" '2003-05', '2003-04', '2003-03', '2003-02', '2003-01', '2002-12',\n",
" '2002-11', '2002-10', '2002-09', '2002-08', '2002-07', '2002-06',\n",
" '2002-05', '2002-04', '2002-03', '2002-02', '2002-01', '2001-12',\n",
" '2001-11', '2001-10', '2001-09', '2001-08', '2001-07', '2001-06',\n",
" '2001-05', '2001-04', '2001-03', '2001-02', '2001-01', '2000-12',\n",
" '2000-11', '2000-10', '2000-09', '2000-08', '2000-07', '2000-06',\n",
" '2000-05', '2000-04', '2000-03', '2000-02', '2000-01'],\n",
" dtype='datetime64[M]'),\n",
" array(['zn', 'y', 'wr', 'v', 'ss', 'sp', 'sn', 'sc', 'ru', 'rr', 'rb',\n",
" 'pp', 'pg', 'pb', 'p', 'nr', 'ni', 'm', 'lu', 'lh', 'l', 'jm',\n",
" 'jd', 'j', 'i', 'hc', 'fu', 'fb', 'eg', 'eb', 'cu', 'cs', 'c',\n",
" 'bu', 'bc', 'bb', 'b', 'au', 'al', 'ag', 'a', 'ZC', 'WH', 'UR',\n",
" 'TS', 'TF', 'TA', 'T', 'SR', 'SM', 'SF', 'SA', 'RS', 'RM', 'RI',\n",
" 'PM', 'PK', 'PF', 'OI', 'MA', 'LR', 'JR', 'IM', 'IH', 'IF', 'IC',\n",
" 'FG', 'CY', 'CJ', 'CF', 'AP'], dtype=object)],\n",
" 'partitionColumnType': array([ 7, 17], dtype=int32),\n",
" 'chunkPath': None,\n",
" 'sortColumns': array(['code', 'm_nDatetime'], dtype=object),\n",
" 'partitionSites': None}"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(f\"\"\"schema(pt)\"\"\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```python\n",
"def get_trade_tick(self, start_date, end_date, code_list):\n",
"\"\"\"\n",
"(source: 天软数据字典 ver 2022-05-25)\n",
"vol: 周期内的成交量。如果周期为分钟,则表示这分钟的成 交量,并非从开盘累计.\n",
" 对于期货,高频和日线的单位都是合约数量,如果要建立成交量和成交金额之间的关系,还需考虑合约乘数。\n",
"amount: 周期内的成交金额。如果周期为分钟,则表示这分钟的成交金额,并非从开盘累计。\n",
"cjbs: 对于期货/期权而言,是周期内的持仓的变动量,日线的话表示当日持仓量,单位为:手。\n",
"wb: 公式:委买/委卖(w_buy/w_sale)\n",
"lb: 由天软计算:\n",
" 1、对于交易明细:\n",
" 量比=现成交总手/[(过去 5 个交易日平均每分钟成交 量)×当日累计开市时间(分)]\n",
" 2、对于秒线/1 分钟线: 量比取周期内最后一条交易明细的数据。\n",
"\n",
"zmm: 对 tradetable 公式:按下面的前后逻辑优先判定\n",
" 没有成交 -> 0\n",
" 当前成交价>上一笔买一价 ->主买 1 \n",
" 当前成交价<上一笔卖一价 ->主卖 2 \n",
" 否则->3(一般是集合竞价、涨停、跌停) \n",
" 对于非交易明细(秒线或分钟线等):没有意义\n",
"buy_vol: 主动性买盘成交量:周期内买卖标识为 1 的成交量+买 卖标识为 3 的成交量/2\n",
"buy_amount: 主动性买盘成交金额:周期内买卖标识为 1 的成交金额 +买卖标识为 3 的成交金额/2\n",
"sale_vol: 主动性卖盘成交量:周期内买卖标识为 2 的成交量之和 +买卖标识为 3 的成交量/2\n",
"sale_amount: 主动性卖盘成交金额:周期内买卖标识为 2 的成交金额 +买卖标识为 3 的成交金额/2\n",
"w_buy: 一个周期内的委买量\n",
"sectional: 从开盘到当前时间的\n",
"sectional_yclose: 上一交易日(周期是日)的收盘价,与‘上次价’不一 样。‘上次价’表示前一个周期的收盘价。\n",
"sectional_vol: 从开盘到当前时间的成交量之和(主买+主卖)\n",
"sectional_amount: 从开盘到当前时间的成交金额之和(主买+主卖)\n",
"sectional_cjbs: 股指期货/期权:市场现有持仓量\n",
"sectional_wb: 当日累计委买/当日累计委卖\n",
"\n",
"['sectional_open'] as 'm_nAccOpen', //时点当日开盘, 没必要存, 取上日2059的即可\n",
"\n",
"\"\"\"\n",
"\n",
"code_list_input = ', '.join(['\\'%s\\'' % code_id for code_id in code_list])\n",
"scpt = \"\"\"\n",
" stock_list := Array({code_list_input});\n",
" r := select \n",
" ['StockID'] as 'code',\n",
" DateTimeToStr(['date']) as 'm_nDatetime',\n",
"\n",
" ['price'] as 'm_nPrice',\n",
" ['open'] as 'm_nOpen',\n",
" ['high'] as 'm_nHigh',\n",
" ['low'] as 'm_nLow',\n",
" ['close'] as 'm_nClose',\n",
"\n",
" ['sectional_high'] as 'm_nAccHigh',\n",
" ['sectional_low'] as 'm_nAccLow',\n",
"\n",
" ['vol'] as 'm_iVolume', //成交量\n",
" ['sectional_vol'] as 'm_iAccVolume', //时点当日累计成交量\n",
"\n",
" ['cjbs'] as 'm_nMatchItems', // 成交笔数 周期内的持仓的变动量\n",
" ['sectional_cjbs'] as 'm_nAccMatchItems',\n",
"\n",
" ['amount'] as 'm_iTurnover', //成交金额\n",
" ['sectional_amount'] as 'm_iAccTurnover', \n",
"\n",
" ['yclose'] as 'm_nPreClose', //上一周期的收盘价\n",
" ['sectional_yclose'] as 'm_nAccPreClose', // 前日收盘\n",
" \n",
" ['buy1'] as 'm_nBidPrice', //买一价?叫卖价?\n",
" ['bc1'] as 'm_nBidVolume', //买一量 当前以买一价出价的委买量\n",
" ['sale1'] as 'm_nAskPrice', \n",
" ['sc1'] as 'm_nAskVolume', \n",
"\n",
" ['zmm'] as 'm_iABFlag', //买卖标识\n",
"\n",
" ['buy_vol'] as 'm_nActBidVolume', //主买量\n",
" ['sectional_buy_vol'] as 'm_nAccActBidVolume', //时点当日累计主买量\n",
" ['buy_amount'] as 'm_nActBidTurnover', //主买金额\n",
" ['sectional_buy_amount'] as 'm_nAccActBidTurnover', \n",
"\n",
" ['sale_vol'] as 'm_nActAskVolume', \n",
" ['sectional_sale_vol'] as 'm_nAccActAskVolume', \n",
" ['sale_amount'] as 'm_nActAskTurnover',\n",
" ['sectional_sale_amount'] as 'm_nAccActAskTurnover', \n",
"\n",
" ['w_buy'] as 'm_nBidOrder', //委买\n",
" ['sectional_w_buy'] as 'm_nAccBidOrder', \n",
" ['w_sale'] as 'm_nAskOrder',\n",
" ['sectional_w_sale'] as 'm_nAccAskOrder',\n",
"\n",
" ['wb'] as 'm_nABOrderRate', //委比\n",
" ['sectional_wb'] as 'm_nAccABOrderRate', //时点当日累计委比\n",
" ['lb'] as 'm_nMItemsVolRate'//量比\n",
"\n",
" from tradetable\n",
" datekey {start_date}T to {end_date}T+0.999 \n",
" of stock_list\n",
" end;\n",
" \n",
" return r; \n",
"\"\"\".format(\n",
" code_list_input=code_list_input,\n",
" start_date=start_date,\n",
" end_date=end_date\n",
")\n",
"logger.debug(scpt)\n",
"r = self.c.exec(scpt,timeout=self.timeout_default)\n",
"return r\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 10,
"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>code</th>\n",
" <th>m_nDatetime</th>\n",
" <th>m_nPrice</th>\n",
" <th>m_nOpen</th>\n",
" <th>m_nHigh</th>\n",
" <th>m_nLow</th>\n",
" <th>m_nClose</th>\n",
" <th>m_nAccHigh</th>\n",
" <th>m_nAccLow</th>\n",
" <th>m_iVolume</th>\n",
" <th>...</th>\n",
" <th>m_nActAskTurnover</th>\n",
" <th>m_nAccActAskTurnover</th>\n",
" <th>m_nBidOrder</th>\n",
" <th>m_nAccBidOrder</th>\n",
" <th>m_nAskOrder</th>\n",
" <th>m_nAccAskOrder</th>\n",
" <th>m_nABOrderRate</th>\n",
" <th>m_nAccABOrderRate</th>\n",
" <th>m_nMItemsVolRate</th>\n",
" <th>code_init</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 08:55:00</td>\n",
" <td>7776.0</td>\n",
" <td>7776.0</td>\n",
" <td>7776.0</td>\n",
" <td>7776.0</td>\n",
" <td>7776.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 08:59:00</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>2705</td>\n",
" <td>...</td>\n",
" <td>10496752.5</td>\n",
" <td>10496752.5</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:00</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>7761.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10496752.5</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:00</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10504513.5</td>\n",
" <td>1.0</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:01</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10504513.5</td>\n",
" <td>1.0</td>\n",
" <td>4.0</td>\n",
" <td>1.0</td>\n",
" <td>4.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:02</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10504513.5</td>\n",
" <td>1.0</td>\n",
" <td>5.0</td>\n",
" <td>1.0</td>\n",
" <td>5.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:03</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10504513.5</td>\n",
" <td>1.0</td>\n",
" <td>6.0</td>\n",
" <td>1.0</td>\n",
" <td>6.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:04</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10512274.5</td>\n",
" <td>1.0</td>\n",
" <td>7.0</td>\n",
" <td>1.0</td>\n",
" <td>7.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:05</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7759.0</td>\n",
" <td>7761.0</td>\n",
" <td>7759.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10512274.5</td>\n",
" <td>1.0</td>\n",
" <td>8.0</td>\n",
" <td>1.0</td>\n",
" <td>8.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:05</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>9.0</td>\n",
" <td>1.0</td>\n",
" <td>9.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:07</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>10.0</td>\n",
" <td>1.0</td>\n",
" <td>10.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:08</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>11.0</td>\n",
" <td>1.0</td>\n",
" <td>11.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:09</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>12.0</td>\n",
" <td>1.0</td>\n",
" <td>12.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:10</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>13.0</td>\n",
" <td>1.0</td>\n",
" <td>13.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:12</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>14.0</td>\n",
" <td>1.0</td>\n",
" <td>14.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:13</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7757.0</td>\n",
" <td>7761.0</td>\n",
" <td>7757.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10520035.5</td>\n",
" <td>1.0</td>\n",
" <td>15.0</td>\n",
" <td>1.0</td>\n",
" <td>15.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:13</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7761.0</td>\n",
" <td>7751.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10527796.5</td>\n",
" <td>1.0</td>\n",
" <td>16.0</td>\n",
" <td>1.0</td>\n",
" <td>16.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:14</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7761.0</td>\n",
" <td>7751.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10527796.5</td>\n",
" <td>1.0</td>\n",
" <td>17.0</td>\n",
" <td>1.0</td>\n",
" <td>17.0</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:15</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7761.0</td>\n",
" <td>7751.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10527796.5</td>\n",
" <td>2.0</td>\n",
" <td>19.0</td>\n",
" <td>1.0</td>\n",
" <td>18.0</td>\n",
" <td>2.0</td>\n",
" <td>1.055556</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:16</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7751.0</td>\n",
" <td>7761.0</td>\n",
" <td>7751.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10527796.5</td>\n",
" <td>10.0</td>\n",
" <td>29.0</td>\n",
" <td>1.0</td>\n",
" <td>19.0</td>\n",
" <td>10.0</td>\n",
" <td>1.526316</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:16</td>\n",
" <td>7738.0</td>\n",
" <td>7738.0</td>\n",
" <td>7738.0</td>\n",
" <td>7738.0</td>\n",
" <td>7738.0</td>\n",
" <td>7761.0</td>\n",
" <td>7738.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10535557.5</td>\n",
" <td>9.0</td>\n",
" <td>38.0</td>\n",
" <td>1.0</td>\n",
" <td>20.0</td>\n",
" <td>9.0</td>\n",
" <td>1.900000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:17</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>11</td>\n",
" <td>...</td>\n",
" <td>85371.0</td>\n",
" <td>10620928.5</td>\n",
" <td>1.0</td>\n",
" <td>39.0</td>\n",
" <td>1.0</td>\n",
" <td>21.0</td>\n",
" <td>1.0</td>\n",
" <td>1.857143</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:18</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10620928.5</td>\n",
" <td>1.0</td>\n",
" <td>40.0</td>\n",
" <td>1.0</td>\n",
" <td>22.0</td>\n",
" <td>1.0</td>\n",
" <td>1.818182</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:19</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10620928.5</td>\n",
" <td>1.0</td>\n",
" <td>41.0</td>\n",
" <td>1.0</td>\n",
" <td>23.0</td>\n",
" <td>1.0</td>\n",
" <td>1.782609</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:20</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7730.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10620928.5</td>\n",
" <td>1.0</td>\n",
" <td>42.0</td>\n",
" <td>1.0</td>\n",
" <td>24.0</td>\n",
" <td>1.0</td>\n",
" <td>1.750000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:21</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10628689.5</td>\n",
" <td>1.0</td>\n",
" <td>43.0</td>\n",
" <td>1.0</td>\n",
" <td>25.0</td>\n",
" <td>1.0</td>\n",
" <td>1.720000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:22</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7731.0</td>\n",
" <td>7761.0</td>\n",
" <td>7730.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10628689.5</td>\n",
" <td>1.0</td>\n",
" <td>44.0</td>\n",
" <td>1.0</td>\n",
" <td>26.0</td>\n",
" <td>1.0</td>\n",
" <td>1.692308</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:22</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>7761.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>45.0</td>\n",
" <td>1.0</td>\n",
" <td>27.0</td>\n",
" <td>1.0</td>\n",
" <td>1.666667</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:23</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>46.0</td>\n",
" <td>1.0</td>\n",
" <td>28.0</td>\n",
" <td>1.0</td>\n",
" <td>1.642857</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:24</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>47.0</td>\n",
" <td>1.0</td>\n",
" <td>29.0</td>\n",
" <td>1.0</td>\n",
" <td>1.620690</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:25</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>48.0</td>\n",
" <td>1.0</td>\n",
" <td>30.0</td>\n",
" <td>1.0</td>\n",
" <td>1.600000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:26</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>49.0</td>\n",
" <td>1.0</td>\n",
" <td>31.0</td>\n",
" <td>1.0</td>\n",
" <td>1.580645</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:27</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>50.0</td>\n",
" <td>1.0</td>\n",
" <td>32.0</td>\n",
" <td>1.0</td>\n",
" <td>1.562500</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:29</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>51.0</td>\n",
" <td>1.0</td>\n",
" <td>33.0</td>\n",
" <td>1.0</td>\n",
" <td>1.545455</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:30</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>52.0</td>\n",
" <td>1.0</td>\n",
" <td>34.0</td>\n",
" <td>1.0</td>\n",
" <td>1.529412</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:31</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>53.0</td>\n",
" <td>1.0</td>\n",
" <td>35.0</td>\n",
" <td>1.0</td>\n",
" <td>1.514286</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:32</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>54.0</td>\n",
" <td>1.0</td>\n",
" <td>36.0</td>\n",
" <td>1.0</td>\n",
" <td>1.500000</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:33</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>55.0</td>\n",
" <td>1.0</td>\n",
" <td>37.0</td>\n",
" <td>1.0</td>\n",
" <td>1.486486</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:34</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>56.0</td>\n",
" <td>1.0</td>\n",
" <td>38.0</td>\n",
" <td>1.0</td>\n",
" <td>1.473684</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>AP2211</td>\n",
" <td>2022-02-11 09:00:35</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7725.0</td>\n",
" <td>7761.0</td>\n",
" <td>7725.0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>10636450.5</td>\n",
" <td>1.0</td>\n",
" <td>57.0</td>\n",
" <td>1.0</td>\n",
" <td>39.0</td>\n",
" <td>1.0</td>\n",
" <td>1.461538</td>\n",
" <td>0.0</td>\n",
" <td>AP</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>40 rows × 38 columns</p>\n",
"</div>"
],
"text/plain": [
" code m_nDatetime m_nPrice m_nOpen m_nHigh m_nLow m_nClose \\\n",
"0 AP2211 2022-02-11 08:55:00 7776.0 7776.0 7776.0 7776.0 7776.0 \n",
"1 AP2211 2022-02-11 08:59:00 7761.0 7761.0 7761.0 7761.0 7761.0 \n",
"2 AP2211 2022-02-11 09:00:00 7761.0 7761.0 7761.0 7761.0 7761.0 \n",
"3 AP2211 2022-02-11 09:00:00 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"4 AP2211 2022-02-11 09:00:01 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"5 AP2211 2022-02-11 09:00:02 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"6 AP2211 2022-02-11 09:00:03 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"7 AP2211 2022-02-11 09:00:04 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"8 AP2211 2022-02-11 09:00:05 7759.0 7759.0 7759.0 7759.0 7759.0 \n",
"9 AP2211 2022-02-11 09:00:05 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"10 AP2211 2022-02-11 09:00:07 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"11 AP2211 2022-02-11 09:00:08 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"12 AP2211 2022-02-11 09:00:09 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"13 AP2211 2022-02-11 09:00:10 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"14 AP2211 2022-02-11 09:00:12 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"15 AP2211 2022-02-11 09:00:13 7757.0 7757.0 7757.0 7757.0 7757.0 \n",
"16 AP2211 2022-02-11 09:00:13 7751.0 7751.0 7751.0 7751.0 7751.0 \n",
"17 AP2211 2022-02-11 09:00:14 7751.0 7751.0 7751.0 7751.0 7751.0 \n",
"18 AP2211 2022-02-11 09:00:15 7751.0 7751.0 7751.0 7751.0 7751.0 \n",
"19 AP2211 2022-02-11 09:00:16 7751.0 7751.0 7751.0 7751.0 7751.0 \n",
"20 AP2211 2022-02-11 09:00:16 7738.0 7738.0 7738.0 7738.0 7738.0 \n",
"21 AP2211 2022-02-11 09:00:17 7730.0 7730.0 7730.0 7730.0 7730.0 \n",
"22 AP2211 2022-02-11 09:00:18 7730.0 7730.0 7730.0 7730.0 7730.0 \n",
"23 AP2211 2022-02-11 09:00:19 7730.0 7730.0 7730.0 7730.0 7730.0 \n",
"24 AP2211 2022-02-11 09:00:20 7730.0 7730.0 7730.0 7730.0 7730.0 \n",
"25 AP2211 2022-02-11 09:00:21 7731.0 7731.0 7731.0 7731.0 7731.0 \n",
"26 AP2211 2022-02-11 09:00:22 7731.0 7731.0 7731.0 7731.0 7731.0 \n",
"27 AP2211 2022-02-11 09:00:22 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"28 AP2211 2022-02-11 09:00:23 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"29 AP2211 2022-02-11 09:00:24 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"30 AP2211 2022-02-11 09:00:25 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"31 AP2211 2022-02-11 09:00:26 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"32 AP2211 2022-02-11 09:00:27 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"33 AP2211 2022-02-11 09:00:29 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"34 AP2211 2022-02-11 09:00:30 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"35 AP2211 2022-02-11 09:00:31 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"36 AP2211 2022-02-11 09:00:32 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"37 AP2211 2022-02-11 09:00:33 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"38 AP2211 2022-02-11 09:00:34 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"39 AP2211 2022-02-11 09:00:35 7725.0 7725.0 7725.0 7725.0 7725.0 \n",
"\n",
" m_nAccHigh m_nAccLow m_iVolume ... m_nActAskTurnover \\\n",
"0 0.0 0.0 0 ... 0.0 \n",
"1 7761.0 7761.0 2705 ... 10496752.5 \n",
"2 7761.0 7761.0 0 ... 0.0 \n",
"3 7761.0 7759.0 1 ... 7761.0 \n",
"4 7761.0 7759.0 0 ... 0.0 \n",
"5 7761.0 7759.0 0 ... 0.0 \n",
"6 7761.0 7759.0 0 ... 0.0 \n",
"7 7761.0 7759.0 1 ... 7761.0 \n",
"8 7761.0 7759.0 0 ... 0.0 \n",
"9 7761.0 7757.0 1 ... 7761.0 \n",
"10 7761.0 7757.0 0 ... 0.0 \n",
"11 7761.0 7757.0 0 ... 0.0 \n",
"12 7761.0 7757.0 0 ... 0.0 \n",
"13 7761.0 7757.0 0 ... 0.0 \n",
"14 7761.0 7757.0 0 ... 0.0 \n",
"15 7761.0 7757.0 0 ... 0.0 \n",
"16 7761.0 7751.0 1 ... 7761.0 \n",
"17 7761.0 7751.0 0 ... 0.0 \n",
"18 7761.0 7751.0 0 ... 0.0 \n",
"19 7761.0 7751.0 0 ... 0.0 \n",
"20 7761.0 7738.0 1 ... 7761.0 \n",
"21 7761.0 7730.0 11 ... 85371.0 \n",
"22 7761.0 7730.0 0 ... 0.0 \n",
"23 7761.0 7730.0 0 ... 0.0 \n",
"24 7761.0 7730.0 0 ... 0.0 \n",
"25 7761.0 7730.0 1 ... 7761.0 \n",
"26 7761.0 7730.0 0 ... 0.0 \n",
"27 7761.0 7725.0 1 ... 7761.0 \n",
"28 7761.0 7725.0 0 ... 0.0 \n",
"29 7761.0 7725.0 0 ... 0.0 \n",
"30 7761.0 7725.0 0 ... 0.0 \n",
"31 7761.0 7725.0 0 ... 0.0 \n",
"32 7761.0 7725.0 0 ... 0.0 \n",
"33 7761.0 7725.0 0 ... 0.0 \n",
"34 7761.0 7725.0 0 ... 0.0 \n",
"35 7761.0 7725.0 0 ... 0.0 \n",
"36 7761.0 7725.0 0 ... 0.0 \n",
"37 7761.0 7725.0 0 ... 0.0 \n",
"38 7761.0 7725.0 0 ... 0.0 \n",
"39 7761.0 7725.0 0 ... 0.0 \n",
"\n",
" m_nAccActAskTurnover m_nBidOrder m_nAccBidOrder m_nAskOrder \\\n",
"0 0.0 0.0 0.0 0.0 \n",
"1 10496752.5 1.0 1.0 1.0 \n",
"2 10496752.5 1.0 2.0 1.0 \n",
"3 10504513.5 1.0 3.0 1.0 \n",
"4 10504513.5 1.0 4.0 1.0 \n",
"5 10504513.5 1.0 5.0 1.0 \n",
"6 10504513.5 1.0 6.0 1.0 \n",
"7 10512274.5 1.0 7.0 1.0 \n",
"8 10512274.5 1.0 8.0 1.0 \n",
"9 10520035.5 1.0 9.0 1.0 \n",
"10 10520035.5 1.0 10.0 1.0 \n",
"11 10520035.5 1.0 11.0 1.0 \n",
"12 10520035.5 1.0 12.0 1.0 \n",
"13 10520035.5 1.0 13.0 1.0 \n",
"14 10520035.5 1.0 14.0 1.0 \n",
"15 10520035.5 1.0 15.0 1.0 \n",
"16 10527796.5 1.0 16.0 1.0 \n",
"17 10527796.5 1.0 17.0 1.0 \n",
"18 10527796.5 2.0 19.0 1.0 \n",
"19 10527796.5 10.0 29.0 1.0 \n",
"20 10535557.5 9.0 38.0 1.0 \n",
"21 10620928.5 1.0 39.0 1.0 \n",
"22 10620928.5 1.0 40.0 1.0 \n",
"23 10620928.5 1.0 41.0 1.0 \n",
"24 10620928.5 1.0 42.0 1.0 \n",
"25 10628689.5 1.0 43.0 1.0 \n",
"26 10628689.5 1.0 44.0 1.0 \n",
"27 10636450.5 1.0 45.0 1.0 \n",
"28 10636450.5 1.0 46.0 1.0 \n",
"29 10636450.5 1.0 47.0 1.0 \n",
"30 10636450.5 1.0 48.0 1.0 \n",
"31 10636450.5 1.0 49.0 1.0 \n",
"32 10636450.5 1.0 50.0 1.0 \n",
"33 10636450.5 1.0 51.0 1.0 \n",
"34 10636450.5 1.0 52.0 1.0 \n",
"35 10636450.5 1.0 53.0 1.0 \n",
"36 10636450.5 1.0 54.0 1.0 \n",
"37 10636450.5 1.0 55.0 1.0 \n",
"38 10636450.5 1.0 56.0 1.0 \n",
"39 10636450.5 1.0 57.0 1.0 \n",
"\n",
" m_nAccAskOrder m_nABOrderRate m_nAccABOrderRate m_nMItemsVolRate \\\n",
"0 0.0 0.0 0.000000 0.0 \n",
"1 1.0 1.0 1.000000 0.0 \n",
"2 2.0 1.0 1.000000 0.0 \n",
"3 3.0 1.0 1.000000 0.0 \n",
"4 4.0 1.0 1.000000 0.0 \n",
"5 5.0 1.0 1.000000 0.0 \n",
"6 6.0 1.0 1.000000 0.0 \n",
"7 7.0 1.0 1.000000 0.0 \n",
"8 8.0 1.0 1.000000 0.0 \n",
"9 9.0 1.0 1.000000 0.0 \n",
"10 10.0 1.0 1.000000 0.0 \n",
"11 11.0 1.0 1.000000 0.0 \n",
"12 12.0 1.0 1.000000 0.0 \n",
"13 13.0 1.0 1.000000 0.0 \n",
"14 14.0 1.0 1.000000 0.0 \n",
"15 15.0 1.0 1.000000 0.0 \n",
"16 16.0 1.0 1.000000 0.0 \n",
"17 17.0 1.0 1.000000 0.0 \n",
"18 18.0 2.0 1.055556 0.0 \n",
"19 19.0 10.0 1.526316 0.0 \n",
"20 20.0 9.0 1.900000 0.0 \n",
"21 21.0 1.0 1.857143 0.0 \n",
"22 22.0 1.0 1.818182 0.0 \n",
"23 23.0 1.0 1.782609 0.0 \n",
"24 24.0 1.0 1.750000 0.0 \n",
"25 25.0 1.0 1.720000 0.0 \n",
"26 26.0 1.0 1.692308 0.0 \n",
"27 27.0 1.0 1.666667 0.0 \n",
"28 28.0 1.0 1.642857 0.0 \n",
"29 29.0 1.0 1.620690 0.0 \n",
"30 30.0 1.0 1.600000 0.0 \n",
"31 31.0 1.0 1.580645 0.0 \n",
"32 32.0 1.0 1.562500 0.0 \n",
"33 33.0 1.0 1.545455 0.0 \n",
"34 34.0 1.0 1.529412 0.0 \n",
"35 35.0 1.0 1.514286 0.0 \n",
"36 36.0 1.0 1.500000 0.0 \n",
"37 37.0 1.0 1.486486 0.0 \n",
"38 38.0 1.0 1.473684 0.0 \n",
"39 39.0 1.0 1.461538 0.0 \n",
"\n",
" code_init \n",
"0 AP \n",
"1 AP \n",
"2 AP \n",
"3 AP \n",
"4 AP \n",
"5 AP \n",
"6 AP \n",
"7 AP \n",
"8 AP \n",
"9 AP \n",
"10 AP \n",
"11 AP \n",
"12 AP \n",
"13 AP \n",
"14 AP \n",
"15 AP \n",
"16 AP \n",
"17 AP \n",
"18 AP \n",
"19 AP \n",
"20 AP \n",
"21 AP \n",
"22 AP \n",
"23 AP \n",
"24 AP \n",
"25 AP \n",
"26 AP \n",
"27 AP \n",
"28 AP \n",
"29 AP \n",
"30 AP \n",
"31 AP \n",
"32 AP \n",
"33 AP \n",
"34 AP \n",
"35 AP \n",
"36 AP \n",
"37 AP \n",
"38 AP \n",
"39 AP \n",
"\n",
"[40 rows x 38 columns]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"select top 40 * from pt\"\"\")\n",
"df"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.9 64-bit",
"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.9.6"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}