L2大单在否函数返回结果中的时间转换为 自然时间
有概念有强度数据加入100亿市值以上无大单不买
| | |
| | | import os |
| | | import constant |
| | | from log_module.log import logger_debug, logger_common |
| | | from utils import huaxin_util |
| | | |
| | | # 获取logger实例 |
| | | logger = logger_common |
| | | |
| | |
| | | # 遍历转换后的列表 |
| | | for sublist in true_lists: |
| | | if sublist and sublist[0] and sublist[0][0] == code: |
| | | logger.info(f"找到L2大单,对应行列表: sublist[0]===={sublist[0]}") |
| | | # print(f"找到大单的对应行列表 sublist[0]===={sublist[0]}") |
| | | # 格式 |
| | | # sublist[0]====['002413', 0, [3996643, 287200, 1421640, 93453070, 4.95]] |
| | | # sublist[0]====['股票代码', 买入, [订单号, 手数, 订单金额, 时间, 成交价]] |
| | | # 时间是华鑫格式要转换一下 |
| | | if sublist[0][2][3] is not None: |
| | | huaxin_time_format = sublist[0][2][3] |
| | | order_transaction_time = huaxin_util.convert_time(huaxin_time_format) |
| | | logger.info(f"找到L2大单,对应行列表: sublist[0]===={sublist[0]} 大单金额:{sublist[0][2][2]}转换后时间格式:{order_transaction_time}") |
| | | |
| | | found = True # 设置标志为 True,表示找到了 |
| | | |
| | | # 检查是否没有找到特定股票代码 |
| | |
| | | free_market_value == 0 or free_market_value == 0.0) and free_market_value < 6: |
| | | logger_info( |
| | | f"【不利】自由市值小于6亿!不买!! 公司名称:{k_line_data[0]['sec_name']},最新价: {current_price}") |
| | | elif ( |
| | | free_market_value == 0 or free_market_value == 0.0) and free_market_value > 100 and L2_found_big_order: |
| | | logger_info( |
| | | f"【不利】自由市值大于100亿,且未发现大单!不买!! 公司名称:{k_line_data[0]['sec_name']},最新价: {current_price}") |
| | | elif len(intersection_plate) > 0: |
| | | logger_info( |
| | | f"【不利】同概念只买一次,不买了,公司名称:{k_line_data[0]['sec_name']},重复相交概念==={intersection_plate}") |
| | |
| | | finally: |
| | | __order_ref_lock.release() |
| | | |
| | | |
| | | # 华鑫时间字符串格式转换函数 |
| | | def convert_time(time_str, with_ms=False): |
| | | time_str = str(time_str) |
| | | if time_str.startswith("9"): |