| | |
| | | import os |
| | | |
| | | import constant |
| | | from db.mysql_data_delegate import Mysqldb |
| | | from strategy import strategy_variable |
| | | |
| | | |
| | |
| | | fdatas[data[0]].append(data[2]) |
| | | return fdatas |
| | | |
| | | def export_all_big_order_deal(self, min_money=299e4): |
| | | """ |
| | | 所有大单成交,包含买,卖 |
| | | @return: {"代码":[代码,卖/买, (买单号, 量, 金额, 时间, 最终成交价)]} |
| | | """ |
| | | |
| | | fdatas = {} |
| | | lines = self.__export_logs(f"logs/huaxin_local/l2/transaction_accurate_big_order.{self.day}.log") |
| | | if lines: |
| | | for line in lines: |
| | | line = line[line.find(" - ") + 3:].strip() |
| | | data = eval(line) |
| | | if data[2][2] < min_money: |
| | | continue |
| | | if data[0] not in fdatas: |
| | | fdatas[data[0]] = [] |
| | | fdatas[data[0]].append(data) |
| | | return fdatas |
| | | |
| | | def export_big_sell_order_deal(self, min_money=299e4): |
| | | """ |
| | | 大单成交 |
| | |
| | | line = line[line.find(" - ") + 3:].strip() |
| | | data = eval(line) |
| | | return data |
| | | |
| | | def export_current_limit_up_records(self): |
| | | """ |
| | | 导出当日历史涨停 |
| | | @return: [(代码, 代码名称, 涨停原因, 涨停时间, 高度信息, 自由流通市值,是否炸板)] |
| | | """ |
| | | results = Mysqldb().select_all( |
| | | f"select r.`_code`, r.`_code_name`, r.`_hot_block_name`, r.`_limit_up_time`, r.`_limit_up_high_info`, r.`_zylt_val`, r.`_open` from kpl_limit_up_record r where r._day = '{self.day}'") |
| | | return results |
| | | |
| | | |
| | | class LowSuctionDataManager: |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | fdatas = LowSuctionOriginDataExportManager("2025-04-30").export_code_plates() |
| | | print(fdatas) |
| | | fdatas = LowSuctionOriginDataExportManager("2025-06-09").export_big_order_deal_by() |
| | | fdatas = fdatas.get("000795") |
| | | print(sum([x[2] for x in fdatas])) |
| | | result = eval("1>2") |
| | | print(type(result)) |
| | | print(eval(strategy_variable.大单表达式)) |