| | |
| | | print(f"处理第{index}批次") |
| | | df["TradePrice"] = df["TradePrice"].apply(str_to_float) |
| | | df["SecurityID"] = df["SecurityID"].apply(code_format) |
| | | df = df[df["SecurityID"].str.startswith(("30", "00", "60"), na=False)] |
| | | # 计算成交金额 |
| | | df['TradeAmount'] = df['TradePrice'] * df['TradeVolume'] |
| | | |
| | | |
| | | # 按SecurityID和BuyNo分组 |
| | | grouped = df.groupby(['SecurityID', 'BuyNo']) |
| | |
| | | df = df[df["TickType"] == 'T'] |
| | | df["Price"] = df["Price"].apply(str_to_float) |
| | | df["SecurityID"] = df["SecurityID"].apply(code_format) |
| | | |
| | | df = df[df["SecurityID"].str.startswith(("30", "00", "60"), na=False)] |
| | | |
| | | # 计算成交金额 |
| | | df['TradeMoney'] = df["TradeMoney"].apply(str_to_float) |
| | | # 按SecurityID和BuyNo分组 |
| | |
| | | elif _type == 'Transaction_New': |
| | | pre_process_transactions(f"/home/userzjj/ftp/{day}/Transaction.csv") |
| | | elif _type == 'NGTSTick_New': |
| | | pre_process_transactions(f"/home/userzjj/ftp/{day}/NGTSTick.csv") |
| | | pre_process_ngtstick(f"/home/userzjj/ftp/{day}/NGTSTick.csv") |
| | | elif _type == 'ExtractDealBigOrder': |
| | | # 提取所有成交的大单 |
| | | if len(params) > 2: |