{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "a4915372-8508-45ce-ba31-8aef7c5b0ef1",
"metadata": {},
"outputs": [],
"source": [
"import dolphindb as ddb\n",
"\n",
"sess = ddb.session('localhost', 8848)\n",
"sess.login('admin', '123456')"
]
},
{
"cell_type": "code",
"execution_count": 108,
"id": "ebd3b848-e0ce-4d0f-94f7-78a687040e80",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" dow | \n",
" moy | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 2 | \n",
" 1 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" 3 | \n",
" 1 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-06 | \n",
" 4 | \n",
" 1 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-10 | \n",
" 1 | \n",
" 1 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 95 | \n",
" 000400.SZ | \n",
" 2011-01-25 | \n",
" 1 | \n",
" 1 | \n",
"
\n",
" \n",
" 96 | \n",
" 000400.SZ | \n",
" 2011-01-26 | \n",
" 2 | \n",
" 1 | \n",
"
\n",
" \n",
" 97 | \n",
" 000400.SZ | \n",
" 2011-01-27 | \n",
" 3 | \n",
" 1 | \n",
"
\n",
" \n",
" 98 | \n",
" 000400.SZ | \n",
" 2011-01-28 | \n",
" 4 | \n",
" 1 | \n",
"
\n",
" \n",
" 99 | \n",
" 000400.SZ | \n",
" 2011-01-31 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
"
\n",
"
100 rows × 4 columns
\n",
"
"
],
"text/plain": [
" code m_nDate dow moy\n",
"0 000400.SZ 2006-01-04 2 1\n",
"1 000400.SZ 2006-01-05 3 1\n",
"2 000400.SZ 2006-01-06 4 1\n",
"3 000400.SZ 2006-01-09 0 1\n",
"4 000400.SZ 2006-01-10 1 1\n",
".. ... ... ... ...\n",
"95 000400.SZ 2011-01-25 1 1\n",
"96 000400.SZ 2011-01-26 2 1\n",
"97 000400.SZ 2011-01-27 3 1\n",
"98 000400.SZ 2011-01-28 4 1\n",
"99 000400.SZ 2011-01-31 0 1\n",
"\n",
"[100 rows x 4 columns]"
]
},
"execution_count": 108,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select top 100 code, m_nDate, dayOfWeek(m_nDate) as dow, monthOfYear(m_nDate) as moy \n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" where monthOfYear(m_nDate) = 1\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 92,
"id": "ae07f021-409d-4b8b-8676-ff2a0f54bb34",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" vol_20 | \n",
"
\n",
" \n",
" \n",
" \n",
" 2776841 | \n",
" 600000.SH | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 2776842 | \n",
" 600000.SH | \n",
" 2006-01-05 | \n",
" NaN | \n",
"
\n",
" \n",
" 2776843 | \n",
" 600000.SH | \n",
" 2006-01-06 | \n",
" NaN | \n",
"
\n",
" \n",
" 2776844 | \n",
" 600000.SH | \n",
" 2006-01-09 | \n",
" NaN | \n",
"
\n",
" \n",
" 2776845 | \n",
" 600000.SH | \n",
" 2006-01-10 | \n",
" NaN | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 2780773 | \n",
" 600000.SH | \n",
" 2022-08-04 | \n",
" 0.291758 | \n",
"
\n",
" \n",
" 2780774 | \n",
" 600000.SH | \n",
" 2022-08-05 | \n",
" 0.289024 | \n",
"
\n",
" \n",
" 2780775 | \n",
" 600000.SH | \n",
" 2022-08-08 | \n",
" 0.283952 | \n",
"
\n",
" \n",
" 2780776 | \n",
" 600000.SH | \n",
" 2022-08-09 | \n",
" 0.270085 | \n",
"
\n",
" \n",
" 2780777 | \n",
" 600000.SH | \n",
" 2022-08-10 | \n",
" 0.256963 | \n",
"
\n",
" \n",
"
\n",
"
3937 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate vol_20\n",
"2776841 600000.SH 2006-01-04 NaN\n",
"2776842 600000.SH 2006-01-05 NaN\n",
"2776843 600000.SH 2006-01-06 NaN\n",
"2776844 600000.SH 2006-01-09 NaN\n",
"2776845 600000.SH 2006-01-10 NaN\n",
"... ... ... ...\n",
"2780773 600000.SH 2022-08-04 0.291758\n",
"2780774 600000.SH 2022-08-05 0.289024\n",
"2780775 600000.SH 2022-08-08 0.283952\n",
"2780776 600000.SH 2022-08-09 0.270085\n",
"2780777 600000.SH 2022-08-10 0.256963\n",
"\n",
"[3937 rows x 3 columns]"
]
},
"execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
" vol_20 = select code, m_nDate, mstdp(close, 20, 9) as vol_20\n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" context by code;\n",
" vol_20\n",
"\"\"\")\n",
"df[df['code'] == '600000.SH']"
]
},
{
"cell_type": "code",
"execution_count": 79,
"id": "cffabf93-81d3-4075-b80a-1c761ccd95b6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" rank_vol_20 | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" 000515.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 2 | \n",
" 000558.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 3 | \n",
" 000602.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 4 | \n",
" 000731.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 688272.SH | \n",
" 2022-08-10 | \n",
" 0.901734 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 688320.SH | \n",
" 2022-08-10 | \n",
" 0.985756 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 688739.SH | \n",
" 2022-08-10 | \n",
" 0.707267 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 688777.SH | \n",
" 2022-08-10 | \n",
" 0.960776 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-10 | \n",
" 0.021263 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate rank_vol_20\n",
"0 000400.SZ 2006-01-04 NaN\n",
"1 000515.SZ 2006-01-04 NaN\n",
"2 000558.SZ 2006-01-04 NaN\n",
"3 000602.SZ 2006-01-04 NaN\n",
"4 000731.SZ 2006-01-04 NaN\n",
"... ... ... ...\n",
"10403520 688272.SH 2022-08-10 0.901734\n",
"10403521 688320.SH 2022-08-10 0.985756\n",
"10403522 688739.SH 2022-08-10 0.707267\n",
"10403523 688777.SH 2022-08-10 0.960776\n",
"10403524 830964.NE 2022-08-10 0.021263\n",
"\n",
"[10403525 rows x 3 columns]"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
" rank_vol_20 = select code, m_nDate, rank(vol_20, tiesMethod='average', percent=true)\n",
" from vol_20 context by m_nDate;\n",
" rank_vol_20\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 80,
"id": "f10dd713-e516-48bc-a232-f1570eef03ff",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" rank_vol_20 | \n",
"
\n",
" \n",
" \n",
" \n",
" 2295890 | \n",
" 000400.SZ | \n",
" 2012-01-05 | \n",
" 0.932731 | \n",
"
\n",
" \n",
" 2295891 | \n",
" 000558.SZ | \n",
" 2012-01-05 | \n",
" 0.191422 | \n",
"
\n",
" \n",
" 2295892 | \n",
" 000602.SZ | \n",
" 2012-01-05 | \n",
" 0.367946 | \n",
"
\n",
" \n",
" 2295893 | \n",
" 000731.SZ | \n",
" 2012-01-05 | \n",
" 0.252370 | \n",
"
\n",
" \n",
" 2295894 | \n",
" 000752.SZ | \n",
" 2012-01-05 | \n",
" 0.734537 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 2298104 | \n",
" 600586.SH | \n",
" 2012-01-05 | \n",
" 0.126862 | \n",
"
\n",
" \n",
" 2298105 | \n",
" 600660.SH | \n",
" 2012-01-05 | \n",
" 0.031603 | \n",
"
\n",
" \n",
" 2298106 | \n",
" 601299.SH | \n",
" 2012-01-05 | \n",
" 0.127765 | \n",
"
\n",
" \n",
" 2298107 | \n",
" 601788.SH | \n",
" 2012-01-05 | \n",
" 0.419413 | \n",
"
\n",
" \n",
" 2298108 | \n",
" 601988.SH | \n",
" 2012-01-05 | \n",
" 0.000451 | \n",
"
\n",
" \n",
"
\n",
"
2219 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate rank_vol_20\n",
"2295890 000400.SZ 2012-01-05 0.932731\n",
"2295891 000558.SZ 2012-01-05 0.191422\n",
"2295892 000602.SZ 2012-01-05 0.367946\n",
"2295893 000731.SZ 2012-01-05 0.252370\n",
"2295894 000752.SZ 2012-01-05 0.734537\n",
"... ... ... ...\n",
"2298104 600586.SH 2012-01-05 0.126862\n",
"2298105 600660.SH 2012-01-05 0.031603\n",
"2298106 601299.SH 2012-01-05 0.127765\n",
"2298107 601788.SH 2012-01-05 0.419413\n",
"2298108 601988.SH 2012-01-05 0.000451\n",
"\n",
"[2219 rows x 3 columns]"
]
},
"execution_count": 80,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df['m_nDate'] == '2012-01-05']"
]
},
{
"cell_type": "code",
"execution_count": 84,
"id": "972934f5-35c7-4874-b990-4ce0f9d58965",
"metadata": {},
"outputs": [],
"source": [
"df = sess.run(\"\"\"\n",
" corr_5 = select code, m_nDate, mcorr(high, vol, 5) as corr_5\n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" context by code;\n",
" corr_5\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 91,
"id": "d3442f93-3beb-40c1-92c1-7f2d2d0e8ec3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" delta_corr_5 | \n",
"
\n",
" \n",
" \n",
" \n",
" 5873882 | \n",
" 600000.SH | \n",
" 2006-01-11 | \n",
" NaN | \n",
"
\n",
" \n",
" 5873883 | \n",
" 600000.SH | \n",
" 2006-01-12 | \n",
" NaN | \n",
"
\n",
" \n",
" 5873884 | \n",
" 600000.SH | \n",
" 2006-01-13 | \n",
" NaN | \n",
"
\n",
" \n",
" 5873885 | \n",
" 600000.SH | \n",
" 2006-01-16 | \n",
" 0.111578 | \n",
"
\n",
" \n",
" 5873886 | \n",
" 600000.SH | \n",
" 2006-01-17 | \n",
" 0.053048 | \n",
"
\n",
" \n",
" 5873887 | \n",
" 600000.SH | \n",
" 2006-01-18 | \n",
" 0.680933 | \n",
"
\n",
" \n",
" 5873888 | \n",
" 600000.SH | \n",
" 2006-01-19 | \n",
" -0.530191 | \n",
"
\n",
" \n",
" 5873889 | \n",
" 600000.SH | \n",
" 2006-01-20 | \n",
" -0.283952 | \n",
"
\n",
" \n",
" 5873890 | \n",
" 600000.SH | \n",
" 2006-01-23 | \n",
" -0.295373 | \n",
"
\n",
" \n",
" 5873891 | \n",
" 600000.SH | \n",
" 2006-01-24 | \n",
" -0.105135 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" code m_nDate delta_corr_5\n",
"5873882 600000.SH 2006-01-11 NaN\n",
"5873883 600000.SH 2006-01-12 NaN\n",
"5873884 600000.SH 2006-01-13 NaN\n",
"5873885 600000.SH 2006-01-16 0.111578\n",
"5873886 600000.SH 2006-01-17 0.053048\n",
"5873887 600000.SH 2006-01-18 0.680933\n",
"5873888 600000.SH 2006-01-19 -0.530191\n",
"5873889 600000.SH 2006-01-20 -0.283952\n",
"5873890 600000.SH 2006-01-23 -0.295373\n",
"5873891 600000.SH 2006-01-24 -0.105135"
]
},
"execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
" delta_corr_5 = select code, m_nDate, mfirst(corr_5, 5) - corr_5 as delta_corr_5\n",
" from corr_5 context by code;\n",
" delta_corr_5\n",
"\"\"\")\n",
"df[df['code'] == '600000.SH'].iloc[5:15]"
]
},
{
"cell_type": "code",
"execution_count": 93,
"id": "b70d0329-0f82-4fef-a6e1-faf2068e85f4",
"metadata": {},
"outputs": [],
"source": [
"df = sess.run(\"\"\"\n",
" alpha101_22 = select code, m_nDate, delta_corr_5 * rank_vol_20 as alpha101_22\n",
" from ej(rank_vol_20, delta_corr_5, `code`m_nDate);\n",
" alpha101_22\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 94,
"id": "4fbb58eb-58fa-40d9-a0e8-32e9b4868629",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" alpha101_22 | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" 000515.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 2 | \n",
" 000558.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 3 | \n",
" 000602.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 4 | \n",
" 000731.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 688272.SH | \n",
" 2022-08-10 | \n",
" 0.280800 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 688320.SH | \n",
" 2022-08-10 | \n",
" 0.464768 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 688739.SH | \n",
" 2022-08-10 | \n",
" 0.054898 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 688777.SH | \n",
" 2022-08-10 | \n",
" 0.427098 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-10 | \n",
" -0.016451 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate alpha101_22\n",
"0 000400.SZ 2006-01-04 NaN\n",
"1 000515.SZ 2006-01-04 NaN\n",
"2 000558.SZ 2006-01-04 NaN\n",
"3 000602.SZ 2006-01-04 NaN\n",
"4 000731.SZ 2006-01-04 NaN\n",
"... ... ... ...\n",
"10403520 688272.SH 2022-08-10 0.280800\n",
"10403521 688320.SH 2022-08-10 0.464768\n",
"10403522 688739.SH 2022-08-10 0.054898\n",
"10403523 688777.SH 2022-08-10 0.427098\n",
"10403524 830964.NE 2022-08-10 -0.016451\n",
"\n",
"[10403525 rows x 3 columns]"
]
},
"execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "f211d667-4932-457e-9051-667607f8a105",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" month_of_year | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 1 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" 1 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-06 | \n",
" 1 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 1 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-10 | \n",
" 1 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 95 | \n",
" 000400.SZ | \n",
" 2006-06-06 | \n",
" 6 | \n",
"
\n",
" \n",
" 96 | \n",
" 000400.SZ | \n",
" 2006-06-07 | \n",
" 6 | \n",
"
\n",
" \n",
" 97 | \n",
" 000400.SZ | \n",
" 2006-06-08 | \n",
" 6 | \n",
"
\n",
" \n",
" 98 | \n",
" 000400.SZ | \n",
" 2006-06-09 | \n",
" 6 | \n",
"
\n",
" \n",
" 99 | \n",
" 000400.SZ | \n",
" 2006-06-12 | \n",
" 6 | \n",
"
\n",
" \n",
"
\n",
"
100 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate month_of_year\n",
"0 000400.SZ 2006-01-04 1\n",
"1 000400.SZ 2006-01-05 1\n",
"2 000400.SZ 2006-01-06 1\n",
"3 000400.SZ 2006-01-09 1\n",
"4 000400.SZ 2006-01-10 1\n",
".. ... ... ...\n",
"95 000400.SZ 2006-06-06 6\n",
"96 000400.SZ 2006-06-07 6\n",
"97 000400.SZ 2006-06-08 6\n",
"98 000400.SZ 2006-06-09 6\n",
"99 000400.SZ 2006-06-12 6\n",
"\n",
"[100 rows x 3 columns]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select top 100 code, m_nDate, monthOfYear(m_nDate) as month_of_year \n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 97,
"id": "fc62191a-94f6-4172-a2a2-39907d94e6b5",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" trend_with_turnover | \n",
" trend_with_amount | \n",
" abs_trend_with_turnover | \n",
" abs_trend_with_amount | \n",
" alpha101_22 | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" NaN | \n",
" 0.082185 | \n",
" 0.101943 | \n",
" 0.082185 | \n",
" 0.101943 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" NaN | \n",
" 0.006255 | \n",
" 0.024839 | \n",
" 0.006255 | \n",
" 0.024839 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-06 | \n",
" NaN | \n",
" -0.004377 | \n",
" -0.011194 | \n",
" 0.004377 | \n",
" 0.011194 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" NaN | \n",
" 0.029549 | \n",
" 0.066196 | \n",
" 0.029549 | \n",
" 0.066196 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-10 | \n",
" NaN | \n",
" 0.011716 | \n",
" 0.013202 | \n",
" 0.011716 | \n",
" 0.013202 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 95 | \n",
" 000400.SZ | \n",
" 2006-06-06 | \n",
" 0.121066 | \n",
" 0.021408 | \n",
" -0.019479 | \n",
" -0.021408 | \n",
" 0.019479 | \n",
"
\n",
" \n",
" 96 | \n",
" 000400.SZ | \n",
" 2006-06-07 | \n",
" 0.091073 | \n",
" 0.099845 | \n",
" -0.084317 | \n",
" -0.099845 | \n",
" 0.084317 | \n",
"
\n",
" \n",
" 97 | \n",
" 000400.SZ | \n",
" 2006-06-08 | \n",
" -0.336859 | \n",
" 0.007474 | \n",
" -0.006340 | \n",
" -0.007474 | \n",
" 0.006340 | \n",
"
\n",
" \n",
" 98 | \n",
" 000400.SZ | \n",
" 2006-06-09 | \n",
" -0.453049 | \n",
" -0.005057 | \n",
" 0.002774 | \n",
" -0.005057 | \n",
" 0.002774 | \n",
"
\n",
" \n",
" 99 | \n",
" 000400.SZ | \n",
" 2006-06-12 | \n",
" -0.244429 | \n",
" -0.007322 | \n",
" 0.006228 | \n",
" -0.007322 | \n",
" 0.006228 | \n",
"
\n",
" \n",
"
\n",
"
100 rows × 7 columns
\n",
"
"
],
"text/plain": [
" code m_nDate trend_with_turnover trend_with_amount \\\n",
"0 000400.SZ 2006-01-04 NaN 0.082185 \n",
"1 000400.SZ 2006-01-05 NaN 0.006255 \n",
"2 000400.SZ 2006-01-06 NaN -0.004377 \n",
"3 000400.SZ 2006-01-09 NaN 0.029549 \n",
"4 000400.SZ 2006-01-10 NaN 0.011716 \n",
".. ... ... ... ... \n",
"95 000400.SZ 2006-06-06 0.121066 0.021408 \n",
"96 000400.SZ 2006-06-07 0.091073 0.099845 \n",
"97 000400.SZ 2006-06-08 -0.336859 0.007474 \n",
"98 000400.SZ 2006-06-09 -0.453049 -0.005057 \n",
"99 000400.SZ 2006-06-12 -0.244429 -0.007322 \n",
"\n",
" abs_trend_with_turnover abs_trend_with_amount alpha101_22 \n",
"0 0.101943 0.082185 0.101943 \n",
"1 0.024839 0.006255 0.024839 \n",
"2 -0.011194 0.004377 0.011194 \n",
"3 0.066196 0.029549 0.066196 \n",
"4 0.013202 0.011716 0.013202 \n",
".. ... ... ... \n",
"95 -0.019479 -0.021408 0.019479 \n",
"96 -0.084317 -0.099845 0.084317 \n",
"97 -0.006340 -0.007474 0.006340 \n",
"98 0.002774 -0.005057 0.002774 \n",
"99 0.006228 -0.007322 0.006228 \n",
"\n",
"[100 rows x 7 columns]"
]
},
"execution_count": 97,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select top 100 * \n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_factor\")\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "081d51c7-f9d5-4493-bc16-a03945d1e4c2",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" open | \n",
" high | \n",
" low | \n",
" close | \n",
" IsZt | \n",
" IsT | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000622.SZ | \n",
" 2018-10-10 | \n",
" 3.17 | \n",
" 3.20 | \n",
" 3.11 | \n",
" 3.13 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 1 | \n",
" 000622.SZ | \n",
" 2018-10-11 | \n",
" 3.02 | \n",
" 3.11 | \n",
" 2.82 | \n",
" 2.83 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 2 | \n",
" 000622.SZ | \n",
" 2018-10-12 | \n",
" 2.85 | \n",
" 2.86 | \n",
" 2.62 | \n",
" 2.77 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 3 | \n",
" 000622.SZ | \n",
" 2018-10-15 | \n",
" 2.80 | \n",
" 2.87 | \n",
" 2.73 | \n",
" 2.73 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 4 | \n",
" 000622.SZ | \n",
" 2018-10-16 | \n",
" 2.73 | \n",
" 2.81 | \n",
" 2.60 | \n",
" 2.67 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 5 | \n",
" 000622.SZ | \n",
" 2018-10-17 | \n",
" 2.71 | \n",
" 2.74 | \n",
" 2.57 | \n",
" 2.66 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 6 | \n",
" 000622.SZ | \n",
" 2018-10-18 | \n",
" 2.67 | \n",
" 2.67 | \n",
" 2.46 | \n",
" 2.50 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 7 | \n",
" 000622.SZ | \n",
" 2018-10-19 | \n",
" 2.42 | \n",
" 2.59 | \n",
" 2.42 | \n",
" 2.58 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
" 8 | \n",
" 000622.SZ | \n",
" 2018-10-22 | \n",
" 2.84 | \n",
" 2.84 | \n",
" 2.84 | \n",
" 2.84 | \n",
" 1 | \n",
" False | \n",
"
\n",
" \n",
" 9 | \n",
" 000622.SZ | \n",
" 2018-10-23 | \n",
" 3.12 | \n",
" 3.12 | \n",
" 2.84 | \n",
" 3.12 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 10 | \n",
" 000622.SZ | \n",
" 2018-10-24 | \n",
" 3.13 | \n",
" 3.43 | \n",
" 3.02 | \n",
" 3.43 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 11 | \n",
" 000622.SZ | \n",
" 2018-10-25 | \n",
" 3.70 | \n",
" 3.77 | \n",
" 3.61 | \n",
" 3.77 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 12 | \n",
" 000622.SZ | \n",
" 2018-10-26 | \n",
" 4.15 | \n",
" 4.15 | \n",
" 4.15 | \n",
" 4.15 | \n",
" 1 | \n",
" False | \n",
"
\n",
" \n",
" 13 | \n",
" 000622.SZ | \n",
" 2018-10-29 | \n",
" 4.30 | \n",
" 4.57 | \n",
" 4.25 | \n",
" 4.57 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 14 | \n",
" 000622.SZ | \n",
" 2018-10-30 | \n",
" 4.58 | \n",
" 5.03 | \n",
" 4.46 | \n",
" 5.03 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 15 | \n",
" 000622.SZ | \n",
" 2018-11-05 | \n",
" 5.53 | \n",
" 5.53 | \n",
" 5.53 | \n",
" 5.53 | \n",
" 1 | \n",
" False | \n",
"
\n",
" \n",
" 16 | \n",
" 000622.SZ | \n",
" 2018-11-06 | \n",
" 6.08 | \n",
" 6.08 | \n",
" 6.08 | \n",
" 6.08 | \n",
" 1 | \n",
" False | \n",
"
\n",
" \n",
" 17 | \n",
" 000622.SZ | \n",
" 2018-11-07 | \n",
" 6.45 | \n",
" 6.69 | \n",
" 6.33 | \n",
" 6.69 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 18 | \n",
" 000622.SZ | \n",
" 2018-11-08 | \n",
" 7.25 | \n",
" 7.36 | \n",
" 6.98 | \n",
" 7.36 | \n",
" 1 | \n",
" True | \n",
"
\n",
" \n",
" 19 | \n",
" 000622.SZ | \n",
" 2018-11-09 | \n",
" 7.38 | \n",
" 8.10 | \n",
" 7.26 | \n",
" 7.90 | \n",
" 0 | \n",
" False | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" code m_nDate open high low close IsZt IsT\n",
"0 000622.SZ 2018-10-10 3.17 3.20 3.11 3.13 0 False\n",
"1 000622.SZ 2018-10-11 3.02 3.11 2.82 2.83 0 False\n",
"2 000622.SZ 2018-10-12 2.85 2.86 2.62 2.77 0 False\n",
"3 000622.SZ 2018-10-15 2.80 2.87 2.73 2.73 0 False\n",
"4 000622.SZ 2018-10-16 2.73 2.81 2.60 2.67 0 False\n",
"5 000622.SZ 2018-10-17 2.71 2.74 2.57 2.66 0 False\n",
"6 000622.SZ 2018-10-18 2.67 2.67 2.46 2.50 0 False\n",
"7 000622.SZ 2018-10-19 2.42 2.59 2.42 2.58 0 False\n",
"8 000622.SZ 2018-10-22 2.84 2.84 2.84 2.84 1 False\n",
"9 000622.SZ 2018-10-23 3.12 3.12 2.84 3.12 1 True\n",
"10 000622.SZ 2018-10-24 3.13 3.43 3.02 3.43 1 True\n",
"11 000622.SZ 2018-10-25 3.70 3.77 3.61 3.77 1 True\n",
"12 000622.SZ 2018-10-26 4.15 4.15 4.15 4.15 1 False\n",
"13 000622.SZ 2018-10-29 4.30 4.57 4.25 4.57 1 True\n",
"14 000622.SZ 2018-10-30 4.58 5.03 4.46 5.03 1 True\n",
"15 000622.SZ 2018-11-05 5.53 5.53 5.53 5.53 1 False\n",
"16 000622.SZ 2018-11-06 6.08 6.08 6.08 6.08 1 False\n",
"17 000622.SZ 2018-11-07 6.45 6.69 6.33 6.69 1 True\n",
"18 000622.SZ 2018-11-08 7.25 7.36 6.98 7.36 1 True\n",
"19 000622.SZ 2018-11-09 7.38 8.10 7.26 7.90 0 False"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select code, m_nDate, open, high, low, close, IsZt, \\\n",
" (IsZt and high=close and low!=close) as IsT \\\n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\") \n",
" where code='000622.SZ' and m_nDate>=2018.10.10 and m_nDate<=2018.11.10\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "14c51fe0-3791-4f5b-8ccc-bfd43f0f5be9",
"metadata": {},
"outputs": [],
"source": [
"sess.run(\"\"\"\n",
" t1 = select code, m_nDate, amount/vol as vwap from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\") \n",
" where code='000400.SZ' and m_nDate>=2014.01.04 and m_nDate<=2014.02.04;\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "29bc4089-4df1-4bea-800f-d01e893d08bd",
"metadata": {},
"outputs": [],
"source": [
"sess.run(\"\"\"\n",
" t2 = select code, m_nDate, vwap from loadTable(\"dfs://daily_stock_ts\", \"hft_daily_factor\")\n",
" where code='000400.SZ' and m_nDate>=2014.01.04 and m_nDate<=2014.02.04\n",
"\"\"\") "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b98b12d4-1068-4c98-8374-bbc1adce01a3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" vwap | \n",
" t2_vwap | \n",
" vwap_sub | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2014-01-06 | \n",
" 30.628533 | \n",
" 30.982086 | \n",
" -0.353552 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2014-01-07 | \n",
" 33.004000 | \n",
" 32.612976 | \n",
" 0.391024 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2014-01-08 | \n",
" 32.908724 | \n",
" 32.610945 | \n",
" 0.297780 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2014-01-09 | \n",
" 33.563315 | \n",
" 33.736282 | \n",
" -0.172967 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2014-01-10 | \n",
" 32.012339 | \n",
" 32.273132 | \n",
" -0.260793 | \n",
"
\n",
" \n",
" 5 | \n",
" 000400.SZ | \n",
" 2014-01-13 | \n",
" 32.301440 | \n",
" 32.113160 | \n",
" 0.188280 | \n",
"
\n",
" \n",
" 6 | \n",
" 000400.SZ | \n",
" 2014-01-14 | \n",
" 32.495571 | \n",
" 32.781237 | \n",
" -0.285666 | \n",
"
\n",
" \n",
" 7 | \n",
" 000400.SZ | \n",
" 2014-01-15 | \n",
" 33.791427 | \n",
" 33.750742 | \n",
" 0.040686 | \n",
"
\n",
" \n",
" 8 | \n",
" 000400.SZ | \n",
" 2014-01-16 | \n",
" 34.695708 | \n",
" 34.871143 | \n",
" -0.175435 | \n",
"
\n",
" \n",
" 9 | \n",
" 000400.SZ | \n",
" 2014-01-17 | \n",
" 33.910330 | \n",
" 33.978306 | \n",
" -0.067975 | \n",
"
\n",
" \n",
" 10 | \n",
" 000400.SZ | \n",
" 2014-01-20 | \n",
" 33.707389 | \n",
" 33.731507 | \n",
" -0.024118 | \n",
"
\n",
" \n",
" 11 | \n",
" 000400.SZ | \n",
" 2014-01-21 | \n",
" 33.338210 | \n",
" 33.663293 | \n",
" -0.325083 | \n",
"
\n",
" \n",
" 12 | \n",
" 000400.SZ | \n",
" 2014-01-22 | \n",
" 34.046440 | \n",
" 33.657111 | \n",
" 0.389329 | \n",
"
\n",
" \n",
" 13 | \n",
" 000400.SZ | \n",
" 2014-01-23 | \n",
" 34.028093 | \n",
" 34.028356 | \n",
" -0.000263 | \n",
"
\n",
" \n",
" 14 | \n",
" 000400.SZ | \n",
" 2014-01-24 | \n",
" 33.919916 | \n",
" 33.879026 | \n",
" 0.040890 | \n",
"
\n",
" \n",
" 15 | \n",
" 000400.SZ | \n",
" 2014-01-27 | \n",
" 34.104556 | \n",
" 33.949844 | \n",
" 0.154712 | \n",
"
\n",
" \n",
" 16 | \n",
" 000400.SZ | \n",
" 2014-01-28 | \n",
" 33.926302 | \n",
" 34.179352 | \n",
" -0.253050 | \n",
"
\n",
" \n",
" 17 | \n",
" 000400.SZ | \n",
" 2014-01-29 | \n",
" 34.046293 | \n",
" 33.917053 | \n",
" 0.129240 | \n",
"
\n",
" \n",
" 18 | \n",
" 000400.SZ | \n",
" 2014-01-30 | \n",
" 34.041070 | \n",
" 34.464937 | \n",
" -0.423867 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" code m_nDate vwap t2_vwap vwap_sub\n",
"0 000400.SZ 2014-01-06 30.628533 30.982086 -0.353552\n",
"1 000400.SZ 2014-01-07 33.004000 32.612976 0.391024\n",
"2 000400.SZ 2014-01-08 32.908724 32.610945 0.297780\n",
"3 000400.SZ 2014-01-09 33.563315 33.736282 -0.172967\n",
"4 000400.SZ 2014-01-10 32.012339 32.273132 -0.260793\n",
"5 000400.SZ 2014-01-13 32.301440 32.113160 0.188280\n",
"6 000400.SZ 2014-01-14 32.495571 32.781237 -0.285666\n",
"7 000400.SZ 2014-01-15 33.791427 33.750742 0.040686\n",
"8 000400.SZ 2014-01-16 34.695708 34.871143 -0.175435\n",
"9 000400.SZ 2014-01-17 33.910330 33.978306 -0.067975\n",
"10 000400.SZ 2014-01-20 33.707389 33.731507 -0.024118\n",
"11 000400.SZ 2014-01-21 33.338210 33.663293 -0.325083\n",
"12 000400.SZ 2014-01-22 34.046440 33.657111 0.389329\n",
"13 000400.SZ 2014-01-23 34.028093 34.028356 -0.000263\n",
"14 000400.SZ 2014-01-24 33.919916 33.879026 0.040890\n",
"15 000400.SZ 2014-01-27 34.104556 33.949844 0.154712\n",
"16 000400.SZ 2014-01-28 33.926302 34.179352 -0.253050\n",
"17 000400.SZ 2014-01-29 34.046293 33.917053 0.129240\n",
"18 000400.SZ 2014-01-30 34.041070 34.464937 -0.423867"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select *, t1.vwap-t2.vwap from ej(t1, t2, `code`m_nDate)\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "b0543222-4201-4ca7-8a38-2f561adecd76",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" winsorize | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 0.191026 | \n",
"
\n",
" \n",
" 1 | \n",
" 0.082927 | \n",
"
\n",
" \n",
" 2 | \n",
" 0.143954 | \n",
"
\n",
" \n",
" 3 | \n",
" -0.060634 | \n",
"
\n",
" \n",
" 4 | \n",
" 0.014164 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 3932 | \n",
" 0.014144 | \n",
"
\n",
" \n",
" 3933 | \n",
" 0.042313 | \n",
"
\n",
" \n",
" 3934 | \n",
" -0.020979 | \n",
"
\n",
" \n",
" 3935 | \n",
" 0.000000 | \n",
"
\n",
" \n",
" 3936 | \n",
" -0.021067 | \n",
"
\n",
" \n",
"
\n",
"
3937 rows × 1 columns
\n",
"
"
],
"text/plain": [
" winsorize\n",
"0 0.191026\n",
"1 0.082927\n",
"2 0.143954\n",
"3 -0.060634\n",
"4 0.014164\n",
"... ...\n",
"3932 0.014144\n",
"3933 0.042313\n",
"3934 -0.020979\n",
"3935 0.000000\n",
"3936 -0.021067\n",
"\n",
"[3937 rows x 1 columns]"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" t1 = select winsorize(PctChg/20, 0.05) from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\") where code=\"600000.SH\";\n",
" t1;\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "4d0ac236-d2b3-4724-9f89-040d85e95221",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" amount | \n",
" amount_rank | \n",
" amount_with_trend | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 3.265679e+07 | \n",
" 0.410321 | \n",
" 0.661152 | \n",
"
\n",
" \n",
" 1 | \n",
" 000515.SZ | \n",
" 2006-01-04 | \n",
" 9.116335e+06 | \n",
" 0.177665 | \n",
" 0.462941 | \n",
"
\n",
" \n",
" 2 | \n",
" 000558.SZ | \n",
" 2006-01-04 | \n",
" 2.417575e+06 | \n",
" -0.231810 | \n",
" 0.209710 | \n",
"
\n",
" \n",
" 3 | \n",
" 000602.SZ | \n",
" 2006-01-04 | \n",
" 1.767682e+07 | \n",
" 0.314721 | \n",
" 0.705630 | \n",
"
\n",
" \n",
" 4 | \n",
" 000731.SZ | \n",
" 2006-01-04 | \n",
" 1.402217e+07 | \n",
" 0.272420 | \n",
" 0.675770 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 688272.SH | \n",
" 2022-08-10 | \n",
" 7.012509e+07 | \n",
" -0.014727 | \n",
" 0.271909 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 688320.SH | \n",
" 2022-08-10 | \n",
" 1.067048e+08 | \n",
" 0.101442 | \n",
" 0.561355 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 688739.SH | \n",
" 2022-08-10 | \n",
" 1.035707e+07 | \n",
" -0.442122 | \n",
" 0.030941 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 688777.SH | \n",
" 2022-08-10 | \n",
" 4.529292e+08 | \n",
" 0.394336 | \n",
" 0.751877 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-10 | \n",
" 5.583561e+05 | \n",
" -0.493409 | \n",
" 0.002081 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 5 columns
\n",
"
"
],
"text/plain": [
" code m_nDate amount amount_rank amount_with_trend\n",
"0 000400.SZ 2006-01-04 3.265679e+07 0.410321 0.661152\n",
"1 000515.SZ 2006-01-04 9.116335e+06 0.177665 0.462941\n",
"2 000558.SZ 2006-01-04 2.417575e+06 -0.231810 0.209710\n",
"3 000602.SZ 2006-01-04 1.767682e+07 0.314721 0.705630\n",
"4 000731.SZ 2006-01-04 1.402217e+07 0.272420 0.675770\n",
"... ... ... ... ... ...\n",
"10403520 688272.SH 2022-08-10 7.012509e+07 -0.014727 0.271909\n",
"10403521 688320.SH 2022-08-10 1.067048e+08 0.101442 0.561355\n",
"10403522 688739.SH 2022-08-10 1.035707e+07 -0.442122 0.030941\n",
"10403523 688777.SH 2022-08-10 4.529292e+08 0.394336 0.751877\n",
"10403524 830964.NE 2022-08-10 5.583561e+05 -0.493409 0.002081\n",
"\n",
"[10403525 rows x 5 columns]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
" select \n",
" code, m_nDate, \n",
" amount, \n",
" rank(amount,tiesMethod='average', percent=true)-0.5 as amount_rank,\n",
" rank(amount,tiesMethod='average', percent=true)-0.5 * winsorize(abs(PctChg)/10, 0.02) as amount_with_trend\n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" context by m_nDate\n",
"\"\"\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 88,
"id": "b0d7d22f-6d80-45ed-b685-0cbc0daccd13",
"metadata": {},
"outputs": [],
"source": [
"df = sess.run(\"\"\"\n",
" tableInsert(\n",
" loadTable(\"dfs://daily_stock_ts\", \"daily_factor\"),\n",
" select \n",
" code, m_nDate, \n",
" rank(amount,tiesMethod='average', percent=true)-0.5 * winsorize(abs(PctChg), 0.02) \n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" context by m_nDate\n",
" )\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 118,
"id": "a72d9b1f-a84a-463f-87b8-1841d51afd5e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" trend_with_amount | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 0.101943 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" 0.024839 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-06 | \n",
" -0.011194 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 0.066196 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-10 | \n",
" 0.013202 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 95 | \n",
" 000400.SZ | \n",
" 2006-06-06 | \n",
" -0.019479 | \n",
"
\n",
" \n",
" 96 | \n",
" 000400.SZ | \n",
" 2006-06-07 | \n",
" -0.084317 | \n",
"
\n",
" \n",
" 97 | \n",
" 000400.SZ | \n",
" 2006-06-08 | \n",
" -0.006340 | \n",
"
\n",
" \n",
" 98 | \n",
" 000400.SZ | \n",
" 2006-06-09 | \n",
" 0.002774 | \n",
"
\n",
" \n",
" 99 | \n",
" 000400.SZ | \n",
" 2006-06-12 | \n",
" 0.006228 | \n",
"
\n",
" \n",
"
\n",
"
100 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate trend_with_amount\n",
"0 000400.SZ 2006-01-04 0.101943\n",
"1 000400.SZ 2006-01-05 0.024839\n",
"2 000400.SZ 2006-01-06 -0.011194\n",
"3 000400.SZ 2006-01-09 0.066196\n",
"4 000400.SZ 2006-01-10 0.013202\n",
".. ... ... ...\n",
"95 000400.SZ 2006-06-06 -0.019479\n",
"96 000400.SZ 2006-06-07 -0.084317\n",
"97 000400.SZ 2006-06-08 -0.006340\n",
"98 000400.SZ 2006-06-09 0.002774\n",
"99 000400.SZ 2006-06-12 0.006228\n",
"\n",
"[100 rows x 3 columns]"
]
},
"execution_count": 118,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" select top 100 * from loadTable(\"dfs://daily_stock_ts\", \"daily_factor\")\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 87,
"id": "bbf2d32b-db27-4f3d-820e-8d53ff936b2d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" amount | \n",
" rank_amount_sub | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 3.265679e+07 | \n",
" 0.410321 | \n",
"
\n",
" \n",
" 1182 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" 2.582027e+07 | \n",
" 0.338525 | \n",
"
\n",
" \n",
" 2402 | \n",
" 000400.SZ | \n",
" 2006-01-06 | \n",
" 3.477456e+07 | \n",
" 0.361201 | \n",
"
\n",
" \n",
" 3634 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 3.356378e+07 | \n",
" 0.374590 | \n",
"
\n",
" \n",
" 4854 | \n",
" 000400.SZ | \n",
" 2006-01-10 | \n",
" 5.437912e+07 | \n",
" 0.438322 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10379267 | \n",
" 000400.SZ | \n",
" 2022-08-04 | \n",
" 1.660664e+09 | \n",
" 0.487822 | \n",
"
\n",
" \n",
" 10384112 | \n",
" 000400.SZ | \n",
" 2022-08-05 | \n",
" 1.430263e+09 | \n",
" 0.480821 | \n",
"
\n",
" \n",
" 10388961 | \n",
" 000400.SZ | \n",
" 2022-08-08 | \n",
" 9.427016e+08 | \n",
" 0.464359 | \n",
"
\n",
" \n",
" 10393815 | \n",
" 000400.SZ | \n",
" 2022-08-09 | \n",
" 9.085981e+08 | \n",
" 0.464985 | \n",
"
\n",
" \n",
" 10398670 | \n",
" 000400.SZ | \n",
" 2022-08-10 | \n",
" 1.074877e+09 | \n",
" 0.471164 | \n",
"
\n",
" \n",
"
\n",
"
3786 rows × 4 columns
\n",
"
"
],
"text/plain": [
" code m_nDate amount rank_amount_sub\n",
"0 000400.SZ 2006-01-04 3.265679e+07 0.410321\n",
"1182 000400.SZ 2006-01-05 2.582027e+07 0.338525\n",
"2402 000400.SZ 2006-01-06 3.477456e+07 0.361201\n",
"3634 000400.SZ 2006-01-09 3.356378e+07 0.374590\n",
"4854 000400.SZ 2006-01-10 5.437912e+07 0.438322\n",
"... ... ... ... ...\n",
"10379267 000400.SZ 2022-08-04 1.660664e+09 0.487822\n",
"10384112 000400.SZ 2022-08-05 1.430263e+09 0.480821\n",
"10388961 000400.SZ 2022-08-08 9.427016e+08 0.464359\n",
"10393815 000400.SZ 2022-08-09 9.085981e+08 0.464985\n",
"10398670 000400.SZ 2022-08-10 1.074877e+09 0.471164\n",
"\n",
"[3786 rows x 4 columns]"
]
},
"execution_count": 87,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df['code'] == '000400.SZ']"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "0548beb0-9cc7-4c27-9383-2519e72b62a6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" trend_with_amount | \n",
" trend_with_turnover | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 2.461929 | \n",
" 1.984772 | \n",
"
\n",
" \n",
" 1 | \n",
" 000515.SZ | \n",
" 2006-01-04 | \n",
" 0.762978 | \n",
" 1.693085 | \n",
"
\n",
" \n",
" 2 | \n",
" 000558.SZ | \n",
" 2006-01-04 | \n",
" -0.271123 | \n",
" 0.042549 | \n",
"
\n",
" \n",
" 3 | \n",
" 000602.SZ | \n",
" 2006-01-04 | \n",
" 0.686664 | \n",
" 0.895247 | \n",
"
\n",
" \n",
" 4 | \n",
" 000731.SZ | \n",
" 2006-01-04 | \n",
" 0.526584 | \n",
" 0.304176 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 688272.SH | \n",
" 2022-08-10 | \n",
" -0.062845 | \n",
" 2.001800 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 688320.SH | \n",
" 2022-08-10 | \n",
" 0.081330 | \n",
" 0.256045 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 688739.SH | \n",
" 2022-08-10 | \n",
" -0.238192 | \n",
" -0.179157 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 688777.SH | \n",
" 2022-08-10 | \n",
" 1.123532 | \n",
" 0.242664 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-10 | \n",
" -0.000000 | \n",
" -0.000000 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 4 columns
\n",
"
"
],
"text/plain": [
" code m_nDate trend_with_amount trend_with_turnover\n",
"0 000400.SZ 2006-01-04 2.461929 1.984772\n",
"1 000515.SZ 2006-01-04 0.762978 1.693085\n",
"2 000558.SZ 2006-01-04 -0.271123 0.042549\n",
"3 000602.SZ 2006-01-04 0.686664 0.895247\n",
"4 000731.SZ 2006-01-04 0.526584 0.304176\n",
"... ... ... ... ...\n",
"10403520 688272.SH 2022-08-10 -0.062845 2.001800\n",
"10403521 688320.SH 2022-08-10 0.081330 0.256045\n",
"10403522 688739.SH 2022-08-10 -0.238192 -0.179157\n",
"10403523 688777.SH 2022-08-10 1.123532 0.242664\n",
"10403524 830964.NE 2022-08-10 -0.000000 -0.000000\n",
"\n",
"[10403525 rows x 4 columns]"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" f = select \n",
" code, m_nDate, \n",
" (rank(amount, tiesMethod='average', percent=true) - 0.5) * abs(winsorize(PctChg, 0.01)) as trend_with_amount,\n",
" (rank((amount/MarketValues), tiesMethod='average', percent=true) - 0.5) * abs(winsorize(PctChg, 0.01)) as trend_with_turnover\n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\")\n",
" context by m_nDate\n",
" f;\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "b604dd48-2869-41d8-a001-275ab0b49594",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" rank_PctChg_sub | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-03 | \n",
" 0.461697 | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 0.241123 | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" -0.124425 | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-08 | \n",
" 0.399528 | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 0.108267 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 830964.NE | \n",
" 2022-08-03 | \n",
" -0.027355 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 830964.NE | \n",
" 2022-08-04 | \n",
" -0.070112 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 830964.NE | \n",
" 2022-08-07 | \n",
" 0.050077 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 830964.NE | \n",
" 2022-08-08 | \n",
" -0.027355 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-09 | \n",
" -0.027355 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code m_nDate rank_PctChg_sub\n",
"0 000400.SZ 2006-01-03 0.461697\n",
"1 000400.SZ 2006-01-04 0.241123\n",
"2 000400.SZ 2006-01-05 -0.124425\n",
"3 000400.SZ 2006-01-08 0.399528\n",
"4 000400.SZ 2006-01-09 0.108267\n",
"... ... ... ...\n",
"10403520 830964.NE 2022-08-03 -0.027355\n",
"10403521 830964.NE 2022-08-04 -0.070112\n",
"10403522 830964.NE 2022-08-07 0.050077\n",
"10403523 830964.NE 2022-08-08 -0.027355\n",
"10403524 830964.NE 2022-08-09 -0.027355\n",
"\n",
"[10403525 rows x 3 columns]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sess.run(\"\"\"\n",
" r = select \n",
" code, m_nDate-1 as m_nDate, \n",
" rank(PctChg, percent=true)-0.5 \n",
" from loadTable(\"dfs://daily_stock_ts\", \"daily_kline\");\n",
" r;\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 95,
"id": "daab613f-9e6b-4f75-bfbe-80a2293912c3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" m_nDate | \n",
" rank_PctChg_sub | \n",
" alpha101_22_m_nDate | \n",
" alpha101_22 | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 000400.SZ | \n",
" 2006-01-03 | \n",
" 0.461697 | \n",
" NaT | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" 000400.SZ | \n",
" 2006-01-04 | \n",
" 0.241123 | \n",
" 2006-01-04 | \n",
" NaN | \n",
"
\n",
" \n",
" 2 | \n",
" 000400.SZ | \n",
" 2006-01-05 | \n",
" -0.124425 | \n",
" 2006-01-05 | \n",
" NaN | \n",
"
\n",
" \n",
" 3 | \n",
" 000400.SZ | \n",
" 2006-01-08 | \n",
" 0.399528 | \n",
" 2006-01-06 | \n",
" NaN | \n",
"
\n",
" \n",
" 4 | \n",
" 000400.SZ | \n",
" 2006-01-09 | \n",
" 0.108267 | \n",
" 2006-01-09 | \n",
" NaN | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 10403520 | \n",
" 830964.NE | \n",
" 2022-08-03 | \n",
" -0.027355 | \n",
" 2022-08-03 | \n",
" 0.008355 | \n",
"
\n",
" \n",
" 10403521 | \n",
" 830964.NE | \n",
" 2022-08-04 | \n",
" -0.070112 | \n",
" 2022-08-04 | \n",
" 0.015653 | \n",
"
\n",
" \n",
" 10403522 | \n",
" 830964.NE | \n",
" 2022-08-07 | \n",
" 0.050077 | \n",
" 2022-08-05 | \n",
" 0.014966 | \n",
"
\n",
" \n",
" 10403523 | \n",
" 830964.NE | \n",
" 2022-08-08 | \n",
" -0.027355 | \n",
" 2022-08-08 | \n",
" -0.034349 | \n",
"
\n",
" \n",
" 10403524 | \n",
" 830964.NE | \n",
" 2022-08-09 | \n",
" -0.027355 | \n",
" 2022-08-09 | \n",
" -0.021269 | \n",
"
\n",
" \n",
"
\n",
"
10403525 rows × 5 columns
\n",
"
"
],
"text/plain": [
" code m_nDate rank_PctChg_sub alpha101_22_m_nDate \\\n",
"0 000400.SZ 2006-01-03 0.461697 NaT \n",
"1 000400.SZ 2006-01-04 0.241123 2006-01-04 \n",
"2 000400.SZ 2006-01-05 -0.124425 2006-01-05 \n",
"3 000400.SZ 2006-01-08 0.399528 2006-01-06 \n",
"4 000400.SZ 2006-01-09 0.108267 2006-01-09 \n",
"... ... ... ... ... \n",
"10403520 830964.NE 2022-08-03 -0.027355 2022-08-03 \n",
"10403521 830964.NE 2022-08-04 -0.070112 2022-08-04 \n",
"10403522 830964.NE 2022-08-07 0.050077 2022-08-05 \n",
"10403523 830964.NE 2022-08-08 -0.027355 2022-08-08 \n",
"10403524 830964.NE 2022-08-09 -0.027355 2022-08-09 \n",
"\n",
" alpha101_22 \n",
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
"... ... \n",
"10403520 0.008355 \n",
"10403521 0.015653 \n",
"10403522 0.014966 \n",
"10403523 -0.034349 \n",
"10403524 -0.021269 \n",
"\n",
"[10403525 rows x 5 columns]"
]
},
"execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
" select * from aj(r, alpha101_22, `code`m_nDate)\n",
"\"\"\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 96,
"id": "ea2c353c-2e74-46f1-86c9-48322e9f9296",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" rank_PctChg_sub | \n",
" alpha101_22 | \n",
"
\n",
" \n",
" \n",
" \n",
" rank_PctChg_sub | \n",
" 1.000000 | \n",
" -0.006789 | \n",
"
\n",
" \n",
" alpha101_22 | \n",
" -0.006789 | \n",
" 1.000000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" rank_PctChg_sub alpha101_22\n",
"rank_PctChg_sub 1.000000 -0.006789\n",
"alpha101_22 -0.006789 1.000000"
]
},
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[[\"rank_PctChg_sub\", \"alpha101_22\"]].dropna().corr()"
]
},
{
"cell_type": "code",
"execution_count": 54,
"id": "aac33fb2-d06b-4456-81a2-cf8476a13d4d",
"metadata": {},
"outputs": [],
"source": [
"df = df.set_index([\"m_nDate\"])[['rank_PctChg_sub', 'trend_with_amount', 'trend_with_turnover']].dropna()"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "bc7447a7-be59-481b-b15a-d2ff59355135",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" rank_PctChg_sub | \n",
" trend_with_amount | \n",
" trend_with_turnover | \n",
"
\n",
" \n",
" \n",
" \n",
" rank_PctChg_sub | \n",
" 1.000000 | \n",
" -0.041950 | \n",
" -0.032851 | \n",
"
\n",
" \n",
" trend_with_amount | \n",
" -0.041950 | \n",
" 1.000000 | \n",
" 0.622215 | \n",
"
\n",
" \n",
" trend_with_turnover | \n",
" -0.032851 | \n",
" 0.622215 | \n",
" 1.000000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" rank_PctChg_sub trend_with_amount trend_with_turnover\n",
"rank_PctChg_sub 1.000000 -0.041950 -0.032851\n",
"trend_with_amount -0.041950 1.000000 0.622215\n",
"trend_with_turnover -0.032851 0.622215 1.000000"
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.corr(method=\"pearson\")"
]
},
{
"cell_type": "code",
"execution_count": 60,
"id": "259aad61-545d-48b2-80d1-7588e2b1b95e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.0417603527848196"
]
},
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from scipy.spatial import distance\n",
"1 - distance.cosine(df['rank_PctChg_sub'], df['trend_with_amount'])"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "84a31edf-a9cd-47bb-9f2b-384a45479c2d",
"metadata": {},
"outputs": [],
"source": [
"s_corr = df[[\"rank_PctChg_sub\", \"trend_with_amount\"]]\\\n",
" .groupby(\"m_nDate\").apply(lambda _df : 1 - distance.cosine(_df['rank_PctChg_sub'], _df['trend_with_amount']))"
]
},
{
"cell_type": "code",
"execution_count": 65,
"id": "0574a132-0744-412d-a2b3-e7d5b78c3d7a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.3412639405204461"
]
},
"execution_count": 65,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(s_corr > 0) / len(s_corr)"
]
},
{
"cell_type": "code",
"execution_count": 131,
"id": "faac8d09-0e8c-409e-85e9-0cb2d567e7b6",
"metadata": {},
"outputs": [
{
"ename": "RuntimeError",
"evalue": " in run: Server response: 'select code as symbol,m_nDate as date,open,close,high,low,vol as volume,amount,cjbs,yclose,PctChg,amount / vol as vwap,FloatShares,MarketValues,trend_with_turnover,trend_with_amount,k_skew,k_advrev,k_tail30trade,k_vpcorr,k_largeorder_ret,factor from lj(lj(loadTable(\"dfs://daily_stock_ts\", \"daily_kline\"),loadTable(\"dfs://daily_stock_ts\", \"daily_factor\"),[\"code\",\"m_nDate\"]),loadTable(\"dfs://daily_stock_ts\", \"hft_daily_factor\"),[\"code\",\"m_nDate\"]) where partition(code, 0) order by m_nDate asc => Multiple-table join does not support partitioned table except the first table!' script: '\n select code as symbol, m_nDate as date, open, close, high, low, vol as volume, amount, cjbs, yclose, PctChg, amount/vol as vwap, FloatShares, MarketValues, trend_with_turnover, trend_with_amount, k_skew, k_advrev, k_tail30trade, k_vpcorr, k_largeorder_ret, factor as factor\n from lj(lj(loadTable('dfs://daily_stock_ts', 'daily_kline'), loadTable('dfs://daily_stock_ts', 'daily_factor'), `code`m_nDate), loadTable('dfs://daily_stock_ts', 'hft_daily_factor'), `code`m_nDate) where partition(code, 0)\n order by m_nDate asc;\n'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [131]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43msess\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\"\"\u001b[39;49m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124;43m select code as symbol, m_nDate as date, open, close, high, low, vol as volume, amount, cjbs, yclose, PctChg, amount/vol as vwap, FloatShares, MarketValues, trend_with_turnover, trend_with_amount, k_skew, k_advrev, k_tail30trade, k_vpcorr, k_largeorder_ret, factor as factor\u001b[39;49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124;43m from lj(lj(loadTable(\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdfs://daily_stock_ts\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m, \u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdaily_kline\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m), loadTable(\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdfs://daily_stock_ts\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m, \u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdaily_factor\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m), `code`m_nDate), loadTable(\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdfs://daily_stock_ts\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m, \u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mhft_daily_factor\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m), `code`m_nDate) where partition(code, 0)\u001b[39;49m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;124;43m order by m_nDate asc;\u001b[39;49m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;124;43m\"\"\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/.venv/tinysoft/lib/python3.8/site-packages/dolphindb/session.py:161\u001b[0m, in \u001b[0;36msession.run\u001b[0;34m(self, script, *args, **kwargs)\u001b[0m\n\u001b[1;32m 159\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfetchSize\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m kwargs\u001b[38;5;241m.\u001b[39mkeys():\n\u001b[1;32m 160\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m BlockReader(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcpp\u001b[38;5;241m.\u001b[39mrunBlock(script, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs))\n\u001b[0;32m--> 161\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcpp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mscript\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[0;31mRuntimeError\u001b[0m: in run: Server response: 'select code as symbol,m_nDate as date,open,close,high,low,vol as volume,amount,cjbs,yclose,PctChg,amount / vol as vwap,FloatShares,MarketValues,trend_with_turnover,trend_with_amount,k_skew,k_advrev,k_tail30trade,k_vpcorr,k_largeorder_ret,factor from lj(lj(loadTable(\"dfs://daily_stock_ts\", \"daily_kline\"),loadTable(\"dfs://daily_stock_ts\", \"daily_factor\"),[\"code\",\"m_nDate\"]),loadTable(\"dfs://daily_stock_ts\", \"hft_daily_factor\"),[\"code\",\"m_nDate\"]) where partition(code, 0) order by m_nDate asc => Multiple-table join does not support partitioned table except the first table!' script: '\n select code as symbol, m_nDate as date, open, close, high, low, vol as volume, amount, cjbs, yclose, PctChg, amount/vol as vwap, FloatShares, MarketValues, trend_with_turnover, trend_with_amount, k_skew, k_advrev, k_tail30trade, k_vpcorr, k_largeorder_ret, factor as factor\n from lj(lj(loadTable('dfs://daily_stock_ts', 'daily_kline'), loadTable('dfs://daily_stock_ts', 'daily_factor'), `code`m_nDate), loadTable('dfs://daily_stock_ts', 'hft_daily_factor'), `code`m_nDate) where partition(code, 0)\n order by m_nDate asc;\n'"
]
}
],
"source": [
"sess.run(\"\"\"\n",
" select code as symbol, m_nDate as date, open, close, high, low, vol as volume, amount, cjbs, yclose, PctChg, amount/vol as vwap, FloatShares, MarketValues, trend_with_turnover, trend_with_amount, k_skew, k_advrev, k_tail30trade, k_vpcorr, k_largeorder_ret, factor as factor\n",
" from lj(lj(loadTable('dfs://daily_stock_ts', 'daily_kline'), loadTable('dfs://daily_stock_ts', 'daily_factor'), `code`m_nDate), loadTable('dfs://daily_stock_ts', 'hft_daily_factor'), `code`m_nDate) where partition(code, 0)\n",
" order by m_nDate asc;\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "7f05d056-4369-4f30-9f3e-47505799532e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" \n",
" | \n",
" abs | \n",
" \n",
" \n",
" \n",
" \n",
" 0 | \n",
" 1.491228 | \n",
" \n",
" \n",
" 1 | \n",
" 3.027605 | \n",
" \n",
" \n",
" 2 | \n",
" 0.388937 | \n",
" \n",
" \n",
" 3 | \n",
" 9.987086 | \n",
" \n",
" \n",
" 4 | \n",
" 1.056751 | \n",
" \n",
" \n",
" ... | \n",
" ... | \n",
" \n",
" \n",
" 9053861 | \n",
" 0.000000 | \n",
" \n",
" \n",
" 9053862 | \n",
" 0.298507 | \n",
" \n",
" \n",
" 9053863 | \n",
" 0.299401 | \n",
" \n",
" \n",
" 9053864 | \n",
" 0.000000 | \n",
" \n",
" \n",
" 9053865 | \n",
" 0.000000 | \n",
" \n",
" \n",
" \n",
" 9053866 rows × 1 columns \n",
" "
],
"text/plain": [
" abs\n",
"0 1.491228\n",
"1 3.027605\n",
"2 0.388937\n",
"3 9.987086\n",
"4 1.056751\n",
"... ...\n",
"9053861 0.000000\n",
"9053862 0.298507\n",
"9053863 0.299401\n",
"9053864 0.000000\n",
"9053865 0.000000\n",
"\n",
"[9053866 rows x 1 columns]"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = sess.run(\"\"\"\n",
"select abs(winsorize(PctChg, 0.01)) from lj(loadTable('dfs://daily_stock_ts', 'daily_kline'), loadTable('dfs://daily_stock_ts', 'daily_factor'), `code`m_nDate) \n",
"where m_nDate > 2010.01.01\n",
"\"\"\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "90805827-5fe0-416c-9c6f-58473cbad48b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[]], dtype=object)"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwga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