mns-scheduler 1.1.8.4__py3-none-any.whl → 1.4.5.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. mns_scheduler/__init__.py +1 -3
  2. mns_scheduler/auto_da_ban/auto_da_ban_service.py +89 -0
  3. mns_scheduler/company_info/clean/__init__.py +1 -1
  4. mns_scheduler/company_info/clean/company_info_clean_api.py +62 -21
  5. mns_scheduler/company_info/common/company_common_query_service.py +45 -0
  6. mns_scheduler/company_info/constant/__init__.py +1 -1
  7. mns_scheduler/company_info/constant/company_constant_data.py +335 -224
  8. mns_scheduler/company_info/de_list_stock/__init__.py +1 -1
  9. mns_scheduler/company_info/de_list_stock/de_list_stock_service.py +1 -1
  10. mns_scheduler/company_info/em_stock_info/sync_em_stock_info_sync.py +134 -0
  11. mns_scheduler/company_info/sync/company_info_set_service.py +208 -0
  12. mns_scheduler/company_info/sync/sync_company_info_task.py +203 -0
  13. mns_scheduler/company_info/task/company_announce_info_task.py +77 -0
  14. mns_scheduler/company_info/task/company_base_info_task.py +64 -0
  15. mns_scheduler/company_info/task/company_business_info_task.py +177 -0
  16. mns_scheduler/company_info/task/company_hold_info_task.py +66 -0
  17. mns_scheduler/company_info/task/company_industry_info_task.py +167 -0
  18. mns_scheduler/company_info/task/company_total_task.py +69 -0
  19. mns_scheduler/concept/clean/kpl_concept_clean_api.py +1 -1
  20. mns_scheduler/concept/clean/ths_concept_clean_api.py +20 -4
  21. mns_scheduler/concept/ths/common/ths_concept_sync_common_api.py +23 -18
  22. mns_scheduler/concept/ths/common/ths_concept_update_common_api.py +4 -1
  23. mns_scheduler/concept/ths/detaill/ths_concept_detail_api.py +7 -7
  24. mns_scheduler/concept/ths/sync_new_index/sync_ths_concept_new_index_api.py +9 -4
  25. mns_scheduler/concept/ths/update_concept_info/sync_one_symbol_all_concepts_api.py +2 -2
  26. mns_scheduler/db/col_move_service.py +3 -3
  27. mns_scheduler/db/script/__init__.py +1 -1
  28. mns_scheduler/db/script/col_move_script.py +1 -1
  29. mns_scheduler/db/script/db_move/__init__.py +7 -0
  30. mns_scheduler/db/script/db_move/col_move_one_service.py +34 -0
  31. mns_scheduler/db/script/sync/__init__.py +1 -1
  32. mns_scheduler/db/script/sync/remote_data_sync_to_local.py +65 -4
  33. mns_scheduler/db/script/sync/sync_hui_ce_test_data.py +80 -0
  34. mns_scheduler/db/script/sync/sync_hui_ce_test_data_01.py +69 -0
  35. mns_scheduler/db/script/update/__init__.py +7 -0
  36. mns_scheduler/db/script/update/update_col_field.py +36 -0
  37. mns_scheduler/finance/__init__.py +1 -1
  38. mns_scheduler/finance/em/__init__.py +7 -0
  39. mns_scheduler/finance/{em_financial_asset_liability_sync_service_api.py → em/em_financial_asset_liability_sync_service_api.py} +2 -2
  40. mns_scheduler/finance/{em_financial_profit_sync_service_api.py → em/em_financial_profit_sync_service_api.py} +27 -26
  41. mns_scheduler/finance/{finance_common_api.py → em/finance_common_api.py} +3 -3
  42. mns_scheduler/finance/{sync_financial_report_service_api.py → sync_financial_report_service_task.py} +80 -27
  43. mns_scheduler/finance/xue_qiu/__init__.py +7 -0
  44. mns_scheduler/finance/xue_qiu/down_load_xueqiu_report_api.py +77 -0
  45. mns_scheduler/finance/xue_qiu/sync_xue_qiu_fiance_data.py +161 -0
  46. mns_scheduler/hk/__init__.py +1 -1
  47. mns_scheduler/hk/hk_company_info_sync_service_api.py +4 -4
  48. mns_scheduler/hk/hk_industry_info_sync_service_api.py +3 -5
  49. mns_scheduler/industry/__init__.py +7 -0
  50. mns_scheduler/industry/ths/__init__.py +7 -0
  51. mns_scheduler/industry/ths/ths_industry_index_service.py +58 -0
  52. mns_scheduler/industry/ths/ths_industry_sync_service.py +68 -0
  53. mns_scheduler/irm/__init__.py +1 -1
  54. mns_scheduler/irm/api/__init__.py +1 -1
  55. mns_scheduler/irm/api/sh_stock_sns_sse_info_api.py +8 -58
  56. mns_scheduler/irm/api/sz_stock_sns_sse_info_api.py +15 -26
  57. mns_scheduler/irm/stock_irm_cninfo_service.py +43 -31
  58. mns_scheduler/irm/stock_question_id_service.py +169 -0
  59. mns_scheduler/k_line/clean/daily/__init__.py +1 -1
  60. mns_scheduler/k_line/clean/daily/daily_k_line_clean_common_service.py +52 -6
  61. mns_scheduler/k_line/clean/daily/daily_k_line_service.py +7 -2
  62. mns_scheduler/k_line/clean/k_line_info_clean_impl.py +3 -2
  63. mns_scheduler/k_line/clean/k_line_info_clean_task.py +42 -15
  64. mns_scheduler/k_line/clean/week_month/__init__.py +1 -1
  65. mns_scheduler/k_line/clean/week_month/normal_week_month_k_line_service.py +124 -26
  66. mns_scheduler/k_line/clean/week_month/sub_new_week_month_k_line_service.py +2 -2
  67. mns_scheduler/k_line/common/__init__.py +7 -0
  68. mns_scheduler/k_line/common/k_line_common_api.py +188 -0
  69. mns_scheduler/k_line/hot_stocks/__init__.py +1 -1
  70. mns_scheduler/k_line/hot_stocks/recent_hot_stocks_clean_service.py +1 -1
  71. mns_scheduler/k_line/{sync → month_week_daily}/bfq_k_line_sync.py +14 -29
  72. mns_scheduler/k_line/{sync → month_week_daily}/daily_week_month_line_sync.py +11 -12
  73. mns_scheduler/k_line/sync_status/__init__.py +7 -0
  74. mns_scheduler/k_line/sync_status/k_line_sync_status_check.py +54 -0
  75. mns_scheduler/k_line/test/__init__.py +1 -1
  76. mns_scheduler/k_line/test/k_line_info_clean_his_data.py +14 -3
  77. mns_scheduler/k_line/year_quarter/__init__.py +7 -0
  78. mns_scheduler/k_line/year_quarter/year_quarter_line_sync.py +76 -0
  79. mns_scheduler/kpl/selection/symbol/sync_best_choose_symbol.py +1 -2
  80. mns_scheduler/kpl/selection/symbol/sync_kpl_concept_symbol_choose_reason_api.py +108 -0
  81. mns_scheduler/kpl/selection/total/sync_kpl_best_total_sync_api.py +5 -0
  82. mns_scheduler/lhb/__init__.py +1 -1
  83. mns_scheduler/lhb/stock_lhb_sync_service.py +1 -1
  84. mns_scheduler/open/__init__.py +1 -1
  85. mns_scheduler/open/sync_one_day_open_data_to_db_service.py +2 -3
  86. mns_scheduler/risk/__init__.py +1 -1
  87. mns_scheduler/risk/compliance/undisclosed_annual_report_api.py +8 -2
  88. mns_scheduler/risk/financial/annual_report_audit_check_api.py +13 -3
  89. mns_scheduler/risk/financial/net_assets_check_api.py +21 -18
  90. mns_scheduler/risk/financial/profit_income_check_api.py +7 -2
  91. mns_scheduler/risk/financial_report_risk_check_api.py +1 -1
  92. mns_scheduler/risk/major_violations/register_and_investigate_stock_sync_api.py +1 -1
  93. mns_scheduler/risk/self/wei_pan_stock_api.py +1 -1
  94. mns_scheduler/risk/test/__init__.py +1 -1
  95. mns_scheduler/risk/test/fix_blask_list.py +4 -6
  96. mns_scheduler/risk/transactions/transactions_check_api.py +22 -4
  97. mns_scheduler/self_choose/__init__.py +1 -1
  98. mns_scheduler/self_choose/ths_self_choose_service.py +99 -43
  99. mns_scheduler/trade/auto_login/trader_auto_service.py +7 -4
  100. mns_scheduler/trade/auto_sell_service_api.py +4 -4
  101. mns_scheduler/trade/balance/__init__.py +7 -0
  102. mns_scheduler/trade/balance/ths_account_balance_service.py +7 -0
  103. mns_scheduler/trade/sync_position_api.py +39 -6
  104. mns_scheduler/trade/task/trader_task_service.py +38 -10
  105. mns_scheduler/trade/tfp/__init__.py +7 -0
  106. mns_scheduler/trade/tfp/stock_tfp_info_sync.py +56 -0
  107. mns_scheduler/zb/stock_zb_pool_sync.py +1 -16
  108. mns_scheduler/zt/high_chg/sync_high_chg_pool_service.py +2 -2
  109. mns_scheduler/zt/high_chg/sync_high_chg_real_time_quotes_service.py +1 -1
  110. mns_scheduler/zt/script/__init__.py +1 -1
  111. mns_scheduler/zt/script/fix_error_deal_day.py +41 -0
  112. mns_scheduler/zt/script/kcx_high_chg_open_his_data_handle.py +2 -2
  113. mns_scheduler/zt/script/sync_high_chg_pool_his_data.py +2 -2
  114. mns_scheduler/zt/script/sync_now_higt_chg_zt.py +8 -7
  115. mns_scheduler/zt/zt_pool/em_zt_pool_sync_api.py +260 -83
  116. mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py +33 -90
  117. mns_scheduler/zt/zt_pool/update_null_zt_reason_api.py +27 -13
  118. mns_scheduler/zz_task/compensation/__init__.py +0 -0
  119. mns_scheduler/zz_task/compensation/compensate_task.py +161 -0
  120. mns_scheduler/zz_task/compensation/compensate_task_one_day.py +142 -0
  121. mns_scheduler/zz_task/data_sync_task.py +197 -103
  122. {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.5.7.dist-info}/METADATA +1 -1
  123. mns_scheduler-1.4.5.7.dist-info/RECORD +176 -0
  124. {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.5.7.dist-info}/WHEEL +1 -1
  125. mns_scheduler/2014-2015-test/2014_2015_chg_statistics.py +0 -87
  126. mns_scheduler/big_deal/ths_big_deal_sync.py +0 -98
  127. mns_scheduler/company_info/base/sync_company_base_info_api.py +0 -439
  128. mns_scheduler/company_info/base/sync_company_hold_info_api.py +0 -40
  129. mns_scheduler/company_info/remark/company_remark_info_sync.py +0 -46
  130. mns_scheduler/db/real_time_task_check.py +0 -84
  131. mns_scheduler/debt/kzz_bond_info_sync.py +0 -33
  132. mns_scheduler-1.1.8.4.dist-info/RECORD +0 -142
  133. /mns_scheduler/{2014-2015-test → auto_da_ban}/__init__.py +0 -0
  134. /mns_scheduler/company_info/{base → common}/__init__.py +0 -0
  135. /mns_scheduler/{big_deal → company_info/em_stock_info}/__init__.py +0 -0
  136. /mns_scheduler/company_info/{remark → sync}/__init__.py +0 -0
  137. /mns_scheduler/{debt → company_info/task}/__init__.py +0 -0
  138. /mns_scheduler/k_line/{sync → month_week_daily}/__init__.py +0 -0
  139. {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.5.7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,7 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 17
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
@@ -2,23 +2,23 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
8
8
  import mns_common.component.deal.deal_service_api as deal_service_api
9
9
  import pandas as pd
10
10
  import mns_common.utils.data_frame_util as data_frame_util
11
11
  import mns_common.constant.db_name_constant as db_name_constant
12
- import datetime
13
-
12
+ from datetime import datetime
13
+ from mns_common.component.deal.terminal_enum import TerminalEnum
14
14
  from mns_common.db.MongodbUtil import MongodbUtil
15
15
 
16
16
  mongodb_util = MongodbUtil('27017')
17
17
 
18
18
 
19
19
  # 同步持仓
20
- def sync_position():
21
- now_date = datetime.datetime.now()
20
+ def sync_position_ths():
21
+ now_date = datetime.now()
22
22
  str_day = now_date.strftime('%Y-%m-%d')
23
23
  query_exist = {'str_day': str_day}
24
24
  if mongodb_util.exist_data_query(db_name_constant.POSITION_STOCK, query_exist):
@@ -52,5 +52,38 @@ def sync_position():
52
52
  mongodb_util.save_mongo(position_df, db_name_constant.POSITION_STOCK)
53
53
 
54
54
 
55
+ def sync_position_qmt():
56
+ now_date = datetime.now()
57
+ str_day = now_date.strftime('%Y-%m-%d')
58
+ query_exist = {'str_day': str_day}
59
+ # if mongodb_util.exist_data_query(db_name_constant.POSITION_STOCK, query_exist):
60
+ # return None
61
+ position_list = deal_service_api.get_position(TerminalEnum.QMT.terminal_code)
62
+ if len(position_list) == 0:
63
+ return None
64
+ position_df = pd.DataFrame(position_list)
65
+ position_df = position_df.rename(columns={
66
+ "stock_code": "symbol",
67
+ "avg_price": "cost_price",
68
+ "profit_loss": "floating_profit_loss",
69
+ "market_value": "flow_mv",
70
+ "can_use_volume": "available_position",
71
+ "frozen_volume": "frozen_position",
72
+ })
73
+
74
+ position_df['cost_price'] = round(position_df['cost_price'], 2)
75
+ position_df['open_price'] = round(position_df['open_price'], 2)
76
+
77
+ position_df['open_position'] = position_df['available_position'] + position_df['frozen_position'] + position_df[
78
+ 'on_road_volume']
79
+
80
+ position_df['symbol'] = position_df['symbol'].str.slice(0, 6)
81
+
82
+ position_df["_id"] = position_df['symbol'] + '-' + str_day
83
+ position_df["str_day"] = str_day
84
+ position_df["valid"] = True
85
+ mongodb_util.save_mongo(position_df, db_name_constant.POSITION_STOCK)
86
+
87
+
55
88
  if __name__ == '__main__':
56
- sync_position()
89
+ sync_position_qmt()
@@ -2,7 +2,7 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
8
8
  import mns_common.utils.cmd_util as cmd_util
@@ -11,26 +11,53 @@ import mns_scheduler.trade.auto_login.trader_auto_service as trader_auto_service
11
11
  import mns_common.utils.data_frame_util as data_frame_util
12
12
  from loguru import logger
13
13
 
14
- # 交易任务
15
- TRADER_SERVER_PATH = 'H:\\mns-trader.bat'
14
+ # 交易服务端
15
+ TRADER_SERVER_PATH = 'H:\\mns_trader_server.bat'
16
16
  # 实时行情同步任务 python名称
17
- TRADER_SERVER_NAME = "mns_trader"
17
+ TRADER_SERVER_NAME = "mns_trader_server"
18
+
19
+
20
+ # 打开qmt
21
+ def open_qmt_terminal():
22
+ logger.info('打开 [交易web服务端]')
23
+ if bool(1 - is_open_trader_server()):
24
+ cmd_util.open_bat_file(TRADER_SERVER_PATH)
25
+ else:
26
+ logger.info('交易服务端已经运行')
27
+ logger.info('自动登陆qmt')
28
+ trader_auto_service.qmt_auto_login()
18
29
 
19
30
 
20
31
  # 打开交易客户端
21
32
  def open_trader_terminal():
22
- # 打开任务进程
23
- cmd_util.open_bat_file(TRADER_SERVER_PATH)
24
- # 自动登陆
33
+ # 打开 [交易web服务端]
34
+ logger.info('打开 [交易web服务端]')
35
+ if bool(1 - is_open_trader_server()):
36
+ cmd_util.open_bat_file(TRADER_SERVER_PATH)
37
+ time.sleep(10)
38
+ logger.info('自动登陆ths和qmt')
39
+ # 自动登陆ths和qmt
25
40
  trader_auto_service.auto_login()
26
41
  time.sleep(5)
27
- # 需先打开同花顺终端在开始交易服务
42
+ # 杀死[交易web服务端],使用同花顺需要先打开xiadan.exe,在重新打开[交易web服务端]
43
+ logger.info('杀死[交易web服务端]')
28
44
  kill_server()
29
45
  time.sleep(5)
30
- # 打开任务进程
46
+ logger.info('重新打开 [交易web服务端]')
47
+ # 重新打开 [交易web服务端]
31
48
  cmd_util.open_bat_file(TRADER_SERVER_PATH)
32
49
 
33
50
 
51
+ def is_open_trader_server():
52
+ all_cmd_processes = cmd_util.get_all_process()
53
+ all_cmd_processes_trader = all_cmd_processes.loc[
54
+ (all_cmd_processes['total_info'].str.contains(TRADER_SERVER_NAME, case=False, na=False))]
55
+ if data_frame_util.is_not_empty(all_cmd_processes_trader):
56
+ return True
57
+ else:
58
+ return False
59
+
60
+
34
61
  def kill_server():
35
62
  all_cmd_processes = cmd_util.get_all_process()
36
63
  all_cmd_processes_trader = all_cmd_processes.loc[
@@ -45,4 +72,5 @@ def kill_server():
45
72
 
46
73
 
47
74
  if __name__ == '__main__':
48
- open_trader_terminal()
75
+ # kill_server()
76
+ open_qmt_terminal()
@@ -0,0 +1,7 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 17
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
@@ -0,0 +1,56 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 17
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
8
+
9
+ import mns_common.component.tfp.stock_tfp_api as stock_tfp_api
10
+ import mns_common.constant.db_name_constant as db_name_constant
11
+ import mns_common.utils.data_frame_util as data_frame_util
12
+ from mns_common.db.MongodbUtil import MongodbUtil
13
+ import mns_common.component.common_service_fun_api as common_service_fun_api
14
+
15
+ mongodb_util = MongodbUtil('27017')
16
+
17
+
18
+ def sync_stock_tfp(str_day):
19
+ stock_tfp_df = stock_tfp_api.get_stock_tfp_by_day(str_day)
20
+ if data_frame_util.is_not_empty(stock_tfp_df):
21
+ stock_tfp_df['sus_begin_time'] = stock_tfp_df['sus_begin_time'].fillna('无')
22
+ stock_tfp_df['sus_end_time'] = stock_tfp_df['sus_end_time'].fillna('无')
23
+ stock_tfp_df['resume_time'] = stock_tfp_df['resume_time'].fillna('无')
24
+ stock_tfp_df['_id'] = stock_tfp_df['symbol'] + "_" + str_day
25
+ # 排除name列中值包含'B'的行
26
+ stock_tfp_df = stock_tfp_df[~stock_tfp_df['name'].str.contains('B', na=False)]
27
+
28
+ stock_tfp_df['sus_begin_time'] = stock_tfp_df['sus_begin_time'].astype(str)
29
+ stock_tfp_df['sus_end_time'] = stock_tfp_df['sus_end_time'].astype(str)
30
+ stock_tfp_df['resume_time'] = stock_tfp_df['resume_time'].astype(str)
31
+ stock_tfp_df['sus_begin_date'] = stock_tfp_df['sus_begin_date'].astype(str)
32
+ stock_tfp_df = common_service_fun_api.exclude_st_symbol(stock_tfp_df)
33
+ # 根据条件设置新列'type'的值
34
+
35
+ # 初始化类型值
36
+ stock_tfp_df['type'] = '0'
37
+ stock_tfp_df.loc[stock_tfp_df['sus_reason'] == '盘中停牌', 'type'] = '0'
38
+ stock_tfp_df.loc[stock_tfp_df['sus_reason'] == '停牌一天', 'type'] = '1'
39
+ stock_tfp_df.loc[stock_tfp_df['sus_reason'] == '连续停牌', 'type'] = '2'
40
+ stock_tfp_df.loc[stock_tfp_df['sus_reason'] == '刊登重要公告', 'type'] = '3'
41
+ stock_tfp_df.loc[stock_tfp_df['sus_reason'] == '拟筹划重大资产重组', 'type'] = '4'
42
+ stock_tfp_df['valid'] = True
43
+ stock_tfp_df['str_day'] = str_day
44
+ stock_tfp_df.loc[stock_tfp_df['type'] == '2', 'valid'] = False
45
+ stock_tfp_df.loc[stock_tfp_df['type'] == '1', 'valid'] = False
46
+
47
+ stock_tfp_df = stock_tfp_df.fillna(0)
48
+
49
+ mongodb_util.save_mongo(stock_tfp_df, db_name_constant.STOCK_TFP_INFO)
50
+
51
+ return stock_tfp_df
52
+
53
+
54
+ if __name__ == '__main__':
55
+ df = sync_stock_tfp('2025-12-25')
56
+ print(df)
@@ -27,19 +27,4 @@ def sync_stock_zb_pool(str_now_day):
27
27
 
28
28
 
29
29
  if __name__ == '__main__':
30
- sync_stock_zb_pool('2024-09-05')
31
- sync_date = date_handle_util.add_date_day('20231214', 1)
32
-
33
- now_date = datetime.now()
34
-
35
- str_now_day_01 = sync_date.strftime('%Y-%m-%d')
36
-
37
- while now_date > sync_date:
38
- stock_zb_pool_df = sync_stock_zb_pool(str_now_day_01)
39
- if stock_zb_pool_df is None:
40
- sync_date = date_handle_util.add_date_day(date_handle_util.no_slash_date(str_now_day_01), 1)
41
- str_now_day_01 = sync_date.strftime('%Y-%m-%d')
42
- continue
43
- mongodb_util.save_mongo(stock_zb_pool_df, 'stock_zb_pool')
44
- sync_date = date_handle_util.add_date_day(date_handle_util.no_slash_date(str_now_day_01), 1)
45
- str_now_day_01 = sync_date.strftime('%Y-%m-%d')
30
+ sync_stock_zb_pool('2025-12-11')
@@ -9,7 +9,7 @@ import pandas as pd
9
9
  from loguru import logger
10
10
  import mns_common.component.common_service_fun_api as common_service_fun_api
11
11
  import mns_common.component.trade_date.trade_date_common_service_api as trade_date_common_service_api
12
- import mns_common.api.em.east_money_stock_api as east_money_stock_api
12
+ import mns_common.component.em.em_stock_info_api as em_stock_info_api
13
13
  import mns_common.utils.date_handle_util as date_handle_util
14
14
  import mns_common.component.company.company_common_service_api as company_common_service_api
15
15
  from mns_common.db.MongodbUtil import MongodbUtil
@@ -138,7 +138,7 @@ def sync_stock_high_chg_pool_list(str_day, symbol_list):
138
138
  now_date = datetime.now()
139
139
  now_day = now_date.strftime('%Y-%m-%d')
140
140
 
141
- real_time_quotes_now_init = east_money_stock_api.get_real_time_quotes_all_stocks()
141
+ real_time_quotes_now_init = em_stock_info_api.get_a_stock_info()
142
142
 
143
143
  last_trade_zt_pool = zt_common_service_api.get_last_trade_day_zt(str_day)
144
144
 
@@ -142,4 +142,4 @@ def save_realtime_quotes_now_zt_data(realtime_quotes_now_zt, str_day, symbol):
142
142
 
143
143
 
144
144
  if __name__ == '__main__':
145
- sync_high_chg_real_time_quotes('2024-06-24')
145
+ sync_high_chg_real_time_quotes('2024-12-26')
@@ -2,6 +2,6 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
@@ -0,0 +1,41 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 17
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
8
+ from mns_common.db.MongodbUtil import MongodbUtil
9
+ from loguru import logger
10
+ import mns_common.utils.date_handle_util as date_handle_util
11
+ mongodb_util = MongodbUtil('27017')
12
+
13
+ from mns_scheduler.db.script.sync.remote_mongo_util import RemoteMongodbUtil
14
+
15
+
16
+ remote_mongodb_util = RemoteMongodbUtil('27017')
17
+
18
+
19
+ def fix_error_deal_days(db_name):
20
+ realtime_quotes_now_zt_new_kc_open_df = mongodb_util.find_query_data(db_name, {})
21
+ realtime_quotes_now_zt_new_kc_open_df['id_key'] = realtime_quotes_now_zt_new_kc_open_df['_id']
22
+ for stock_one in realtime_quotes_now_zt_new_kc_open_df.itertuples():
23
+ try:
24
+ symbol = stock_one.symbol
25
+ str_day = stock_one.str_day
26
+ query = {'symbol': symbol, 'date': {"$lt": date_handle_util.no_slash_date(str_day)}}
27
+ deal_days = mongodb_util.count(query, 'stock_qfq_daily')
28
+ new_values = {"$set": {"deal_days": deal_days}}
29
+ id_key = stock_one.id_key
30
+ update_query = {'_id': id_key}
31
+ mongodb_util.update_many(update_query, new_values, db_name)
32
+ logger.info("更新到:{},{}", symbol, str_day)
33
+ except BaseException as e:
34
+ logger.error("出现异常:{},{},{}", symbol, str_day, e)
35
+
36
+
37
+ if __name__ == '__main__':
38
+ # db_name_0 = 'realtime_quotes_now_zt_new_kc_open'
39
+ db_name_01 = 'stock_high_chg_pool'
40
+ # fix_error_deal_days(db_name_0)
41
+ fix_error_deal_days(db_name_01)
@@ -2,7 +2,7 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
8
8
  import mns_scheduler.zt.open_data.kcx_high_chg_open_data_sync as kcx_high_chg_open_data_sync
@@ -83,7 +83,7 @@ def fix_miss_data(str_end):
83
83
 
84
84
 
85
85
  if __name__ == '__main__':
86
- kcx_high_chg_open_data_sync.sync_all_kc_zt_data('2024-06-25', None)
86
+ kcx_high_chg_open_data_sync.sync_all_kc_zt_data('2025-06-30', None)
87
87
  # sync_all_kc_zt_data('2023-08-16')
88
88
  # sync_all_kc_zt_data('2023-07-07')
89
89
  # realtime_quotes_now_zt_new_kc_open_sync()
@@ -2,7 +2,7 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
8
8
  import mns_common.utils.date_handle_util as date_handle_util
@@ -36,4 +36,4 @@ def sync_his_zt_pool_data(begin_day, end_day):
36
36
 
37
37
 
38
38
  if __name__ == '__main__':
39
- sync_high_chg_pool_service.sync_stock_high_chg_pool_list('2024-07-22', None)
39
+ sync_high_chg_pool_service.sync_stock_high_chg_pool_list('2025-05-23', None)
@@ -2,12 +2,12 @@ import sys
2
2
  import os
3
3
 
4
4
  file_path = os.path.abspath(__file__)
5
- end = file_path.index('mns') + 16
5
+ end = file_path.index('mns') + 17
6
6
  project_path = file_path[0:end]
7
7
  sys.path.append(project_path)
8
- import mns_common.api.em.east_money_stock_api as east_money_stock_api
8
+ import mns_common.component.em.em_stock_info_api as em_stock_info_api
9
9
  import mns_common.component.common_service_fun_api as common_service_fun_api
10
- import mns_scheduler.k_line.sync.daily_week_month_line_sync as daily_week_month_line_sync
10
+ import mns_scheduler.k_line.month_week_daily.daily_week_month_line_sync as daily_week_month_line_sync
11
11
  from datetime import datetime
12
12
  import mns_scheduler.zt.zt_pool.em_zt_pool_sync_api as em_zt_pool_sync_api
13
13
  import mns_scheduler.zt.high_chg.sync_high_chg_pool_service as sync_high_chg_pool_service
@@ -16,16 +16,17 @@ import mns_scheduler.zt.high_chg.sync_high_chg_real_time_quotes_service as sync_
16
16
 
17
17
 
18
18
  def sync_now_day_high_chg():
19
- real_time_quotes_now_es = east_money_stock_api.get_real_time_quotes_all_stocks()
19
+ real_time_quotes_now_es = em_stock_info_api.get_a_stock_info()
20
20
  real_time_quotes_now_es_high_chg = real_time_quotes_now_es.loc[
21
21
  real_time_quotes_now_es['chg'] > common_service_fun_api.ZT_CHG]
22
+ now_date = datetime.now()
23
+
24
+ str_now_day = now_date.strftime('%Y-%m-%d')
22
25
  # 同步qfq k线
23
- daily_week_month_line_sync.sync_all_daily_data('daily', 'qfq', 'stock_qfq_daily', None,
26
+ daily_week_month_line_sync.sync_all_daily_data('daily', 'qfq', 'stock_qfq_daily', str_now_day,
24
27
  list(real_time_quotes_now_es_high_chg['symbol']))
25
28
 
26
- now_date = datetime.now()
27
29
 
28
- str_now_day = now_date.strftime('%Y-%m-%d')
29
30
  # 同步当前涨停
30
31
  em_zt_pool_sync_api.save_zt_info(str_now_day)
31
32