2.15
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,8 +3,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:52:54.170824Z",
|
||||
"start_time": "2025-02-09T14:52:53.544850Z"
|
||||
"end_time": "2025-02-11T16:39:38.576665Z",
|
||||
"start_time": "2025-02-11T16:39:38.019824Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -12,28 +12,38 @@
|
||||
"%load_ext autoreload\n",
|
||||
"%autoreload 2\n",
|
||||
"\n",
|
||||
"from utils.utils import read_and_merge_h5_data"
|
||||
"from utils.utils import read_and_merge_h5_data\n"
|
||||
],
|
||||
"id": "79a7758178bafdd3",
|
||||
"outputs": [],
|
||||
"execution_count": 1
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"The autoreload extension is already loaded. To reload it, use:\n",
|
||||
" %reload_ext autoreload\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 8
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:53:36.873700Z",
|
||||
"start_time": "2025-02-09T14:52:54.170824Z"
|
||||
"end_time": "2025-02-11T16:40:45.842510Z",
|
||||
"start_time": "2025-02-11T16:39:54.757326Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"\n",
|
||||
"print('daily data')\n",
|
||||
"df = read_and_merge_h5_data('../../data/daily_data.h5', key='daily_data',\n",
|
||||
" columns=['ts_code', 'trade_date', 'open', 'close', 'high', 'low', 'vol'],\n",
|
||||
" df=None)\n",
|
||||
"\n",
|
||||
"print('daily basic')\n",
|
||||
"df = read_and_merge_h5_data('../../data/daily_basic.h5', key='daily_basic_with_st',\n",
|
||||
"df = read_and_merge_h5_data('../../data/daily_basic.h5', key='daily_basic',\n",
|
||||
" columns=['ts_code', 'trade_date', 'turnover_rate', 'pe_ttm', 'circ_mv', 'volume_ratio',\n",
|
||||
" 'is_st'], df=df)\n",
|
||||
"\n",
|
||||
@@ -60,26 +70,26 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 2
|
||||
"execution_count": 10
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:53:37.426404Z",
|
||||
"start_time": "2025-02-09T14:53:36.955552Z"
|
||||
"end_time": "2025-02-11T16:40:45.905077Z",
|
||||
"start_time": "2025-02-11T16:40:45.848510Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": "origin_columns = df.columns.tolist()",
|
||||
"id": "c4e9e1d31da6dba6",
|
||||
"outputs": [],
|
||||
"execution_count": 3
|
||||
"execution_count": 11
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:53:38.164112Z",
|
||||
"start_time": "2025-02-09T14:53:38.070007Z"
|
||||
"end_time": "2025-02-11T16:40:46.016229Z",
|
||||
"start_time": "2025-02-11T16:40:45.938587Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -221,13 +231,13 @@
|
||||
],
|
||||
"id": "a735bc02ceb4d872",
|
||||
"outputs": [],
|
||||
"execution_count": 4
|
||||
"execution_count": 12
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:53:49.153376Z",
|
||||
"start_time": "2025-02-09T14:53:38.164112Z"
|
||||
"end_time": "2025-02-11T16:40:56.805530Z",
|
||||
"start_time": "2025-02-11T16:40:46.048312Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -247,8 +257,8 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<class 'pandas.core.frame.DataFrame'>\n",
|
||||
"RangeIndex: 8364308 entries, 0 to 8364307\n",
|
||||
"Data columns (total 83 columns):\n",
|
||||
"RangeIndex: 8375079 entries, 0 to 8375078\n",
|
||||
"Data columns (total 87 columns):\n",
|
||||
" # Column Dtype \n",
|
||||
"--- ------ ----- \n",
|
||||
" 0 ts_code object \n",
|
||||
@@ -258,103 +268,106 @@
|
||||
" 4 high float64 \n",
|
||||
" 5 low float64 \n",
|
||||
" 6 vol float64 \n",
|
||||
" 7 is_st object \n",
|
||||
" 8 up_limit float64 \n",
|
||||
" 9 down_limit float64 \n",
|
||||
" 10 buy_sm_vol float64 \n",
|
||||
" 11 sell_sm_vol float64 \n",
|
||||
" 12 buy_lg_vol float64 \n",
|
||||
" 13 sell_lg_vol float64 \n",
|
||||
" 14 buy_elg_vol float64 \n",
|
||||
" 15 sell_elg_vol float64 \n",
|
||||
" 16 net_mf_vol float64 \n",
|
||||
" 17 up float64 \n",
|
||||
" 18 down float64 \n",
|
||||
" 19 atr_14 float64 \n",
|
||||
" 20 atr_6 float64 \n",
|
||||
" 21 obv float64 \n",
|
||||
" 22 maobv_6 float64 \n",
|
||||
" 23 obv-maobv_6 float64 \n",
|
||||
" 24 rsi_3 float64 \n",
|
||||
" 25 rsi_6 float64 \n",
|
||||
" 26 rsi_9 float64 \n",
|
||||
" 27 return_10 float64 \n",
|
||||
" 28 return_20 float64 \n",
|
||||
" 29 avg_close_5 float64 \n",
|
||||
" 30 std_return_5 float64 \n",
|
||||
" 31 std_return_15 float64 \n",
|
||||
" 32 std_return_25 float64 \n",
|
||||
" 33 std_return_90 float64 \n",
|
||||
" 34 std_return_90_2 float64 \n",
|
||||
" 35 std_return_5 / std_return_90 float64 \n",
|
||||
" 36 std_return_5 / std_return_25 float64 \n",
|
||||
" 37 std_return_90 - std_return_90_2 float64 \n",
|
||||
" 38 ema_5 float64 \n",
|
||||
" 39 ema_13 float64 \n",
|
||||
" 40 ema_20 float64 \n",
|
||||
" 41 ema_60 float64 \n",
|
||||
" 42 act_factor1 float64 \n",
|
||||
" 43 act_factor2 float64 \n",
|
||||
" 44 act_factor3 float64 \n",
|
||||
" 45 act_factor4 float64 \n",
|
||||
" 46 act_factor5 float64 \n",
|
||||
" 47 act_factor6 float64 \n",
|
||||
" 48 rank_act_factor1 float64 \n",
|
||||
" 49 rank_act_factor2 float64 \n",
|
||||
" 50 rank_act_factor3 float64 \n",
|
||||
" 51 active_buy_volume_large float64 \n",
|
||||
" 52 active_buy_volume_big float64 \n",
|
||||
" 53 active_buy_volume_small float64 \n",
|
||||
" 54 buy_lg_vol - sell_lg_vol float64 \n",
|
||||
" 55 buy_elg_vol - sell_elg_vol float64 \n",
|
||||
" 56 future_return1 float64 \n",
|
||||
" 57 future_return2 float64 \n",
|
||||
" 58 future_return3 float64 \n",
|
||||
" 59 future_return4 float64 \n",
|
||||
" 60 future_return5 float64 \n",
|
||||
" 61 future_return6 float64 \n",
|
||||
" 62 future_return7 float64 \n",
|
||||
" 63 future_close1 float64 \n",
|
||||
" 64 future_close2 float64 \n",
|
||||
" 65 future_close3 float64 \n",
|
||||
" 66 future_close4 float64 \n",
|
||||
" 67 future_close5 float64 \n",
|
||||
" 68 future_af11 float64 \n",
|
||||
" 69 future_af12 float64 \n",
|
||||
" 70 future_af13 float64 \n",
|
||||
" 71 future_af14 float64 \n",
|
||||
" 72 future_af15 float64 \n",
|
||||
" 73 future_af21 float64 \n",
|
||||
" 74 future_af22 float64 \n",
|
||||
" 75 future_af23 float64 \n",
|
||||
" 76 future_af24 float64 \n",
|
||||
" 77 future_af25 float64 \n",
|
||||
" 78 future_af31 float64 \n",
|
||||
" 79 future_af32 float64 \n",
|
||||
" 80 future_af33 float64 \n",
|
||||
" 81 future_af34 float64 \n",
|
||||
" 82 future_af35 float64 \n",
|
||||
"dtypes: datetime64[ns](1), float64(80), object(2)\n",
|
||||
"memory usage: 5.2+ GB\n",
|
||||
" 7 turnover_rate float64 \n",
|
||||
" 8 pe_ttm float64 \n",
|
||||
" 9 circ_mv float64 \n",
|
||||
" 10 volume_ratio float64 \n",
|
||||
" 11 is_st object \n",
|
||||
" 12 up_limit float64 \n",
|
||||
" 13 down_limit float64 \n",
|
||||
" 14 buy_sm_vol float64 \n",
|
||||
" 15 sell_sm_vol float64 \n",
|
||||
" 16 buy_lg_vol float64 \n",
|
||||
" 17 sell_lg_vol float64 \n",
|
||||
" 18 buy_elg_vol float64 \n",
|
||||
" 19 sell_elg_vol float64 \n",
|
||||
" 20 net_mf_vol float64 \n",
|
||||
" 21 up float64 \n",
|
||||
" 22 down float64 \n",
|
||||
" 23 atr_14 float64 \n",
|
||||
" 24 atr_6 float64 \n",
|
||||
" 25 obv float64 \n",
|
||||
" 26 maobv_6 float64 \n",
|
||||
" 27 obv-maobv_6 float64 \n",
|
||||
" 28 rsi_3 float64 \n",
|
||||
" 29 rsi_6 float64 \n",
|
||||
" 30 rsi_9 float64 \n",
|
||||
" 31 return_10 float64 \n",
|
||||
" 32 return_20 float64 \n",
|
||||
" 33 avg_close_5 float64 \n",
|
||||
" 34 std_return_5 float64 \n",
|
||||
" 35 std_return_15 float64 \n",
|
||||
" 36 std_return_25 float64 \n",
|
||||
" 37 std_return_90 float64 \n",
|
||||
" 38 std_return_90_2 float64 \n",
|
||||
" 39 std_return_5 / std_return_90 float64 \n",
|
||||
" 40 std_return_5 / std_return_25 float64 \n",
|
||||
" 41 std_return_90 - std_return_90_2 float64 \n",
|
||||
" 42 ema_5 float64 \n",
|
||||
" 43 ema_13 float64 \n",
|
||||
" 44 ema_20 float64 \n",
|
||||
" 45 ema_60 float64 \n",
|
||||
" 46 act_factor1 float64 \n",
|
||||
" 47 act_factor2 float64 \n",
|
||||
" 48 act_factor3 float64 \n",
|
||||
" 49 act_factor4 float64 \n",
|
||||
" 50 act_factor5 float64 \n",
|
||||
" 51 act_factor6 float64 \n",
|
||||
" 52 rank_act_factor1 float64 \n",
|
||||
" 53 rank_act_factor2 float64 \n",
|
||||
" 54 rank_act_factor3 float64 \n",
|
||||
" 55 active_buy_volume_large float64 \n",
|
||||
" 56 active_buy_volume_big float64 \n",
|
||||
" 57 active_buy_volume_small float64 \n",
|
||||
" 58 buy_lg_vol - sell_lg_vol float64 \n",
|
||||
" 59 buy_elg_vol - sell_elg_vol float64 \n",
|
||||
" 60 future_return1 float64 \n",
|
||||
" 61 future_return2 float64 \n",
|
||||
" 62 future_return3 float64 \n",
|
||||
" 63 future_return4 float64 \n",
|
||||
" 64 future_return5 float64 \n",
|
||||
" 65 future_return6 float64 \n",
|
||||
" 66 future_return7 float64 \n",
|
||||
" 67 future_close1 float64 \n",
|
||||
" 68 future_close2 float64 \n",
|
||||
" 69 future_close3 float64 \n",
|
||||
" 70 future_close4 float64 \n",
|
||||
" 71 future_close5 float64 \n",
|
||||
" 72 future_af11 float64 \n",
|
||||
" 73 future_af12 float64 \n",
|
||||
" 74 future_af13 float64 \n",
|
||||
" 75 future_af14 float64 \n",
|
||||
" 76 future_af15 float64 \n",
|
||||
" 77 future_af21 float64 \n",
|
||||
" 78 future_af22 float64 \n",
|
||||
" 79 future_af23 float64 \n",
|
||||
" 80 future_af24 float64 \n",
|
||||
" 81 future_af25 float64 \n",
|
||||
" 82 future_af31 float64 \n",
|
||||
" 83 future_af32 float64 \n",
|
||||
" 84 future_af33 float64 \n",
|
||||
" 85 future_af34 float64 \n",
|
||||
" 86 future_af35 float64 \n",
|
||||
"dtypes: datetime64[ns](1), float64(84), object(2)\n",
|
||||
"memory usage: 5.4+ GB\n",
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 5
|
||||
"execution_count": 13
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:55:28.712343Z",
|
||||
"start_time": "2025-02-09T14:53:49.279168Z"
|
||||
"end_time": "2025-02-11T16:42:03.707721Z",
|
||||
"start_time": "2025-02-11T16:40:56.889317Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"def filter_data(df):\n",
|
||||
" df = df.groupby('trade_date').apply(lambda x: x.nlargest(1000, 'act_factor3'))\n",
|
||||
" df = df[df['is_st'] == False]\n",
|
||||
" df = df[df['is_st'] == False]\n",
|
||||
" df = df[~df['is_st']]\n",
|
||||
" df = df[~df['ts_code'].str.startswith('30')]\n",
|
||||
" df = df[~df['ts_code'].str.startswith('68')]\n",
|
||||
" df = df[~df['ts_code'].str.startswith('8')]\n",
|
||||
@@ -372,106 +385,110 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<class 'pandas.core.frame.DataFrame'>\n",
|
||||
"RangeIndex: 1136157 entries, 0 to 1136156\n",
|
||||
"Data columns (total 83 columns):\n",
|
||||
"RangeIndex: 1101560 entries, 0 to 1101559\n",
|
||||
"Data columns (total 87 columns):\n",
|
||||
" # Column Non-Null Count Dtype \n",
|
||||
"--- ------ -------------- ----- \n",
|
||||
" 0 ts_code 1136157 non-null object \n",
|
||||
" 1 trade_date 1136157 non-null datetime64[ns]\n",
|
||||
" 2 open 1136157 non-null float64 \n",
|
||||
" 3 close 1136157 non-null float64 \n",
|
||||
" 4 high 1136157 non-null float64 \n",
|
||||
" 5 low 1136157 non-null float64 \n",
|
||||
" 6 vol 1136157 non-null float64 \n",
|
||||
" 7 is_st 1136157 non-null object \n",
|
||||
" 8 up_limit 1135878 non-null float64 \n",
|
||||
" 9 down_limit 1135878 non-null float64 \n",
|
||||
" 10 buy_sm_vol 1135663 non-null float64 \n",
|
||||
" 11 sell_sm_vol 1135663 non-null float64 \n",
|
||||
" 12 buy_lg_vol 1135663 non-null float64 \n",
|
||||
" 13 sell_lg_vol 1135663 non-null float64 \n",
|
||||
" 14 buy_elg_vol 1135663 non-null float64 \n",
|
||||
" 15 sell_elg_vol 1135663 non-null float64 \n",
|
||||
" 16 net_mf_vol 1135663 non-null float64 \n",
|
||||
" 17 up 1136157 non-null float64 \n",
|
||||
" 18 down 1136157 non-null float64 \n",
|
||||
" 19 atr_14 1136157 non-null float64 \n",
|
||||
" 20 atr_6 1136157 non-null float64 \n",
|
||||
" 21 obv 1136157 non-null float64 \n",
|
||||
" 22 maobv_6 1136157 non-null float64 \n",
|
||||
" 23 obv-maobv_6 1136157 non-null float64 \n",
|
||||
" 24 rsi_3 1136157 non-null float64 \n",
|
||||
" 25 rsi_6 1136157 non-null float64 \n",
|
||||
" 26 rsi_9 1136157 non-null float64 \n",
|
||||
" 27 return_10 1136157 non-null float64 \n",
|
||||
" 28 return_20 1136157 non-null float64 \n",
|
||||
" 29 avg_close_5 1136157 non-null float64 \n",
|
||||
" 30 std_return_5 1136157 non-null float64 \n",
|
||||
" 31 std_return_15 1136157 non-null float64 \n",
|
||||
" 32 std_return_25 1136157 non-null float64 \n",
|
||||
" 33 std_return_90 1136131 non-null float64 \n",
|
||||
" 34 std_return_90_2 1136129 non-null float64 \n",
|
||||
" 35 std_return_5 / std_return_90 1136131 non-null float64 \n",
|
||||
" 36 std_return_5 / std_return_25 1136157 non-null float64 \n",
|
||||
" 37 std_return_90 - std_return_90_2 1136129 non-null float64 \n",
|
||||
" 38 ema_5 1136157 non-null float64 \n",
|
||||
" 39 ema_13 1136157 non-null float64 \n",
|
||||
" 40 ema_20 1136157 non-null float64 \n",
|
||||
" 41 ema_60 1136153 non-null float64 \n",
|
||||
" 42 act_factor1 1136157 non-null float64 \n",
|
||||
" 43 act_factor2 1136157 non-null float64 \n",
|
||||
" 44 act_factor3 1136157 non-null float64 \n",
|
||||
" 45 act_factor4 1136152 non-null float64 \n",
|
||||
" 46 act_factor5 1136152 non-null float64 \n",
|
||||
" 47 act_factor6 1136157 non-null float64 \n",
|
||||
" 48 rank_act_factor1 1136157 non-null float64 \n",
|
||||
" 49 rank_act_factor2 1136157 non-null float64 \n",
|
||||
" 50 rank_act_factor3 1136157 non-null float64 \n",
|
||||
" 51 active_buy_volume_large 1135659 non-null float64 \n",
|
||||
" 52 active_buy_volume_big 1135636 non-null float64 \n",
|
||||
" 53 active_buy_volume_small 1135663 non-null float64 \n",
|
||||
" 54 buy_lg_vol - sell_lg_vol 1135660 non-null float64 \n",
|
||||
" 55 buy_elg_vol - sell_elg_vol 1135640 non-null float64 \n",
|
||||
" 56 future_return1 1136157 non-null float64 \n",
|
||||
" 57 future_return2 1136157 non-null float64 \n",
|
||||
" 58 future_return3 1136157 non-null float64 \n",
|
||||
" 59 future_return4 1136157 non-null float64 \n",
|
||||
" 60 future_return5 1136157 non-null float64 \n",
|
||||
" 61 future_return6 1136157 non-null float64 \n",
|
||||
" 62 future_return7 1136157 non-null float64 \n",
|
||||
" 63 future_close1 1136157 non-null float64 \n",
|
||||
" 64 future_close2 1136157 non-null float64 \n",
|
||||
" 65 future_close3 1136157 non-null float64 \n",
|
||||
" 66 future_close4 1136157 non-null float64 \n",
|
||||
" 67 future_close5 1136157 non-null float64 \n",
|
||||
" 68 future_af11 1136157 non-null float64 \n",
|
||||
" 69 future_af12 1136157 non-null float64 \n",
|
||||
" 70 future_af13 1136157 non-null float64 \n",
|
||||
" 71 future_af14 1136157 non-null float64 \n",
|
||||
" 72 future_af15 1136157 non-null float64 \n",
|
||||
" 73 future_af21 1136157 non-null float64 \n",
|
||||
" 74 future_af22 1136157 non-null float64 \n",
|
||||
" 75 future_af23 1136157 non-null float64 \n",
|
||||
" 76 future_af24 1136157 non-null float64 \n",
|
||||
" 77 future_af25 1136157 non-null float64 \n",
|
||||
" 78 future_af31 1136157 non-null float64 \n",
|
||||
" 79 future_af32 1136157 non-null float64 \n",
|
||||
" 80 future_af33 1136157 non-null float64 \n",
|
||||
" 81 future_af34 1136157 non-null float64 \n",
|
||||
" 82 future_af35 1136157 non-null float64 \n",
|
||||
"dtypes: datetime64[ns](1), float64(80), object(2)\n",
|
||||
"memory usage: 719.5+ MB\n",
|
||||
" 0 ts_code 1101560 non-null object \n",
|
||||
" 1 trade_date 1101560 non-null datetime64[ns]\n",
|
||||
" 2 open 1101560 non-null float64 \n",
|
||||
" 3 close 1101560 non-null float64 \n",
|
||||
" 4 high 1101560 non-null float64 \n",
|
||||
" 5 low 1101560 non-null float64 \n",
|
||||
" 6 vol 1101560 non-null float64 \n",
|
||||
" 7 turnover_rate 1101560 non-null float64 \n",
|
||||
" 8 pe_ttm 932908 non-null float64 \n",
|
||||
" 9 circ_mv 1101560 non-null float64 \n",
|
||||
" 10 volume_ratio 1101096 non-null float64 \n",
|
||||
" 11 is_st 1101560 non-null object \n",
|
||||
" 12 up_limit 1101282 non-null float64 \n",
|
||||
" 13 down_limit 1101282 non-null float64 \n",
|
||||
" 14 buy_sm_vol 1101069 non-null float64 \n",
|
||||
" 15 sell_sm_vol 1101069 non-null float64 \n",
|
||||
" 16 buy_lg_vol 1101069 non-null float64 \n",
|
||||
" 17 sell_lg_vol 1101069 non-null float64 \n",
|
||||
" 18 buy_elg_vol 1101069 non-null float64 \n",
|
||||
" 19 sell_elg_vol 1101069 non-null float64 \n",
|
||||
" 20 net_mf_vol 1101069 non-null float64 \n",
|
||||
" 21 up 1101560 non-null float64 \n",
|
||||
" 22 down 1101560 non-null float64 \n",
|
||||
" 23 atr_14 1100687 non-null float64 \n",
|
||||
" 24 atr_6 1100687 non-null float64 \n",
|
||||
" 25 obv 1101560 non-null float64 \n",
|
||||
" 26 maobv_6 1101560 non-null float64 \n",
|
||||
" 27 obv-maobv_6 1101560 non-null float64 \n",
|
||||
" 28 rsi_3 1100687 non-null float64 \n",
|
||||
" 29 rsi_6 1100687 non-null float64 \n",
|
||||
" 30 rsi_9 1100687 non-null float64 \n",
|
||||
" 31 return_10 1101560 non-null float64 \n",
|
||||
" 32 return_20 1101560 non-null float64 \n",
|
||||
" 33 avg_close_5 1101560 non-null float64 \n",
|
||||
" 34 std_return_5 1101560 non-null float64 \n",
|
||||
" 35 std_return_15 1101560 non-null float64 \n",
|
||||
" 36 std_return_25 1101559 non-null float64 \n",
|
||||
" 37 std_return_90 1101533 non-null float64 \n",
|
||||
" 38 std_return_90_2 1101531 non-null float64 \n",
|
||||
" 39 std_return_5 / std_return_90 1101533 non-null float64 \n",
|
||||
" 40 std_return_5 / std_return_25 1101559 non-null float64 \n",
|
||||
" 41 std_return_90 - std_return_90_2 1101531 non-null float64 \n",
|
||||
" 42 ema_5 1100687 non-null float64 \n",
|
||||
" 43 ema_13 1100687 non-null float64 \n",
|
||||
" 44 ema_20 1100687 non-null float64 \n",
|
||||
" 45 ema_60 1100682 non-null float64 \n",
|
||||
" 46 act_factor1 1100687 non-null float64 \n",
|
||||
" 47 act_factor2 1100687 non-null float64 \n",
|
||||
" 48 act_factor3 1100687 non-null float64 \n",
|
||||
" 49 act_factor4 1100682 non-null float64 \n",
|
||||
" 50 act_factor5 1100682 non-null float64 \n",
|
||||
" 51 act_factor6 1100687 non-null float64 \n",
|
||||
" 52 rank_act_factor1 1100687 non-null float64 \n",
|
||||
" 53 rank_act_factor2 1100687 non-null float64 \n",
|
||||
" 54 rank_act_factor3 1100687 non-null float64 \n",
|
||||
" 55 active_buy_volume_large 1101065 non-null float64 \n",
|
||||
" 56 active_buy_volume_big 1101042 non-null float64 \n",
|
||||
" 57 active_buy_volume_small 1101069 non-null float64 \n",
|
||||
" 58 buy_lg_vol - sell_lg_vol 1101066 non-null float64 \n",
|
||||
" 59 buy_elg_vol - sell_elg_vol 1101046 non-null float64 \n",
|
||||
" 60 future_return1 1101560 non-null float64 \n",
|
||||
" 61 future_return2 1101560 non-null float64 \n",
|
||||
" 62 future_return3 1101560 non-null float64 \n",
|
||||
" 63 future_return4 1101560 non-null float64 \n",
|
||||
" 64 future_return5 1101560 non-null float64 \n",
|
||||
" 65 future_return6 1101560 non-null float64 \n",
|
||||
" 66 future_return7 1101560 non-null float64 \n",
|
||||
" 67 future_close1 1101560 non-null float64 \n",
|
||||
" 68 future_close2 1101560 non-null float64 \n",
|
||||
" 69 future_close3 1101560 non-null float64 \n",
|
||||
" 70 future_close4 1101560 non-null float64 \n",
|
||||
" 71 future_close5 1101560 non-null float64 \n",
|
||||
" 72 future_af11 1100687 non-null float64 \n",
|
||||
" 73 future_af12 1100687 non-null float64 \n",
|
||||
" 74 future_af13 1100687 non-null float64 \n",
|
||||
" 75 future_af14 1100687 non-null float64 \n",
|
||||
" 76 future_af15 1100687 non-null float64 \n",
|
||||
" 77 future_af21 1100687 non-null float64 \n",
|
||||
" 78 future_af22 1100687 non-null float64 \n",
|
||||
" 79 future_af23 1100687 non-null float64 \n",
|
||||
" 80 future_af24 1100687 non-null float64 \n",
|
||||
" 81 future_af25 1100687 non-null float64 \n",
|
||||
" 82 future_af31 1100687 non-null float64 \n",
|
||||
" 83 future_af32 1100687 non-null float64 \n",
|
||||
" 84 future_af33 1100687 non-null float64 \n",
|
||||
" 85 future_af34 1100687 non-null float64 \n",
|
||||
" 86 future_af35 1100687 non-null float64 \n",
|
||||
"dtypes: datetime64[ns](1), float64(84), object(2)\n",
|
||||
"memory usage: 731.2+ MB\n",
|
||||
"None\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 6
|
||||
"execution_count": 14
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T15:00:45.828404Z",
|
||||
"start_time": "2025-02-09T15:00:45.294830Z"
|
||||
"end_time": "2025-02-11T16:42:04.317134Z",
|
||||
"start_time": "2025-02-11T16:42:03.969288Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -516,17 +533,18 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['up', 'down', 'atr_14', 'atr_6', 'obv', 'maobv_6', 'obv-maobv_6', 'rsi_3', 'rsi_6', 'rsi_9', 'return_10', 'return_20', 'avg_close_5', 'std_return_5', 'std_return_15', 'std_return_25', 'std_return_90', 'std_return_90_2', 'std_return_5 / std_return_90', 'std_return_5 / std_return_25', 'std_return_90 - std_return_90_2', 'ema_5', 'ema_13', 'ema_20', 'ema_60', 'act_factor1', 'act_factor2', 'act_factor3', 'act_factor4', 'act_factor5', 'act_factor6', 'rank_act_factor1', 'rank_act_factor2', 'rank_act_factor3', 'active_buy_volume_large', 'active_buy_volume_big', 'active_buy_volume_small', 'buy_lg_vol - sell_lg_vol', 'buy_elg_vol - sell_elg_vol']\n"
|
||||
"860933\n",
|
||||
"240627\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 19
|
||||
"execution_count": 15
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:56:05.319915Z",
|
||||
"start_time": "2025-02-09T14:56:03.355725Z"
|
||||
"end_time": "2025-02-11T16:42:06.417436Z",
|
||||
"start_time": "2025-02-11T16:42:04.322121Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -558,26 +576,40 @@
|
||||
],
|
||||
"id": "f4f16d63ad18d1bc",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\liaozhaorun\\AppData\\Local\\Temp\\ipykernel_88940\\2181928612.py:16: SettingWithCopyWarning: \n",
|
||||
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
|
||||
"Try using .loc[row_indexer,col_indexer] = value instead\n",
|
||||
"\n",
|
||||
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
|
||||
" train_data['label'], test_data['label'] = get_label(train_data), get_label(test_data)\n",
|
||||
"C:\\Users\\liaozhaorun\\AppData\\Local\\Temp\\ipykernel_88940\\2181928612.py:16: SettingWithCopyWarning: \n",
|
||||
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
|
||||
"Try using .loc[row_indexer,col_indexer] = value instead\n",
|
||||
"\n",
|
||||
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
|
||||
" train_data['label'], test_data['label'] = get_label(train_data), get_label(test_data)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"875004\n",
|
||||
"最小日期: 2017-01-03\n",
|
||||
"最大日期: 2022-12-30\n",
|
||||
"260581\n",
|
||||
"最小日期: 2023-01-03\n",
|
||||
"最大日期: 2025-01-27\n"
|
||||
"747134\n",
|
||||
"184095\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 13
|
||||
"execution_count": 16
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:56:05.480695Z",
|
||||
"start_time": "2025-02-09T14:56:05.367238Z"
|
||||
"end_time": "2025-02-11T16:42:08.032246Z",
|
||||
"start_time": "2025-02-11T16:42:06.481439Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -771,13 +803,13 @@
|
||||
],
|
||||
"id": "8f134d435f71e9e2",
|
||||
"outputs": [],
|
||||
"execution_count": 14
|
||||
"execution_count": 17
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:56:05.576927Z",
|
||||
"start_time": "2025-02-09T14:56:05.480695Z"
|
||||
"end_time": "2025-02-11T16:42:08.126033Z",
|
||||
"start_time": "2025-02-11T16:42:08.047878Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -802,13 +834,13 @@
|
||||
],
|
||||
"id": "4a4542e1ed6afe7d",
|
||||
"outputs": [],
|
||||
"execution_count": 15
|
||||
"execution_count": 18
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:57:25.341222Z",
|
||||
"start_time": "2025-02-09T14:56:05.640256Z"
|
||||
"end_time": "2025-02-11T16:43:30.267422Z",
|
||||
"start_time": "2025-02-11T16:42:08.363141Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -831,22 +863,23 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"train data size: 875004\n",
|
||||
"train data size: 747134\n",
|
||||
"未发现缓存模型,开始训练新模型。\n",
|
||||
"Training until validation scores don't improve for 50 rounds\n",
|
||||
"[500]\ttrain's l2: 0.415226\tvalid's l2: 0.57674\n",
|
||||
"Early stopping, best iteration is:\n",
|
||||
"[378]\ttrain's l2: 0.435049\tvalid's l2: 0.589178\n",
|
||||
"[477]\ttrain's l2: 0.417575\tvalid's l2: 0.576627\n",
|
||||
"Evaluated only: l2\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 16
|
||||
"execution_count": 19
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:57:27.394697Z",
|
||||
"start_time": "2025-02-09T14:57:25.373274Z"
|
||||
"end_time": "2025-02-11T16:43:32.102494Z",
|
||||
"start_time": "2025-02-11T16:43:30.315429Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -856,20 +889,20 @@
|
||||
],
|
||||
"id": "5bb96ca8492e74d",
|
||||
"outputs": [],
|
||||
"execution_count": 17
|
||||
"execution_count": 20
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-02-09T14:57:27.489570Z",
|
||||
"start_time": "2025-02-09T14:57:27.397368Z"
|
||||
"end_time": "2025-02-11T16:43:32.197091Z",
|
||||
"start_time": "2025-02-11T16:43:32.107477Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": "predictions[['trade_date', 'score', 'ts_code']].to_csv('predictions.csv', index=False)",
|
||||
"id": "5d1522a7538db91b",
|
||||
"outputs": [],
|
||||
"execution_count": 18
|
||||
"execution_count": 21
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
@@ -1,486 +0,0 @@
|
||||
trade_date,score,ts_code
|
||||
2023-01-03,0.6847274162535452,600965.SH
|
||||
2023-01-04,0.7414192412896188,000615.SZ
|
||||
2023-01-05,0.5542654290126795,000430.SZ
|
||||
2023-01-06,0.6959513776962396,002640.SZ
|
||||
2023-01-09,0.7412055912703203,600785.SH
|
||||
2023-01-10,0.6855907318251123,002762.SZ
|
||||
2023-01-11,0.7292345443148791,002719.SZ
|
||||
2023-01-12,0.7309633018913224,600996.SH
|
||||
2023-01-13,0.8190324397886146,002279.SZ
|
||||
2023-01-16,0.784606092607123,000850.SZ
|
||||
2023-01-17,0.7241262895910806,002441.SZ
|
||||
2023-01-18,0.7040191348893544,002467.SZ
|
||||
2023-01-19,1.4428906481799044,002195.SZ
|
||||
2023-01-20,0.8043769403690574,000561.SZ
|
||||
2023-01-30,0.8713260866140435,000913.SZ
|
||||
2023-01-31,0.7091214216170246,002560.SZ
|
||||
2023-02-01,0.8674507984004312,002576.SZ
|
||||
2023-02-02,0.8435316672358789,002576.SZ
|
||||
2023-02-03,0.3637794960484866,603698.SH
|
||||
2023-02-06,0.8498784343039595,002401.SZ
|
||||
2023-02-07,0.5210597972482388,002767.SZ
|
||||
2023-02-08,0.9567872514253289,002368.SZ
|
||||
2023-02-09,0.5267235816880836,002155.SZ
|
||||
2023-02-10,0.8402723790587989,002348.SZ
|
||||
2023-02-13,0.4846072502710197,002348.SZ
|
||||
2023-02-14,0.7626025684565886,002877.SZ
|
||||
2023-02-15,0.697045569808066,600225.SH
|
||||
2023-02-16,0.8282986278708487,002748.SZ
|
||||
2023-02-17,1.8315250204409614,601020.SH
|
||||
2023-02-20,0.9746443150927466,003021.SZ
|
||||
2023-02-21,1.33028636760986,002339.SZ
|
||||
2023-02-22,0.7778102046341324,002167.SZ
|
||||
2023-02-23,1.1313865958453686,600100.SH
|
||||
2023-02-24,0.5636940136703907,000716.SZ
|
||||
2023-02-27,1.1864163478203489,600557.SH
|
||||
2023-02-28,1.0001756905854564,603129.SH
|
||||
2023-03-01,0.859829916936714,603025.SH
|
||||
2023-03-02,0.7059826582301507,603186.SH
|
||||
2023-03-03,0.6713484518505006,002942.SZ
|
||||
2023-03-06,0.7514650334919161,002362.SZ
|
||||
2023-03-07,0.9199279895136431,002350.SZ
|
||||
2023-03-08,0.7172896853160168,601872.SH
|
||||
2023-03-09,1.2558830649002728,002808.SZ
|
||||
2023-03-10,1.2172505980712502,003020.SZ
|
||||
2023-03-13,0.5215320654292881,600363.SH
|
||||
2023-03-14,1.0463998807907229,601872.SH
|
||||
2023-03-15,0.583641209552904,603966.SH
|
||||
2023-03-16,0.9789347178467226,603803.SH
|
||||
2023-03-17,0.6572400306835567,600780.SH
|
||||
2023-03-20,0.9514948440683256,601003.SH
|
||||
2023-03-21,0.842214622933076,002439.SZ
|
||||
2023-03-22,1.1462525936633026,601698.SH
|
||||
2023-03-23,0.48812639918095935,601199.SH
|
||||
2023-03-24,0.4727906220196696,601698.SH
|
||||
2023-03-27,0.7956407883949915,000810.SZ
|
||||
2023-03-28,0.9780023176799034,601698.SH
|
||||
2023-03-29,0.7581739222176508,002558.SZ
|
||||
2023-03-30,1.2088597249444364,002425.SZ
|
||||
2023-03-31,1.0383208709472522,000938.SZ
|
||||
2023-04-03,0.7742369597473725,001872.SZ
|
||||
2023-04-04,0.8024470755073208,002858.SZ
|
||||
2023-04-06,0.7607284837753079,002261.SZ
|
||||
2023-04-07,0.9927088245634893,002261.SZ
|
||||
2023-04-10,0.8693657271995023,603019.SH
|
||||
2023-04-11,1.3756495540495381,600228.SH
|
||||
2023-04-12,0.6041603413288005,002222.SZ
|
||||
2023-04-13,0.7744980911161148,002777.SZ
|
||||
2023-04-14,0.8672190988257731,600633.SH
|
||||
2023-04-17,1.4449313652608706,603083.SH
|
||||
2023-04-18,0.6773096694945689,002517.SZ
|
||||
2023-04-19,2.078581022345213,002908.SZ
|
||||
2023-04-20,0.9806780152085147,600203.SH
|
||||
2023-04-21,0.8344159521107176,000686.SZ
|
||||
2023-04-24,1.210049105329498,600749.SH
|
||||
2023-04-25,1.4048193576090038,603699.SH
|
||||
2023-04-26,1.4845584717530398,600750.SH
|
||||
2023-04-27,1.7290167418990006,002351.SZ
|
||||
2023-04-28,0.6169128309035838,002343.SZ
|
||||
2023-05-04,0.406077908055111,603019.SH
|
||||
2023-05-05,0.9080152593104391,603258.SH
|
||||
2023-05-08,0.796876165601434,603083.SH
|
||||
2023-05-09,0.9700970682165659,002291.SZ
|
||||
2023-05-10,1.3258832446428042,002291.SZ
|
||||
2023-05-11,0.8900850443360986,600750.SH
|
||||
2023-05-12,1.0650432251092237,601318.SH
|
||||
2023-05-15,0.6787099027648815,002760.SZ
|
||||
2023-05-16,0.722076527194143,603357.SH
|
||||
2023-05-17,1.053645140729648,603357.SH
|
||||
2023-05-18,0.6034913204660662,601518.SH
|
||||
2023-05-19,0.5868824391890941,000600.SZ
|
||||
2023-05-22,0.7653788907870708,002315.SZ
|
||||
2023-05-23,0.8498831870683509,003021.SZ
|
||||
2023-05-24,0.8222394685174235,600337.SH
|
||||
2023-05-25,0.9415393784400905,600587.SH
|
||||
2023-05-26,0.520220425480583,000600.SZ
|
||||
2023-05-29,0.6595697603731597,002334.SZ
|
||||
2023-05-30,0.606477318736669,603790.SH
|
||||
2023-05-31,0.694237121673502,603662.SH
|
||||
2023-06-01,0.5921959927449983,603196.SH
|
||||
2023-06-02,0.6895081721399422,603019.SH
|
||||
2023-06-05,0.5566382152721012,001309.SZ
|
||||
2023-06-06,1.892873809852157,002587.SZ
|
||||
2023-06-07,0.7678242983656595,605011.SH
|
||||
2023-06-08,1.0539866095101476,000938.SZ
|
||||
2023-06-09,0.8147649527362582,002292.SZ
|
||||
2023-06-12,0.7188933998461803,002173.SZ
|
||||
2023-06-13,0.681977313547429,603097.SH
|
||||
2023-06-14,0.8733642333159071,002865.SZ
|
||||
2023-06-15,0.8968643954524321,603108.SH
|
||||
2023-06-16,0.7840028396319321,002897.SZ
|
||||
2023-06-19,0.8775653925608153,603319.SH
|
||||
2023-06-20,1.0844187891842454,002902.SZ
|
||||
2023-06-21,1.2927896026027148,603629.SH
|
||||
2023-06-26,1.2292848291237288,002261.SZ
|
||||
2023-06-27,1.3781866321602365,000938.SZ
|
||||
2023-06-28,0.8540277846763247,601138.SH
|
||||
2023-06-29,0.8523211757782663,603779.SH
|
||||
2023-06-30,1.1754329601349267,601127.SH
|
||||
2023-07-03,1.2249906293712542,603015.SH
|
||||
2023-07-04,1.1084820336750372,000936.SZ
|
||||
2023-07-05,1.2710980206868936,000936.SZ
|
||||
2023-07-06,0.747949676257483,603728.SH
|
||||
2023-07-07,0.9061602512086774,002835.SZ
|
||||
2023-07-10,0.9551342600022579,002126.SZ
|
||||
2023-07-11,0.966971776030953,603767.SH
|
||||
2023-07-12,0.9443518376543841,601886.SH
|
||||
2023-07-13,0.6769606633633086,603085.SH
|
||||
2023-07-14,0.918333951173531,002036.SZ
|
||||
2023-07-17,0.6569232106980998,603045.SH
|
||||
2023-07-18,0.7121594789903711,002409.SZ
|
||||
2023-07-19,0.7294037039105077,002548.SZ
|
||||
2023-07-20,0.7381883846308512,002703.SZ
|
||||
2023-07-21,0.7652204062690017,002997.SZ
|
||||
2023-07-24,0.9003480376547147,000550.SZ
|
||||
2023-07-25,0.6357345607310146,605020.SH
|
||||
2023-07-26,0.5810885924302148,605020.SH
|
||||
2023-07-27,0.8761890730266239,002316.SZ
|
||||
2023-07-28,0.9028509127260252,000716.SZ
|
||||
2023-07-31,0.4708956316796065,601777.SH
|
||||
2023-08-01,0.5561891737811866,600763.SH
|
||||
2023-08-02,0.8760196470112966,002719.SZ
|
||||
2023-08-03,0.7648464404493108,002400.SZ
|
||||
2023-08-04,0.7791782042380738,601799.SH
|
||||
2023-08-07,0.8061135186567487,000797.SZ
|
||||
2023-08-08,1.1666879365515435,600322.SH
|
||||
2023-08-09,1.4355955291322207,000006.SZ
|
||||
2023-08-10,1.2886157376213954,000656.SZ
|
||||
2023-08-11,1.3479230675318692,002941.SZ
|
||||
2023-08-14,1.0490220109983646,601377.SH
|
||||
2023-08-15,1.0632174359473308,600376.SH
|
||||
2023-08-16,1.050421116938835,002126.SZ
|
||||
2023-08-17,0.6717173215978612,000948.SZ
|
||||
2023-08-18,0.9668301556287141,002907.SZ
|
||||
2023-08-21,1.1746853792925736,003005.SZ
|
||||
2023-08-22,0.9584954141170795,600838.SH
|
||||
2023-08-23,1.2457408517312187,001234.SZ
|
||||
2023-08-24,1.0823923917882998,002999.SZ
|
||||
2023-08-25,0.9378153059525566,603918.SH
|
||||
2023-08-28,1.2421433405918902,603767.SH
|
||||
2023-08-29,0.616127073238452,002696.SZ
|
||||
2023-08-30,0.9031479500764501,000010.SZ
|
||||
2023-08-31,0.8845829289455852,000010.SZ
|
||||
2023-09-01,0.6016754849643945,600272.SH
|
||||
2023-09-04,0.7558571185023197,600272.SH
|
||||
2023-09-05,0.4028980705656072,000678.SZ
|
||||
2023-09-06,0.659374499556469,603080.SH
|
||||
2023-09-07,0.6245495405404559,000609.SZ
|
||||
2023-09-08,0.6710722697700532,603919.SH
|
||||
2023-09-11,0.6278048802992457,600546.SH
|
||||
2023-09-12,0.8256329238016435,600546.SH
|
||||
2023-09-13,0.9974851537103986,601127.SH
|
||||
2023-09-14,1.2529240943908486,603005.SH
|
||||
2023-09-15,0.6551278623697204,603306.SH
|
||||
2023-09-18,0.62491397271537,000851.SZ
|
||||
2023-09-19,0.9590430560641906,600293.SH
|
||||
2023-09-20,0.9192992329949209,600895.SH
|
||||
2023-09-21,1.303323539412371,603667.SH
|
||||
2023-09-22,0.6392556165728372,002406.SZ
|
||||
2023-09-25,0.550363061204975,603933.SH
|
||||
2023-09-26,0.8885810012289143,000766.SZ
|
||||
2023-09-27,1.3119504188158804,605588.SH
|
||||
2023-09-28,0.6383963467007131,002885.SZ
|
||||
2023-10-09,0.5559833174181884,603277.SH
|
||||
2023-10-10,0.6746335129218759,002855.SZ
|
||||
2023-10-11,0.48076279797688554,001319.SZ
|
||||
2023-10-12,0.4648032423789084,002953.SZ
|
||||
2023-10-13,0.7973569102606312,605588.SH
|
||||
2023-10-16,0.6753500013003589,603929.SH
|
||||
2023-10-17,0.939032197442827,002786.SZ
|
||||
2023-10-18,1.3316765134484991,603005.SH
|
||||
2023-10-19,1.5107094655109568,002728.SZ
|
||||
2023-10-20,1.8033472200834302,603890.SH
|
||||
2023-10-23,2.0156758075487904,000526.SZ
|
||||
2023-10-24,1.733095955568728,600186.SH
|
||||
2023-10-25,1.0763644734039597,002456.SZ
|
||||
2023-10-26,0.6254989123134431,600155.SH
|
||||
2023-10-27,0.9189894086467906,000712.SZ
|
||||
2023-10-30,0.82608918468284,600839.SH
|
||||
2023-10-31,0.7212314254570089,001319.SZ
|
||||
2023-11-01,0.7217175319235539,002657.SZ
|
||||
2023-11-02,0.7778599932153227,002456.SZ
|
||||
2023-11-03,1.3422820103526423,603985.SH
|
||||
2023-11-06,0.5239681122691597,600595.SH
|
||||
2023-11-07,0.5067988914432168,000520.SZ
|
||||
2023-11-08,0.8068628626883659,603009.SH
|
||||
2023-11-09,0.795444145270753,601127.SH
|
||||
2023-11-10,0.7853290033363176,600630.SH
|
||||
2023-11-13,0.6675304106579922,601595.SH
|
||||
2023-11-14,0.2361369659661822,000828.SZ
|
||||
2023-11-15,1.3945937102768664,603598.SH
|
||||
2023-11-16,0.9576360953800751,000628.SZ
|
||||
2023-11-17,0.6890730621251102,603108.SH
|
||||
2023-11-20,0.7909511281469108,000628.SZ
|
||||
2023-11-21,0.8142228770378246,000925.SZ
|
||||
2023-11-22,0.797507102177366,000550.SZ
|
||||
2023-11-23,0.7063630358338048,000676.SZ
|
||||
2023-11-24,1.036008941153352,002181.SZ
|
||||
2023-11-27,1.0291531391754778,000503.SZ
|
||||
2023-11-28,0.9076486100273481,600775.SH
|
||||
2023-11-29,0.7882491062137358,000669.SZ
|
||||
2023-11-30,1.0967518981113826,000669.SZ
|
||||
2023-12-01,0.7311870736612255,000625.SZ
|
||||
2023-12-04,1.0691371238894785,603286.SH
|
||||
2023-12-05,1.3131270390024472,605188.SH
|
||||
2023-12-06,0.7752257820655966,000628.SZ
|
||||
2023-12-07,0.8197027217611897,600107.SH
|
||||
2023-12-08,1.3967047074635028,603488.SH
|
||||
2023-12-11,0.687045285463665,002277.SZ
|
||||
2023-12-12,0.665884682887716,600593.SH
|
||||
2023-12-13,0.654047737248992,600476.SH
|
||||
2023-12-14,1.0532572750390772,603106.SH
|
||||
2023-12-15,1.0658083351666034,603358.SH
|
||||
2023-12-18,0.962400311858336,000766.SZ
|
||||
2023-12-19,0.7287547482546808,603103.SH
|
||||
2023-12-20,1.2148728495986132,002647.SZ
|
||||
2023-12-21,0.7541763251442525,002858.SZ
|
||||
2023-12-22,0.8726322448001688,600178.SH
|
||||
2023-12-25,0.8241484608574933,605011.SH
|
||||
2023-12-26,0.9109440061301425,603992.SH
|
||||
2023-12-27,0.8418823218408088,002660.SZ
|
||||
2023-12-28,0.6918104133614209,002238.SZ
|
||||
2023-12-29,0.587505902687491,002495.SZ
|
||||
2024-01-02,0.9211111544777676,002587.SZ
|
||||
2024-01-03,0.7226235020970133,000691.SZ
|
||||
2024-01-04,0.9569550769001772,002962.SZ
|
||||
2024-01-05,1.1926365483735857,605117.SH
|
||||
2024-01-08,1.2688927804343633,603032.SH
|
||||
2024-01-09,0.658120719671456,002862.SZ
|
||||
2024-01-10,1.0753659753822198,000698.SZ
|
||||
2024-01-11,0.8894494773121738,603097.SH
|
||||
2024-01-12,0.9087175987157813,600593.SH
|
||||
2024-01-15,0.5892323752732013,603212.SH
|
||||
2024-01-16,0.7839193778147607,000698.SZ
|
||||
2024-01-17,1.0625258983405035,603172.SH
|
||||
2024-01-18,1.2631347573071583,002033.SZ
|
||||
2024-01-19,1.178331671274573,603579.SH
|
||||
2024-01-22,1.6352965224693876,605268.SH
|
||||
2024-01-23,1.4266068895392103,605117.SH
|
||||
2024-01-24,0.8002314972730927,600138.SH
|
||||
2024-01-25,0.6269522471780932,603099.SH
|
||||
2024-01-26,1.1309900405971738,605111.SH
|
||||
2024-01-29,1.125066361142788,002253.SZ
|
||||
2024-01-30,1.351423375727843,003007.SZ
|
||||
2024-01-31,1.5739771441257069,601138.SH
|
||||
2024-02-01,1.499054147286471,002033.SZ
|
||||
2024-02-02,1.5167645269468597,601038.SH
|
||||
2024-02-05,1.903436398968963,000998.SZ
|
||||
2024-02-06,0.8212170920332696,600705.SH
|
||||
2024-02-07,0.8351364611756162,603199.SH
|
||||
2024-02-08,0.6822013314565247,601998.SH
|
||||
2024-02-19,0.5444839345994206,000999.SZ
|
||||
2024-02-20,0.5734873097155654,603369.SH
|
||||
2024-02-21,0.43260992475178217,600023.SH
|
||||
2024-02-22,0.4837658423417254,000526.SZ
|
||||
2024-02-23,0.25932845682914313,000157.SZ
|
||||
2024-02-26,0.37391625217883473,000983.SZ
|
||||
2024-02-27,0.06249364085384111,002039.SZ
|
||||
2024-02-28,1.038623993098607,000680.SZ
|
||||
2024-02-29,0.11792404338777529,603871.SH
|
||||
2024-03-01,0.30810066963043975,603605.SH
|
||||
2024-03-04,0.17622933681947947,600375.SH
|
||||
2024-03-05,1.0199617166369774,002009.SZ
|
||||
2024-03-06,0.7025950679251926,002209.SZ
|
||||
2024-03-07,0.8130361341508562,002317.SZ
|
||||
2024-03-08,0.6714948117029352,603960.SH
|
||||
2024-03-11,0.7527103580484402,603960.SH
|
||||
2024-03-12,0.773794092704635,603960.SH
|
||||
2024-03-13,0.6395980350337678,603499.SH
|
||||
2024-03-14,0.6983134888804106,603660.SH
|
||||
2024-03-15,0.990357376475744,601138.SH
|
||||
2024-03-18,0.4182273803259301,002075.SZ
|
||||
2024-03-19,0.8116021296004745,603050.SH
|
||||
2024-03-20,0.6916582321872963,605580.SH
|
||||
2024-03-21,0.7126108686308776,002698.SZ
|
||||
2024-03-22,0.795964501966808,603190.SH
|
||||
2024-03-25,1.0652068531193497,603286.SH
|
||||
2024-03-26,1.2060727717193194,002331.SZ
|
||||
2024-03-27,1.8308956146424886,001696.SZ
|
||||
2024-03-28,1.5762953683649072,002645.SZ
|
||||
2024-03-29,0.8133804882766478,002055.SZ
|
||||
2024-04-01,0.6881987381521469,002735.SZ
|
||||
2024-04-02,0.9728619403924941,002085.SZ
|
||||
2024-04-03,0.9735850429701983,002625.SZ
|
||||
2024-04-08,0.9464502611855133,002805.SZ
|
||||
2024-04-09,1.10422053943107,002085.SZ
|
||||
2024-04-10,0.699553803327553,603822.SH
|
||||
2024-04-11,1.2813227488155954,002544.SZ
|
||||
2024-04-12,0.9677010248477915,605198.SH
|
||||
2024-04-15,1.2722648770139777,002290.SZ
|
||||
2024-04-16,2.1135975645782725,002521.SZ
|
||||
2024-04-17,1.0448007042761251,000737.SZ
|
||||
2024-04-18,1.3682438721410928,603619.SH
|
||||
2024-04-19,0.6510347025537216,000933.SZ
|
||||
2024-04-22,1.1007294592332375,600529.SH
|
||||
2024-04-23,1.0096847778899667,002078.SZ
|
||||
2024-04-24,0.5132039397179469,000949.SZ
|
||||
2024-04-25,1.7289140437217827,600066.SH
|
||||
2024-04-26,1.048178737250126,603556.SH
|
||||
2024-04-29,0.28151131629200876,000949.SZ
|
||||
2024-04-30,0.5902959535550075,605098.SH
|
||||
2024-05-06,0.8659440618533316,001696.SZ
|
||||
2024-05-07,0.4125483888931327,002225.SZ
|
||||
2024-05-08,0.49991019731911135,002597.SZ
|
||||
2024-05-09,0.8523675809088074,002590.SZ
|
||||
2024-05-10,0.6072304373378594,001696.SZ
|
||||
2024-05-13,0.9449133844307348,600326.SH
|
||||
2024-05-14,0.756524501371889,002025.SZ
|
||||
2024-05-15,0.7974348512463216,600682.SH
|
||||
2024-05-16,0.9752446361705888,600644.SH
|
||||
2024-05-17,1.1846986232709233,000702.SZ
|
||||
2024-05-20,0.7167728676668204,002851.SZ
|
||||
2024-05-21,1.071890852713521,603683.SH
|
||||
2024-05-22,0.7124540930368298,600463.SH
|
||||
2024-05-23,1.5016154741945653,002225.SZ
|
||||
2024-05-24,1.2198831133459211,002968.SZ
|
||||
2024-05-27,0.9536299254414154,000656.SZ
|
||||
2024-05-28,0.8425457543469408,002761.SZ
|
||||
2024-05-29,0.652762060180136,600979.SH
|
||||
2024-05-30,0.9000889953940735,002455.SZ
|
||||
2024-05-31,0.9330771253458983,601825.SH
|
||||
2024-06-03,1.2914669574335471,001267.SZ
|
||||
2024-06-04,0.829699499403838,600530.SH
|
||||
2024-06-05,1.0758350766018299,002922.SZ
|
||||
2024-06-06,0.8595311066455215,603360.SH
|
||||
2024-06-07,1.0888503051113,002889.SZ
|
||||
2024-06-11,1.0628038633716435,002475.SZ
|
||||
2024-06-12,1.1159013979424315,603009.SH
|
||||
2024-06-13,1.1812561799680747,600996.SH
|
||||
2024-06-14,0.8256170648299659,600039.SH
|
||||
2024-06-17,0.8645410455127762,000528.SZ
|
||||
2024-06-18,0.6063406599939511,600996.SH
|
||||
2024-06-19,0.7166446473651414,600192.SH
|
||||
2024-06-20,0.932110291603618,605598.SH
|
||||
2024-06-21,0.9558209107020993,603936.SH
|
||||
2024-06-24,1.119014534304907,600992.SH
|
||||
2024-06-25,1.3527294398026957,600584.SH
|
||||
2024-06-26,0.7188166389093542,000504.SZ
|
||||
2024-06-27,1.9515093336713365,002452.SZ
|
||||
2024-06-28,0.8843544096493936,600889.SH
|
||||
2024-07-01,0.6545882280229176,003004.SZ
|
||||
2024-07-02,0.6762487770835988,600584.SH
|
||||
2024-07-03,0.9128444390874889,601179.SH
|
||||
2024-07-04,1.1423863246899275,603225.SH
|
||||
2024-07-05,0.9324658736527716,603936.SH
|
||||
2024-07-08,1.780537827812583,603328.SH
|
||||
2024-07-09,0.7579237257512456,000679.SZ
|
||||
2024-07-10,0.6704021737995826,605117.SH
|
||||
2024-07-11,0.6117132499929072,000622.SZ
|
||||
2024-07-12,1.0566477568456074,002452.SZ
|
||||
2024-07-15,0.6602660923500289,605081.SH
|
||||
2024-07-16,0.5502090318853736,002420.SZ
|
||||
2024-07-17,0.6837622842594867,002355.SZ
|
||||
2024-07-18,0.8242173773899442,002384.SZ
|
||||
2024-07-19,0.9979238076969816,002384.SZ
|
||||
2024-07-22,0.4982073979858695,000421.SZ
|
||||
2024-07-23,1.1543952284060066,002428.SZ
|
||||
2024-07-24,1.2334918071766405,605111.SH
|
||||
2024-07-25,0.8987252044027945,002496.SZ
|
||||
2024-07-26,0.8562640506752258,600171.SH
|
||||
2024-07-29,0.5774106541432314,002750.SZ
|
||||
2024-07-30,0.5406184547635255,600563.SH
|
||||
2024-07-31,0.5575394015591096,002700.SZ
|
||||
2024-08-01,0.3836358457058139,600099.SH
|
||||
2024-08-02,0.670543769867587,605081.SH
|
||||
2024-08-05,1.2561423052432321,605117.SH
|
||||
2024-08-06,0.9373802633817199,000584.SZ
|
||||
2024-08-07,0.8074459777954732,603032.SH
|
||||
2024-08-08,0.8017404350976902,600611.SH
|
||||
2024-08-09,0.9444750578832374,000659.SZ
|
||||
2024-08-12,0.8308531709022774,000880.SZ
|
||||
2024-08-13,0.6345130236563948,600266.SH
|
||||
2024-08-14,0.7618996741024034,000159.SZ
|
||||
2024-08-15,0.7957196976564392,000880.SZ
|
||||
2024-08-16,0.8007104277247147,603050.SH
|
||||
2024-08-19,0.8488617680848443,603444.SH
|
||||
2024-08-20,1.049247341754445,002488.SZ
|
||||
2024-08-21,1.2543709456137933,002488.SZ
|
||||
2024-08-22,1.0702026523317902,002208.SZ
|
||||
2024-08-23,1.0790725273037058,002369.SZ
|
||||
2024-08-26,0.8933596937509765,000532.SZ
|
||||
2024-08-27,0.9555026539273229,605318.SH
|
||||
2024-08-28,0.8517730333686951,002547.SZ
|
||||
2024-08-29,0.8787028549560587,003001.SZ
|
||||
2024-08-30,0.5949301031458588,601898.SH
|
||||
2024-09-02,1.0927036539101782,603826.SH
|
||||
2024-09-03,0.5011518255679451,000810.SZ
|
||||
2024-09-04,0.913670019713004,001298.SZ
|
||||
2024-09-05,0.5722903163709645,600375.SH
|
||||
2024-09-06,1.054280211341685,002622.SZ
|
||||
2024-09-09,1.1145869455283224,600375.SH
|
||||
2024-09-10,0.6071645644461853,600804.SH
|
||||
2024-09-11,0.8120257237744295,002808.SZ
|
||||
2024-09-12,0.7226510652354332,600148.SH
|
||||
2024-09-13,1.4358476935516946,603615.SH
|
||||
2024-09-18,0.8351081061832145,002946.SZ
|
||||
2024-09-19,0.605865384829211,600898.SH
|
||||
2024-09-20,0.9533885243905273,603398.SH
|
||||
2024-09-23,1.046054385469168,601162.SH
|
||||
2024-09-24,0.3758184358111333,603559.SH
|
||||
2024-09-25,0.8156363720747627,600756.SH
|
||||
2024-09-26,0.5051488053045387,600550.SH
|
||||
2024-09-27,0.16901120016969293,002016.SZ
|
||||
2024-09-30,0.03361915273177237,603106.SH
|
||||
2024-10-08,0.02829952163781644,603106.SH
|
||||
2024-10-09,0.15132702693149014,601336.SH
|
||||
2024-10-10,0.5264407322666304,000402.SZ
|
||||
2024-10-11,1.0343311919140215,600657.SH
|
||||
2024-10-14,0.47180187869811324,603383.SH
|
||||
2024-10-15,0.8703255693900985,603106.SH
|
||||
2024-10-16,0.8602575981884926,002987.SZ
|
||||
2024-10-17,0.8415090474760394,000567.SZ
|
||||
2024-10-18,0.15292428350076237,002542.SZ
|
||||
2024-10-21,0.4922089945140812,002457.SZ
|
||||
2024-10-22,0.4176771447393169,002423.SZ
|
||||
2024-10-23,0.8519606263347589,000158.SZ
|
||||
2024-10-24,0.5430046541942165,000935.SZ
|
||||
2024-10-25,0.18041199007445233,603016.SH
|
||||
2024-10-28,0.5571845419116188,000503.SZ
|
||||
2024-10-29,0.4049481417593221,002851.SZ
|
||||
2024-10-30,0.7134818524722009,600463.SH
|
||||
2024-10-31,0.5829203522209173,603117.SH
|
||||
2024-11-01,1.2246655429458404,002851.SZ
|
||||
2024-11-04,0.8176452500049061,600843.SH
|
||||
2024-11-05,0.896531400955133,002514.SZ
|
||||
2024-11-06,0.8080466337179094,600292.SH
|
||||
2024-11-07,0.8536978345761432,600481.SH
|
||||
2024-11-08,0.735404763610977,002047.SZ
|
||||
2024-11-11,0.7749352489908305,002428.SZ
|
||||
2024-11-12,0.8967548353595826,002428.SZ
|
||||
2024-11-13,1.0199850479686239,603859.SH
|
||||
2024-11-14,0.9361081815051415,603559.SH
|
||||
2024-11-15,1.5997213068383358,002086.SZ
|
||||
2024-11-18,1.5789594007558525,002709.SZ
|
||||
2024-11-19,1.5249787983366927,603825.SH
|
||||
2024-11-20,0.736292965730012,002808.SZ
|
||||
2024-11-21,0.7544341372210354,603859.SH
|
||||
2024-11-22,1.2744170240551567,600593.SH
|
||||
2024-11-25,0.8324187454861728,600787.SH
|
||||
2024-11-26,1.0752006153991913,600736.SH
|
||||
2024-11-27,0.6500606694243171,002245.SZ
|
||||
2024-11-28,0.8456761058883665,000833.SZ
|
||||
2024-11-29,0.8489157795122361,002354.SZ
|
||||
2024-12-02,0.6832024025795977,002611.SZ
|
||||
2024-12-03,0.8939114413301544,603366.SH
|
||||
2024-12-04,1.0277665925094743,002822.SZ
|
||||
2024-12-05,0.9103466279163851,002175.SZ
|
||||
2024-12-06,0.7686238693084577,002467.SZ
|
||||
2024-12-09,1.0846053237578963,601933.SH
|
||||
2024-12-10,1.0700371757624498,600193.SH
|
||||
2024-12-11,0.7673727634361369,002520.SZ
|
||||
2024-12-12,0.8497906144901559,002362.SZ
|
||||
2024-12-13,1.254346634364545,603429.SH
|
||||
2024-12-16,1.0386293779387827,000727.SZ
|
||||
2024-12-17,1.2458109349303497,600157.SH
|
||||
2024-12-18,1.3409657396440136,003002.SZ
|
||||
2024-12-19,1.1408332938187322,600593.SH
|
||||
2024-12-20,0.8248161307709121,002512.SZ
|
||||
2024-12-23,1.1576027817247634,002336.SZ
|
||||
2024-12-24,0.8652560164174093,603610.SH
|
||||
2024-12-25,0.8928903216570524,002045.SZ
|
||||
2024-12-26,0.7436802683703838,603214.SH
|
||||
2024-12-27,0.8278524197563604,002945.SZ
|
||||
2024-12-30,0.6846259683364331,600223.SH
|
||||
2024-12-31,1.0514482797503029,001309.SZ
|
||||
2025-01-02,1.4104671874229635,603668.SH
|
||||
|
@@ -1,265 +0,0 @@
|
||||
trade_date,score,ts_code
|
||||
2024-01-02,0.8906433047229376,002587.SZ
|
||||
2024-01-03,0.800255773815545,000691.SZ
|
||||
2024-01-04,0.918203870395468,002962.SZ
|
||||
2024-01-05,1.1734063865615825,605117.SH
|
||||
2024-01-08,1.2784720379037475,600761.SH
|
||||
2024-01-09,0.5936470874291284,002862.SZ
|
||||
2024-01-10,0.9080905815108482,000698.SZ
|
||||
2024-01-11,0.827458720223193,603097.SH
|
||||
2024-01-12,0.994883205877543,600593.SH
|
||||
2024-01-15,0.6804254263110727,603212.SH
|
||||
2024-01-16,0.7194593431343859,000698.SZ
|
||||
2024-01-17,1.0860069907228742,603172.SH
|
||||
2024-01-18,1.3749235527137786,603828.SH
|
||||
2024-01-19,1.2391308950507334,603579.SH
|
||||
2024-01-22,1.7603168299560354,605268.SH
|
||||
2024-01-23,1.5656552549163458,605117.SH
|
||||
2024-01-24,0.7379915949457881,600138.SH
|
||||
2024-01-25,0.7346719736914655,603099.SH
|
||||
2024-01-26,1.0310897640701377,605111.SH
|
||||
2024-01-29,1.1768938262108766,603398.SH
|
||||
2024-01-30,1.235487562255028,003007.SZ
|
||||
2024-01-31,1.5371910050217372,601138.SH
|
||||
2024-02-01,1.3629464247750829,600551.SH
|
||||
2024-02-02,1.52270944692793,601038.SH
|
||||
2024-02-05,1.847344110860692,000550.SZ
|
||||
2024-02-06,0.8127749986671006,600705.SH
|
||||
2024-02-07,0.7565034143929377,603199.SH
|
||||
2024-02-08,0.7247153170440155,600188.SH
|
||||
2024-02-19,0.41560847492124364,002032.SZ
|
||||
2024-02-20,0.5419618315007714,603369.SH
|
||||
2024-02-21,0.44193316268825533,600023.SH
|
||||
2024-02-22,0.45382033625301066,000526.SZ
|
||||
2024-02-23,0.25689917770287357,000157.SZ
|
||||
2024-02-26,0.4253231714991775,000983.SZ
|
||||
2024-02-27,0.03172161439110529,605151.SH
|
||||
2024-02-28,1.074800376390378,000680.SZ
|
||||
2024-02-29,0.11241663388214615,002467.SZ
|
||||
2024-03-01,0.317478967758629,603605.SH
|
||||
2024-03-04,0.17878811429242739,600860.SH
|
||||
2024-03-05,1.0151694508153393,002009.SZ
|
||||
2024-03-06,0.8229010452846762,002209.SZ
|
||||
2024-03-07,0.8017175629386889,600584.SH
|
||||
2024-03-08,0.6810433978551881,603960.SH
|
||||
2024-03-11,0.9532104338812376,603960.SH
|
||||
2024-03-12,0.7055297835013503,603960.SH
|
||||
2024-03-13,0.5920124881579221,603499.SH
|
||||
2024-03-14,0.661232064922907,603660.SH
|
||||
2024-03-15,0.8778620305552904,601138.SH
|
||||
2024-03-18,0.42042942845890563,002075.SZ
|
||||
2024-03-19,0.7527868193603998,603050.SH
|
||||
2024-03-20,0.5531908723666995,605580.SH
|
||||
2024-03-21,0.7900117288163369,002698.SZ
|
||||
2024-03-22,0.8285381778407641,603190.SH
|
||||
2024-03-25,1.0749381159867608,603286.SH
|
||||
2024-03-26,1.2654734266422276,002331.SZ
|
||||
2024-03-27,1.8684480159293833,001696.SZ
|
||||
2024-03-28,1.6075301389782366,002645.SZ
|
||||
2024-03-29,0.8465441903404123,002055.SZ
|
||||
2024-04-01,0.7568317810951942,002735.SZ
|
||||
2024-04-02,1.0341346018053856,002085.SZ
|
||||
2024-04-03,1.0122022102013215,002130.SZ
|
||||
2024-04-08,0.8881305473937254,002805.SZ
|
||||
2024-04-09,1.0559556356983075,002085.SZ
|
||||
2024-04-10,0.6554344664442165,603822.SH
|
||||
2024-04-11,1.2760784980841757,002544.SZ
|
||||
2024-04-12,1.0181838249663664,605198.SH
|
||||
2024-04-15,1.221720496054648,002290.SZ
|
||||
2024-04-16,2.0663546208214703,002521.SZ
|
||||
2024-04-17,1.1065962300439527,000737.SZ
|
||||
2024-04-18,1.34853784445544,603619.SH
|
||||
2024-04-19,0.6639505828915956,000933.SZ
|
||||
2024-04-22,1.1652613644520093,600529.SH
|
||||
2024-04-23,1.0507483721309534,002078.SZ
|
||||
2024-04-24,0.7225763953314781,000949.SZ
|
||||
2024-04-25,1.9430192587586146,600066.SH
|
||||
2024-04-26,1.0817360300030114,603556.SH
|
||||
2024-04-29,0.21577435079395113,600480.SH
|
||||
2024-04-30,0.5290265764148879,605098.SH
|
||||
2024-05-06,0.7885258258967485,001696.SZ
|
||||
2024-05-07,0.415812996822765,002225.SZ
|
||||
2024-05-08,0.5596574674012184,603232.SH
|
||||
2024-05-09,0.8548632655231382,002590.SZ
|
||||
2024-05-10,0.5787850519196119,001696.SZ
|
||||
2024-05-13,0.9751906596140552,000952.SZ
|
||||
2024-05-14,0.7644462578838344,600645.SH
|
||||
2024-05-15,0.8589488842170756,600682.SH
|
||||
2024-05-16,1.049953727857974,600644.SH
|
||||
2024-05-17,1.1220964730505885,000702.SZ
|
||||
2024-05-20,0.8027292772970297,002851.SZ
|
||||
2024-05-21,1.1153910838352858,603683.SH
|
||||
2024-05-22,0.6413250933571519,002922.SZ
|
||||
2024-05-23,1.570388967019694,002225.SZ
|
||||
2024-05-24,1.2444795042063028,002968.SZ
|
||||
2024-05-27,0.9627736773164858,600675.SH
|
||||
2024-05-28,0.9448048863120843,002761.SZ
|
||||
2024-05-29,0.6810520099963742,600979.SH
|
||||
2024-05-30,0.842272857355848,600530.SH
|
||||
2024-05-31,1.0001129400930693,600101.SH
|
||||
2024-06-03,1.3637566909343166,001267.SZ
|
||||
2024-06-04,0.9588694721783405,600530.SH
|
||||
2024-06-05,1.0953534292665954,002922.SZ
|
||||
2024-06-06,0.8110235687535462,603360.SH
|
||||
2024-06-07,1.2134023901747366,002889.SZ
|
||||
2024-06-11,1.0772961141495465,002655.SZ
|
||||
2024-06-12,1.1183914831029496,603009.SH
|
||||
2024-06-13,1.0362186103086477,600996.SH
|
||||
2024-06-14,0.7480333968482387,600039.SH
|
||||
2024-06-17,1.0007287301926653,000528.SZ
|
||||
2024-06-18,0.5381156056733658,600996.SH
|
||||
2024-06-19,0.7036814608094294,600830.SH
|
||||
2024-06-20,0.8499910179916197,605598.SH
|
||||
2024-06-21,1.2150720829980681,603936.SH
|
||||
2024-06-24,1.0311244474924908,600992.SH
|
||||
2024-06-25,1.2484419002632245,600584.SH
|
||||
2024-06-26,0.7320854040096385,000819.SZ
|
||||
2024-06-27,1.9029808384109885,002452.SZ
|
||||
2024-06-28,0.8803270724492669,600889.SH
|
||||
2024-07-01,0.6059109111833119,000622.SZ
|
||||
2024-07-02,0.656778781716391,600584.SH
|
||||
2024-07-03,0.8605418473204086,601179.SH
|
||||
2024-07-04,1.073683249192727,603225.SH
|
||||
2024-07-05,0.8800051248743536,603936.SH
|
||||
2024-07-08,1.8061114289786495,603328.SH
|
||||
2024-07-09,0.5826571385994789,000679.SZ
|
||||
2024-07-10,0.8413277231762297,605117.SH
|
||||
2024-07-11,0.6665748975268276,000622.SZ
|
||||
2024-07-12,1.0278922272860618,002452.SZ
|
||||
2024-07-15,0.6403011305936952,605081.SH
|
||||
2024-07-16,0.592445020815451,002420.SZ
|
||||
2024-07-17,0.5442518053370551,002355.SZ
|
||||
2024-07-18,0.8022024783282671,002384.SZ
|
||||
2024-07-19,0.9433013682690108,002384.SZ
|
||||
2024-07-22,0.6240394772580439,000421.SZ
|
||||
2024-07-23,1.237721650844904,002428.SZ
|
||||
2024-07-24,1.186379759584258,605111.SH
|
||||
2024-07-25,0.8926351872925693,002496.SZ
|
||||
2024-07-26,0.8499067690354271,600171.SH
|
||||
2024-07-29,0.7013969819645556,002750.SZ
|
||||
2024-07-30,0.615258963090716,600563.SH
|
||||
2024-07-31,0.5799237504937365,002700.SZ
|
||||
2024-08-01,0.5070284832062075,600834.SH
|
||||
2024-08-02,0.6485822834772664,600604.SH
|
||||
2024-08-05,1.3222325162798954,605117.SH
|
||||
2024-08-06,0.9935887583155018,000584.SZ
|
||||
2024-08-07,0.7440148514526516,603032.SH
|
||||
2024-08-08,0.8934326068252262,600611.SH
|
||||
2024-08-09,0.9907610203863012,000659.SZ
|
||||
2024-08-12,0.7143811940598249,000880.SZ
|
||||
2024-08-13,0.5948683342786406,600266.SH
|
||||
2024-08-14,0.7780755309120447,000159.SZ
|
||||
2024-08-15,0.8738359592762805,000880.SZ
|
||||
2024-08-16,0.7460601727356423,603050.SH
|
||||
2024-08-19,0.8904872743308099,603444.SH
|
||||
2024-08-20,1.077089845741329,002488.SZ
|
||||
2024-08-21,1.330096420372438,002488.SZ
|
||||
2024-08-22,1.04117609681098,002208.SZ
|
||||
2024-08-23,1.2634267858516914,002369.SZ
|
||||
2024-08-26,0.8745811905917017,000532.SZ
|
||||
2024-08-27,0.836754154047108,002760.SZ
|
||||
2024-08-28,0.7231326607988842,002547.SZ
|
||||
2024-08-29,0.8735120215139563,003001.SZ
|
||||
2024-08-30,0.6615140980616735,601898.SH
|
||||
2024-09-02,1.093224090711538,603826.SH
|
||||
2024-09-03,0.41407989346203866,002309.SZ
|
||||
2024-09-04,0.7919233491318468,001298.SZ
|
||||
2024-09-05,0.6449753890047838,000908.SZ
|
||||
2024-09-06,1.17109797325565,002622.SZ
|
||||
2024-09-09,1.2278175192855338,000999.SZ
|
||||
2024-09-10,0.7463596223821397,600804.SH
|
||||
2024-09-11,0.7470176349514708,002808.SZ
|
||||
2024-09-12,0.7243651180373872,603559.SH
|
||||
2024-09-13,1.474732794777432,603615.SH
|
||||
2024-09-18,0.883126816576788,000659.SZ
|
||||
2024-09-19,0.640225572474989,600898.SH
|
||||
2024-09-20,1.051164703847969,603398.SH
|
||||
2024-09-23,0.9312327237656652,601162.SH
|
||||
2024-09-24,0.47774549082415085,603559.SH
|
||||
2024-09-25,0.9563618822865794,600756.SH
|
||||
2024-09-26,0.5275946326737218,002686.SZ
|
||||
2024-09-27,0.18984202360702415,002016.SZ
|
||||
2024-09-30,0.035786009050673036,603106.SH
|
||||
2024-10-08,0.032889649456072596,603106.SH
|
||||
2024-10-09,0.12465071252054723,601336.SH
|
||||
2024-10-10,0.6969210259884471,000402.SZ
|
||||
2024-10-11,1.0531806211526256,600099.SH
|
||||
2024-10-14,0.46171010596010975,601162.SH
|
||||
2024-10-15,1.050584350922452,000402.SZ
|
||||
2024-10-16,0.9133292498947153,002987.SZ
|
||||
2024-10-17,0.7700882254413255,000567.SZ
|
||||
2024-10-18,0.1201641254984537,600895.SH
|
||||
2024-10-21,0.6976186419462845,002457.SZ
|
||||
2024-10-22,0.29432613116032685,002423.SZ
|
||||
2024-10-23,0.7806425787966057,000158.SZ
|
||||
2024-10-24,0.6036172569478745,002199.SZ
|
||||
2024-10-25,0.12282827583399647,603016.SH
|
||||
2024-10-28,0.5245178749249334,000503.SZ
|
||||
2024-10-29,0.5076972792469883,002851.SZ
|
||||
2024-10-30,0.7895092176015108,600463.SH
|
||||
2024-10-31,0.6192784720087864,603117.SH
|
||||
2024-11-01,1.204091078793982,002134.SZ
|
||||
2024-11-04,0.8093625376363384,002570.SZ
|
||||
2024-11-05,0.8638488115176264,600172.SH
|
||||
2024-11-06,0.8186577511607894,600292.SH
|
||||
2024-11-07,0.8635644200307799,600481.SH
|
||||
2024-11-08,0.747868586080844,002047.SZ
|
||||
2024-11-11,0.8396084711761063,002428.SZ
|
||||
2024-11-12,0.7919805059954543,603859.SH
|
||||
2024-11-13,0.9060991217118458,603859.SH
|
||||
2024-11-14,0.9421847563274262,600966.SH
|
||||
2024-11-15,1.5178035825387006,002086.SZ
|
||||
2024-11-18,1.5376931721833804,600212.SH
|
||||
2024-11-19,1.4060097628439219,603825.SH
|
||||
2024-11-20,0.8890834002457785,002808.SZ
|
||||
2024-11-21,0.8855345297456824,603859.SH
|
||||
2024-11-22,1.119413451276471,600593.SH
|
||||
2024-11-25,0.7785122491322624,600787.SH
|
||||
2024-11-26,1.0000210964516405,600736.SH
|
||||
2024-11-27,0.8847088850937169,002245.SZ
|
||||
2024-11-28,0.8621169938483969,601360.SH
|
||||
2024-11-29,0.7042168573520408,002354.SZ
|
||||
2024-12-02,0.6426744321671465,002611.SZ
|
||||
2024-12-03,0.9021248369663103,603366.SH
|
||||
2024-12-04,0.9942733603597254,002822.SZ
|
||||
2024-12-05,0.8594169937974554,002175.SZ
|
||||
2024-12-06,0.6985253068214117,603366.SH
|
||||
2024-12-09,0.9476416369172441,601933.SH
|
||||
2024-12-10,1.053999067291189,600193.SH
|
||||
2024-12-11,0.6996323878339654,002193.SZ
|
||||
2024-12-12,0.9535599508119768,002362.SZ
|
||||
2024-12-13,1.3279717542253164,603429.SH
|
||||
2024-12-16,1.0260681164941636,000727.SZ
|
||||
2024-12-17,1.3063049942413876,600157.SH
|
||||
2024-12-18,1.3121814535335503,002878.SZ
|
||||
2024-12-19,1.219098477203033,600593.SH
|
||||
2024-12-20,0.8480675770196239,002512.SZ
|
||||
2024-12-23,1.1806404660060321,600724.SH
|
||||
2024-12-24,0.8537658533885591,603610.SH
|
||||
2024-12-25,0.8752079792242901,002965.SZ
|
||||
2024-12-26,0.720498836899636,603214.SH
|
||||
2024-12-27,0.8552518755027023,002945.SZ
|
||||
2024-12-30,0.7853260336927593,600223.SH
|
||||
2024-12-31,1.0774196590782728,600183.SH
|
||||
2025-01-02,1.345874429894366,603225.SH
|
||||
2025-01-03,1.4595000226870254,603379.SH
|
||||
2025-01-06,1.8567194520891437,002130.SZ
|
||||
2025-01-07,1.327995034218316,002881.SZ
|
||||
2025-01-08,0.7854520495476546,600126.SH
|
||||
2025-01-09,0.8656051617404842,000756.SZ
|
||||
2025-01-10,1.1141535494224937,605016.SH
|
||||
2025-01-13,2.0375745364278695,605080.SH
|
||||
2025-01-14,0.6228152667370752,603269.SH
|
||||
2025-01-15,0.7099046974063614,600673.SH
|
||||
2025-01-16,0.7230959774435842,600381.SH
|
||||
2025-01-17,0.8735560458074921,603007.SH
|
||||
2025-01-20,0.6265446536616674,002164.SZ
|
||||
2025-01-21,1.4687297319348953,000534.SZ
|
||||
2025-01-22,0.7347201431708319,000408.SZ
|
||||
2025-01-23,0.7698608009850573,603121.SH
|
||||
2025-01-24,0.6733337270251429,603360.SH
|
||||
2025-01-27,1.3722279750234074,002484.SZ
|
||||
2025-02-05,1.0995625926629562,603667.SH
|
||||
2025-02-06,0.9540560778289151,603308.SH
|
||||
2025-02-07,0.8152925075270021,000856.SZ
|
||||
2025-02-10,0.4527649047879118,603166.SH
|
||||
|
87
code/train/utils/utils.py
Normal file
87
code/train/utils/utils.py
Normal file
@@ -0,0 +1,87 @@
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
def read_and_merge_h5_data(h5_filename, key, columns, df=None):
|
||||
"""
|
||||
读取 HDF5 文件中的数据,根据指定的 columns 筛选数据,
|
||||
如果传入 df 参数,则将其与读取的数据根据 ts_code 和 trade_date 合并。
|
||||
|
||||
参数:
|
||||
- h5_filename: HDF5 文件名
|
||||
- key: 数据存储在 HDF5 文件中的 key
|
||||
- columns: 要读取的列名列表
|
||||
- df: 需要合并的 DataFrame(如果为空,则不进行合并)
|
||||
|
||||
返回:
|
||||
- 合并后的 DataFrame
|
||||
"""
|
||||
# 处理 _ 开头的列名
|
||||
processed_columns = []
|
||||
for col in columns:
|
||||
if col.startswith('_'):
|
||||
processed_columns.append(col[1:]) # 去掉下划线
|
||||
else:
|
||||
processed_columns.append(col)
|
||||
|
||||
# 从 HDF5 文件读取数据,选择需要的列
|
||||
data = pd.read_hdf(h5_filename, key=key, columns=processed_columns)
|
||||
|
||||
# 修改列名,如果列名以前有 _,加上 _
|
||||
for col in data.columns:
|
||||
if col not in columns: # 只有不在 columns 中的列才需要加下划线
|
||||
new_col = f'_{col}'
|
||||
data.rename(columns={col: new_col}, inplace=True)
|
||||
|
||||
# 如果传入的 df 不为空,则进行合并
|
||||
if df is not None and not df.empty:
|
||||
# 确保两个 DataFrame 都有 ts_code 和 trade_date 列
|
||||
df['trade_date'] = pd.to_datetime(df['trade_date'], format='%Y%m%d')
|
||||
data['trade_date'] = pd.to_datetime(data['trade_date'], format='%Y%m%d')
|
||||
|
||||
# 根据 ts_code 和 trade_date 合并
|
||||
merged_df = pd.merge(df, data, on=['ts_code', 'trade_date'], how='left')
|
||||
else:
|
||||
# 如果 df 为空,则直接返回读取的数据
|
||||
merged_df = data
|
||||
|
||||
return merged_df
|
||||
|
||||
|
||||
def calculate_risk_adjusted_return(df, days=1, method='ratio', lambda_=0.5, eps=1e-8):
|
||||
"""
|
||||
计算单只股票的风险调整收益。
|
||||
|
||||
参数:
|
||||
- df: DataFrame,包含 'ts_code' 和 'close' 列,按日期排序(假设 'trade_date' 已排序)。
|
||||
- days: 预测未来多少天的收益,默认1天。
|
||||
- method: 'ratio'(收益/波动率) 或 'difference'(收益 - λ * 波动率)。
|
||||
- lambda_: 风险惩罚系数,仅当 method='difference' 时有效。
|
||||
- eps: 防止除零的小常数。
|
||||
|
||||
返回:
|
||||
- df:添加 'risk_adj_return' 列的 DataFrame,表示风险调整后的收益。
|
||||
"""
|
||||
# 确保数据按 ts_code 和 trade_date 排序
|
||||
df = df.sort_values(by=['ts_code', 'trade_date'])
|
||||
|
||||
# 计算未来的对数收益率
|
||||
df['future_return'] = np.log(df.groupby('ts_code')['close'].shift(-days) / df['close'])
|
||||
|
||||
# 计算历史收益(对数收益率)
|
||||
df['historical_return'] = np.log(df.groupby('ts_code')['close'].shift(1) / df['close'])
|
||||
|
||||
# 计算波动率(历史收益的标准差)
|
||||
df['volatility'] = df.groupby('ts_code')['historical_return'].rolling(window=days).std().reset_index(level=0,
|
||||
drop=True)
|
||||
|
||||
# 根据选择的 method 计算风险调整收益
|
||||
if method == 'ratio':
|
||||
# 收益/波动率(防止除零)
|
||||
df['risk_adj_return'] = df['future_return'] / (df['volatility'] + eps)
|
||||
elif method == 'difference':
|
||||
# 收益 - λ * 波动率
|
||||
df['risk_adj_return'] = df['future_return'] - lambda_ * df['volatility']
|
||||
else:
|
||||
raise ValueError("Invalid method. Use 'ratio' or 'difference'.")
|
||||
|
||||
return df
|
||||
Reference in New Issue
Block a user