| | |
| | | from code_attribute.gpcode_manager import BlackListCodeManager, HumanRemoveForbiddenManager |
| | | from l2.huaxin import huaxin_target_codes_manager |
| | | from l2.l2_transaction_data_manager import HuaXinBuyOrderManager |
| | | from log_module.log import logger_system, logger_debug, logger_kpl_limit_up, logger_request_api |
| | | from log_module.log import logger_system, logger_debug, logger_kpl_limit_up, logger_request_api, \ |
| | | logger_kpl_market_strong, logger_kpl_new_blocks |
| | | from third_data.custom_block_in_money_manager import CodeInMoneyManager |
| | | from third_data.kpl_data_constant import LimitUpCodesBlockRecordManager, LimitUpDataConstant, \ |
| | | ContainsLimitupCodesBlocksManager |
| | |
| | | deals_month = trade_data_manager.AccountMoneyManager().get_deal_count_info(start_date, end_date) |
| | | cost_month = sum([round(0.1 * x[1], 2) for x in delegates_month]) |
| | | make_month = 0 |
| | | make_month += max(1 * deals_month[0][1] if deals_month[0][1] else 0, deals_month[0][2] * 1.854 / 10000 if deals_month[0][2] else 0) + 1 * deals_month[1][ |
| | | 1] + 0 * deals_month[2][1] |
| | | make_month += max(1 * deals_month[0][1] if deals_month[0][1] else 0, |
| | | deals_month[0][2] * 1.854 / 10000 if deals_month[0][2] else 0) + 1 * deals_month[1][ |
| | | 1] + 0 * deals_month[2][1] |
| | | fdata["month_commission"] = round(make_month - cost_month, 2) |
| | | # 计算当日手续费详情 |
| | | delegates = trade_data_manager.AccountMoneyManager().get_delegated_count_info() |
| | |
| | | @return: |
| | | """ |
| | | yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes() |
| | | blocks = set() |
| | | for bi in blocks_info: |
| | | if bi[0] in blocks: |
| | | continue |
| | | blocks.add(bi[0]) |
| | | result = kpl_api.getCodesByPlate(bi[1]) |
| | | result = json.loads(result) |
| | | code_info_list = [] |
| | |
| | | continue |
| | | # 涨幅要大于5% |
| | | rate = d[6] / int(round((tool.get_limit_up_rate(d[0]) - 1) * 10)) |
| | | if rate/((tool.get_limit_up_rate(d[0])-1)*10) < 5: |
| | | if rate / ((tool.get_limit_up_rate(d[0]) - 1) * 10) < 5: |
| | | continue |
| | | # 格式:(代码,涨幅) |
| | | code_info_list.append((d[0], d[6])) |
| | | # 保存新题材 |
| | | datas = [(d[0], d[6]) for d in result["list"]] |
| | | async_log_util.info(logger_kpl_new_blocks, f"{(tool.get_thread_id() ,bi, datas)}") |
| | | if code_info_list: |
| | | # 将代码加入新题材 |
| | | new_block_processor.process_new_block_by_component_codes(bi[0], set([x[0] for x in code_info_list]), all_new_blocks) |
| | | |
| | | new_block_processor.process_new_block_by_component_codes(bi[0], |
| | | set([x[0] for x in code_info_list]), |
| | | all_new_blocks) |
| | | |
| | | try: |
| | | if result_list_: |
| | |
| | | try: |
| | | # 新题材 |
| | | new_block_processor.process_limit_up_list({x[0]: x[5] for x in result_list_}) |
| | | new_block_codes = new_block_processor.screen_new_blocks_with_limit_up_datas([(x[0], x[5]) for x in result_list_]) |
| | | new_block_codes = new_block_processor.screen_new_blocks_with_limit_up_datas( |
| | | [(x[0], x[5]) for x in result_list_]) |
| | | if new_block_codes: |
| | | # 统计板块的代码 |
| | | records = KPLLimitUpDataRecordManager.total_datas |
| | |
| | | RealTimeKplMarketData.set_market_jingxuan_out_blocks(result_list) |
| | | elif type_ == KPLDataType.MARKET_STRONG.value: |
| | | strong = data["data"] |
| | | logger_debug.debug("开盘啦市场强度:{}", strong) |
| | | logger_kpl_market_strong.info(strong) |
| | | # 保存市场热度 |
| | | if strong is not None: |
| | | RealTimeKplMarketData.set_market_strong(strong) |
| | | |
| | | return json.dumps({"code": 0}) |
| | | |
| | | def __send_response(self, data): |