| | |
| | | fresult = {"code": 0} |
| | | if code_list_type == outside_api_command_manager.CODE_LIST_WANT: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | | trade_record_log_util.add_want_buy(code) |
| | | gpcode_manager.WantBuyCodesManager().add_code(code) |
| | | if l2_trade_util.is_in_forbidden_trade_codes(code): |
| | | l2_trade_util.remove_from_forbidden_trade_codes(code) |
| | |
| | | if results: |
| | | gpcode_manager.CodesNameManager.add_first_code_name(code, results[code]) |
| | | elif operate == outside_api_command_manager.OPERRATE_DELETE: |
| | | trade_record_log_util.remove_want_buy(code) |
| | | gpcode_manager.WantBuyCodesManager().remove_code(code) |
| | | elif operate == outside_api_command_manager.OPERRATE_GET: |
| | | codes = gpcode_manager.WantBuyCodesManager().list_code_cache() |
| | |
| | | @param fdatas: |
| | | @return: (成交数据, 卖单数据) |
| | | """ |
| | | |
| | | def compute_last_sell(): |
| | | # 最大买单号 |
| | | max_buy_order_no = fdatas[-1][0][6] |
| | | for i in range(len(sell_list) - 1, -1, -1): |
| | | if sell_list[i]['val']['orderNo'] > max_buy_order_no: |
| | | continue |
| | | return sell_list[i] |
| | | return None |
| | | |
| | | if not fdatas[-1][2]: |
| | | # 最后一条数据不是涨停成交数据 |
| | | return None |
| | | |
| | | sell_list = cls.__latest_limit_up_sell_list_dict.get(code) |
| | | if not sell_list: |
| | | return None |
| | | last_sell_info = sell_list[-1] |
| | | last_sell_info = compute_last_sell() |
| | | if not last_sell_info: |
| | | return None |
| | | for data in fdatas: |
| | | if not data[2]: |
| | | # 排除主动卖/非涨停卖 |
| | |
| | | records = LimitUpDataConstant.history_limit_up_datas |
| | | if not currents: |
| | | currents = self.__kplDataManager.get_data(KPLDataType.LIMIT_UP) |
| | | if currents is None: |
| | | currents = [] |
| | | # 获取历史涨停 |
| | | if not records: |
| | | KPLLimitUpDataRecordManager.load_total_datas() |
| | |
| | | __add_log(TYPE_ACTION, code, {"type": "加白", "msg": msg}) |
| | | |
| | | |
| | | # 加想 |
| | | def add_want_buy(code, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": "加想", "msg": msg}) |
| | | |
| | | |
| | | # 移想 |
| | | def remove_want_buy(code, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": "移想", "msg": msg}) |
| | | |
| | | |
| | | # 加白 |
| | | def add_common_msg(code, type_, msg=""): |
| | | def add_common_msg(code, type_, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": type_, "msg": msg}) |
| | | |
| | | |