{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": 4, "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.64.3',8848)\n", "sess.login('admin','123456')\n" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'/hft_fm_combo': 'pt:2:0:pt_2; ',\n", " '/db_compo_test': 'pt:2:0:pt_2; ',\n", " '/compoDB': 'pt:2:0:pt_2; ',\n", " '/daily_futuremarket_ts': 'db_daily_kline:2:0:db_daily_kline_2; '}" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sess.run('getAllDBs()')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | StockID | \n", "open | \n", "high | \n", "low | \n", "close | \n", "vol | \n", "sectional_vol | \n", "cjbs | \n", "sectional_cjbs | \n", "price | \n", "yclose | \n", "buy_vol | \n", "buy_amount | \n", "sale_vol | \n", "sale_amount | \n", "zmm | \n", "amount | \n", "date | \n", "time1 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | \n", "AP2212 | \n", "8387.0 | \n", "8387.0 | \n", "8387.0 | \n", "8387.0 | \n", "9.0 | \n", "9.0 | \n", "-9.0 | \n", "19565 | \n", "8387.0 | \n", "8413.0 | \n", "4.5 | \n", "37741.5 | \n", "4.5 | \n", "37741.5 | \n", "3 | \n", "75483.0 | \n", "2022-09-19 | \n", "08:59:00 | \n", "
18 | \n", "AP2212 | \n", "8361.0 | \n", "8361.0 | \n", "8361.0 | \n", "8361.0 | \n", "8.0 | \n", "17.0 | \n", "0.0 | \n", "19565 | \n", "8361.0 | \n", "8387.0 | \n", "0.0 | \n", "0.0 | \n", "8.0 | \n", "66892.0 | \n", "2 | \n", "66892.0 | \n", "2022-09-19 | \n", "09:00:00 | \n", "
19 | \n", "AP2212 | \n", "8356.0 | \n", "8356.0 | \n", "8356.0 | \n", "8356.0 | \n", "6.0 | \n", "23.0 | \n", "0.0 | \n", "19565 | \n", "8356.0 | \n", "8361.0 | \n", "0.0 | \n", "0.0 | \n", "6.0 | \n", "50158.0 | \n", "2 | \n", "50158.0 | \n", "2022-09-19 | \n", "09:00:00 | \n", "
25 | \n", "AP2212 | \n", "8356.0 | \n", "8356.0 | \n", "8356.0 | \n", "8356.0 | \n", "1.0 | \n", "24.0 | \n", "0.0 | \n", "19565 | \n", "8356.0 | \n", "8356.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "8347.0 | \n", "2 | \n", "8347.0 | \n", "2022-09-19 | \n", "09:00:05 | \n", "
30 | \n", "AP2212 | \n", "8397.0 | \n", "8397.0 | \n", "8397.0 | \n", "8397.0 | \n", "1.0 | \n", "25.0 | \n", "-1.0 | \n", "19564 | \n", "8397.0 | \n", "8356.0 | \n", "1.0 | \n", "8395.0 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "8395.0 | \n", "2022-09-19 | \n", "09:00:09 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2336544 | \n", "AP2212 | \n", "8744.0 | \n", "8744.0 | \n", "8744.0 | \n", "8744.0 | \n", "1.0 | \n", "2583.0 | \n", "0.0 | \n", "13718 | \n", "8744.0 | \n", "8756.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "8722.0 | \n", "2 | \n", "8722.0 | \n", "2022-11-01 | \n", "09:25:28 | \n", "
2336547 | \n", "AP2212 | \n", "8746.0 | \n", "8746.0 | \n", "8746.0 | \n", "8746.0 | \n", "1.0 | \n", "2584.0 | \n", "0.0 | \n", "13718 | \n", "8746.0 | \n", "8744.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "8722.0 | \n", "2 | \n", "8722.0 | \n", "2022-11-01 | \n", "09:25:34 | \n", "
2336549 | \n", "AP2212 | \n", "8743.0 | \n", "8743.0 | \n", "8743.0 | \n", "8743.0 | \n", "1.0 | \n", "2585.0 | \n", "0.0 | \n", "13718 | \n", "8743.0 | \n", "8746.0 | \n", "0.0 | \n", "0.0 | \n", "1.0 | \n", "8722.0 | \n", "2 | \n", "8722.0 | \n", "2022-11-01 | \n", "09:25:37 | \n", "
2336592 | \n", "AP2212 | \n", "8747.0 | \n", "8747.0 | \n", "8747.0 | \n", "8747.0 | \n", "2.0 | \n", "2587.0 | \n", "0.0 | \n", "13718 | \n", "8747.0 | \n", "8743.0 | \n", "0.0 | \n", "0.0 | \n", "2.0 | \n", "17444.0 | \n", "2 | \n", "17444.0 | \n", "2022-11-01 | \n", "09:26:59 | \n", "
2336594 | \n", "AP2212 | \n", "8747.0 | \n", "8747.0 | \n", "8747.0 | \n", "8747.0 | \n", "3.0 | \n", "2590.0 | \n", "3.0 | \n", "13721 | \n", "8747.0 | \n", "8747.0 | \n", "3.0 | \n", "26166.0 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "26166.0 | \n", "2022-11-01 | \n", "09:27:03 | \n", "
40456 rows × 19 columns
\n", "\n", " | code | \n", "m_nPrice | \n", "m_nOpen | \n", "m_nHigh | \n", "m_nLow | \n", "m_nClose | \n", "m_nAccHigh | \n", "m_nAccLow | \n", "m_iVolume | \n", "m_iAccVolume | \n", "m_nMatchItems | \n", "m_nAccMatchItems | \n", "m_iTurover | \n", "m_iAccTurover | \n", "m_nPreClose | \n", "m_nAccPreClose | \n", "m_nBidPrice | \n", "m_nBidVolume | \n", "m_nAskPrice | \n", "m_nAskVolume | \n", "m_iABFlag | \n", "m_nActBidVolume | \n", "m_nAccActBidVolume | \n", "m_nActBidTurover | \n", "m_nAccActBidTurover | \n", "m_nActAskVolume | \n", "m_nAccActAskVolume | \n", "m_nActAskTurover | \n", "m_nAccActAskTurover | \n", "m_nBidOrder | \n", "m_nAccBidOrder | \n", "m_nAskOrder | \n", "m_nAccAskOrder | \n", "m_nABOrderRate | \n", "m_nAccABOrderRate | \n", "m_nMItemsVolRate | \n", "m_nDate | \n", "m_nTime | \n", "code_init | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "CF2211 | \n", "13400.0 | \n", "13550.0 | \n", "13550.0 | \n", "13400.0 | \n", "13400.0 | \n", "13645.0 | \n", "13400.0 | \n", "28 | \n", "754 | \n", "-22.0 | \n", "4854 | \n", "375910 | \n", "10220470 | \n", "13550.0 | \n", "13580.0 | \n", "13400.0 | \n", "8 | \n", "13550.0 | \n", "20 | \n", "1 | \n", "22.0 | \n", "348.0 | \n", "294580.0 | \n", "4718285.0 | \n", "6.0 | \n", "406.0 | \n", "81330.0 | \n", "5502185.0 | \n", "266.0 | \n", "40331.0 | \n", "324.0 | \n", "4755.0 | \n", "0.400000 | \n", "8.481809 | \n", "0.0 | \n", "2022-10-31 | \n", "09:01:00 | \n", "CF | \n", "
1 | \n", "CF2211 | \n", "13435.0 | \n", "13400.0 | \n", "13545.0 | \n", "13400.0 | \n", "13435.0 | \n", "13645.0 | \n", "13400.0 | \n", "3 | \n", "757 | \n", "-1.0 | \n", "4853 | \n", "40665 | \n", "10261135 | \n", "13400.0 | \n", "13580.0 | \n", "13410.0 | \n", "64 | \n", "13550.0 | \n", "20 | \n", "0 | \n", "2.0 | \n", "350.0 | \n", "27110.0 | \n", "4745395.0 | \n", "1.0 | \n", "407.0 | \n", "13555.0 | \n", "5515740.0 | \n", "741.0 | \n", "41072.0 | \n", "388.0 | \n", "5143.0 | \n", "3.200000 | \n", "7.986000 | \n", "0.0 | \n", "2022-10-31 | \n", "09:02:00 | \n", "CF | \n", "
2 | \n", "CF2211 | \n", "13410.0 | \n", "13435.0 | \n", "13435.0 | \n", "13410.0 | \n", "13410.0 | \n", "13645.0 | \n", "13400.0 | \n", "3 | \n", "760 | \n", "-3.0 | \n", "4850 | \n", "40665 | \n", "10301800 | \n", "13435.0 | \n", "13580.0 | \n", "13410.0 | \n", "62 | \n", "13545.0 | \n", "1 | \n", "0 | \n", "0.0 | \n", "350.0 | \n", "0.0 | \n", "4745395.0 | \n", "3.0 | \n", "410.0 | \n", "40665.0 | \n", "5556405.0 | \n", "1335.0 | \n", "42407.0 | \n", "428.0 | \n", "5571.0 | \n", "62.000000 | \n", "7.612098 | \n", "0.0 | \n", "2022-10-31 | \n", "09:03:00 | \n", "CF | \n", "
3 | \n", "CF2211 | \n", "13545.0 | \n", "13410.0 | \n", "13545.0 | \n", "13410.0 | \n", "13545.0 | \n", "13645.0 | \n", "13400.0 | \n", "3 | \n", "763 | \n", "-1.0 | \n", "4849 | \n", "40665 | \n", "10342465 | \n", "13410.0 | \n", "13580.0 | \n", "13545.0 | \n", "9 | \n", "13550.0 | \n", "37 | \n", "0 | \n", "2.0 | \n", "352.0 | \n", "27110.0 | \n", "4772505.0 | \n", "1.0 | \n", "411.0 | \n", "13555.0 | \n", "5569960.0 | \n", "580.0 | \n", "42987.0 | \n", "278.0 | \n", "5849.0 | \n", "0.243243 | \n", "7.349461 | \n", "0.0 | \n", "2022-10-31 | \n", "09:04:00 | \n", "CF | \n", "
4 | \n", "CF2211 | \n", "13520.0 | \n", "13545.0 | \n", "13545.0 | \n", "13410.0 | \n", "13520.0 | \n", "13645.0 | \n", "13400.0 | \n", "23 | \n", "786 | \n", "-16.0 | \n", "4833 | \n", "311765 | \n", "10654230 | \n", "13545.0 | \n", "13580.0 | \n", "13425.0 | \n", "1 | \n", "13515.0 | \n", "5 | \n", "0 | \n", "8.0 | \n", "360.0 | \n", "108440.0 | \n", "4880945.0 | \n", "15.0 | \n", "426.0 | \n", "203325.0 | \n", "5773285.0 | \n", "759.0 | \n", "43746.0 | \n", "160.0 | \n", "6009.0 | \n", "0.200000 | \n", "7.280080 | \n", "0.0 | \n", "2022-10-31 | \n", "09:05:00 | \n", "CF | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
685 | \n", "CF2211 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13725.0 | \n", "0 | \n", "11 | \n", "0.0 | \n", "1740 | \n", "0 | \n", "151360 | \n", "13810.0 | \n", "13600.0 | \n", "13710.0 | \n", "10 | \n", "13800.0 | \n", "40 | \n", "0 | \n", "0.0 | \n", "11.0 | \n", "0.0 | \n", "151360.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "50.0 | \n", "15596.0 | \n", "200.0 | \n", "13666.0 | \n", "0.250000 | \n", "1.141226 | \n", "0.0 | \n", "2022-11-01 | \n", "22:56:00 | \n", "CF | \n", "
686 | \n", "CF2211 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13725.0 | \n", "0 | \n", "11 | \n", "0.0 | \n", "1740 | \n", "0 | \n", "151360 | \n", "13810.0 | \n", "13600.0 | \n", "13725.0 | \n", "10 | \n", "13800.0 | \n", "40 | \n", "0 | \n", "0.0 | \n", "11.0 | \n", "0.0 | \n", "151360.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "52.0 | \n", "15648.0 | \n", "280.0 | \n", "13946.0 | \n", "0.250000 | \n", "1.122042 | \n", "0.0 | \n", "2022-11-01 | \n", "22:57:00 | \n", "CF | \n", "
687 | \n", "CF2211 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13725.0 | \n", "0 | \n", "11 | \n", "0.0 | \n", "1740 | \n", "0 | \n", "151360 | \n", "13810.0 | \n", "13600.0 | \n", "13725.0 | \n", "10 | \n", "13800.0 | \n", "40 | \n", "0 | \n", "0.0 | \n", "11.0 | \n", "0.0 | \n", "151360.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "20.0 | \n", "15668.0 | \n", "80.0 | \n", "14026.0 | \n", "0.250000 | \n", "1.117068 | \n", "0.0 | \n", "2022-11-01 | \n", "22:58:00 | \n", "CF | \n", "
688 | \n", "CF2211 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13725.0 | \n", "0 | \n", "11 | \n", "0.0 | \n", "1740 | \n", "0 | \n", "151360 | \n", "13810.0 | \n", "13600.0 | \n", "13725.0 | \n", "10 | \n", "13800.0 | \n", "40 | \n", "0 | \n", "0.0 | \n", "11.0 | \n", "0.0 | \n", "151360.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "20.0 | \n", "15688.0 | \n", "80.0 | \n", "14106.0 | \n", "0.250000 | \n", "1.112151 | \n", "0.0 | \n", "2022-11-01 | \n", "22:59:00 | \n", "CF | \n", "
689 | \n", "CF2211 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13810.0 | \n", "13725.0 | \n", "0 | \n", "11 | \n", "0.0 | \n", "1740 | \n", "0 | \n", "151360 | \n", "13810.0 | \n", "13600.0 | \n", "13740.0 | \n", "10 | \n", "13800.0 | \n", "40 | \n", "0 | \n", "0.0 | \n", "11.0 | \n", "0.0 | \n", "151360.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "84.0 | \n", "15772.0 | \n", "360.0 | \n", "14466.0 | \n", "0.250000 | \n", "1.090281 | \n", "0.0 | \n", "2022-11-01 | \n", "23:00:00 | \n", "CF | \n", "
690 rows × 39 columns
\n", "