| | |
| | | import inited_data |
| | | import outside_api_command_manager |
| | | from cancel_strategy.s_l_h_cancel_strategy import SCancelBigNumComputer, LCancelRateManager, \ |
| | | CancelRateHumanSettingManager |
| | | CancelRateHumanSettingManager, LCancelBigNumComputer, LDownCancelWatchIndexStatisticManager |
| | | from code_attribute import gpcode_manager, code_volumn_manager, zyltgb_util, code_nature_analyse |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | | from code_attribute.code_l1_data_manager import L1DataManager |
| | |
| | | [huaxin_util.TORA_TSTP_OST_Accepted, huaxin_util.TORA_TSTP_OST_PartTraded]) |
| | | fdatas = [] |
| | | if current_delegates: |
| | | codes_set = set() |
| | | for c in current_delegates: |
| | | try: |
| | | if int(c["direction"]) != huaxin_util.TORA_TSTP_D_Buy: |
| | | continue |
| | | code = c["securityID"] |
| | | if code in codes_set: |
| | | continue |
| | | orderSysID = c.get("orderSysID") |
| | | codes_set.add(code) |
| | | code_name = gpcode_manager.get_code_name(code) |
| | | # 获取下单位置信息 |
| | | order_begin_pos = TradePointManager().get_buy_compute_start_data_cache(code) |
| | |
| | | expire_rate = "未知" |
| | | try: |
| | | referer_volume = code_volumn_manager.CodeVolumeManager().get_radical_buy_refer_volume( |
| | | code, limit_up_price) |
| | | code, float(limit_up_price)) |
| | | today_volumn = code_volumn_manager.CodeVolumeManager().get_today_volumn_cache(code) |
| | | if referer_volume == today_volumn: |
| | | expire_rate = "100%" |
| | |
| | | fdata['mode'] = -1 |
| | | except: |
| | | pass |
| | | |
| | | # L后囊括快照 |
| | | try: |
| | | current_info = LCancelBigNumComputer().statistic_l_down_watch_indexes_info(code) |
| | | last_info = LDownCancelWatchIndexStatisticManager().get_statistic_info(code) |
| | | fdata['l_down_watch_indexes_info'] = {} |
| | | if current_info: |
| | | fdata['l_down_watch_indexes_info']['current'] = current_info |
| | | if last_info: |
| | | fdata['l_down_watch_indexes_info']['last'] = last_info |
| | | except: |
| | | pass |
| | | fdatas.append(fdata) |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | |
| | | # 设置L后撤单比例 |
| | | code = data.get("code") |
| | | rate = data.get("rate") |
| | | if rate < 0 or rate > 1: |
| | | if rate < 0 or rate > 2: |
| | | self.send_response({"code": 1, "msg": "比例范围不在0-1之间"}, |
| | | client_id, |
| | | request_id) |
| | | return |
| | | rate = round(rate, 2) |
| | | old_rate = LCancelRateManager().get_cancel_rate(0)[0] |
| | | # L后数据快照 |
| | | last_info = LCancelBigNumComputer().statistic_l_down_watch_indexes_info(code) |
| | | LDownCancelWatchIndexStatisticManager().set_statistic_info(code, last_info) |
| | | CancelRateHumanSettingManager().set_l_down(code, rate) |
| | | # L后重新囊括 |
| | | if rate < old_rate: |
| | | # 改小才能重新囊括 |
| | | LCancelBigNumComputer().re_compute_l_down_watch_indexes(code) |
| | | self.send_response({"code": 0, "data": {}}, |
| | | client_id, |
| | | request_id) |