| | |
| | | for code in sell_order_map: |
| | | cls.__total_sell_datas_dict[code] = sell_order_map[code] |
| | | |
| | | |
| | | def add_buy_datas(self, code, datas): |
| | | """ |
| | | 添加大买单数据 |
| | | @param code: 代码 |
| | | @param datas:[(买单号,总股数,总成交额)] |
| | | @param datas:[(买单号,总股数,总成交额,成交开始时间,成交结束时间)] |
| | | @return: |
| | | """ |
| | | if not datas: |
| | |
| | | if code not in self.__total_buy_datas_dict: |
| | | return [] |
| | | return [x[2] for x in self.__total_buy_datas_dict[code]] |
| | | |
| | | def get_total_buy_data_list(self, code): |
| | | """ |
| | | 获取所有的买单数据列表 |
| | | @param code: |
| | | @return:[(买单号,总股数,总成交额,成交开始时间,成交结束时间)] |
| | | """ |
| | | return self.__total_buy_datas_dict.get(code) |
| | | |
| | | def get_total_sell_money(self, code): |
| | | """ |
| | |
| | | |
| | | # 统计所有的成交量 |
| | | __deal_volume_list_dict = {} |
| | | # 统计主动买的成交量 |
| | | # 统计涨停主动买的成交量 |
| | | __deal_active_buy_volume_list_dict = {} |
| | | |
| | | @classmethod |
| | | def statistic_total_deal_volume(cls, code, datas): |
| | | def statistic_total_deal_volume(cls, code, datas, limit_up_price): |
| | | # 只统计被动买 |
| | | if code not in cls.__deal_volume_list_dict: |
| | | cls.__deal_volume_list_dict[code] = [] |
| | |
| | | for d in datas: |
| | | # 只统计主动买 |
| | | if d[7] > d[6]: |
| | | continue |
| | | # 只统计涨停买 |
| | | if d[1] != limit_up_price: |
| | | continue |
| | | if d[3] in time_dict: |
| | | time_str = time_dict[d[3]] |
| | |
| | | total_sell_info[1] = big_sell_orders |
| | | # ----------------统计涨停主动买----------------- |
| | | try: |
| | | limit_up_active_buy_datas = [] |
| | | for d in datas: |
| | | if is_active_sell(d[7], d[6]): |
| | | # 被动买 |
| | |
| | | # 是否是涨停 |
| | | if d[1] == limit_up_price: |
| | | # 有涨停主动买 |
| | | L2TradeSingleDataManager.set_limit_up_active_buy(code, datas[-1][3]) |
| | | break |
| | | limit_up_active_buy_datas.append(d) |
| | | L2TradeSingleDataManager.set_limit_up_active_buy(code, limit_up_active_buy_datas) |
| | | except: |
| | | pass |
| | | |