| | |
| | | TYPE_FORBIDDEN_BUY = "forbidden_buy" # 禁止买入 |
| | | TYPE_CANT_PLACE_ORDER = "can_not_place_order" # 不能下单 |
| | | TYPE_CANCEL = "cancel" # 撤单 |
| | | TYPE_ACTION = "action" # 针对代码的操作 |
| | | |
| | | |
| | | class PlaceOrderInfo(object): |
| | | def __init__(self, buy_single_index=None, buy_exec_index=None, m_val=None, safe_count=None, big_num_indexes=None, |
| | | kpl_blocks=None): |
| | | kpl_blocks=None, kpl_match_blocks=None, mode=None, mode_desc=None, sell_info=None, |
| | | block_info=None): |
| | | self.buy_single_index = buy_single_index |
| | | self.buy_exec_index = buy_exec_index |
| | | self.m_val = m_val |
| | | self.safe_count = safe_count |
| | | self.big_num_indexes = big_num_indexes |
| | | self.kpl_blocks = kpl_blocks |
| | | self.kpl_match_blocks = kpl_match_blocks |
| | | self.mode = mode |
| | | self.mode_desc = mode_desc |
| | | self.sell_info = sell_info |
| | | self.block_info = block_info |
| | | |
| | | def set_block_info(self, block_info): |
| | | """ |
| | | @param block_info:(板块,流入金额) |
| | | @return: |
| | | """ |
| | | self.block_info = block_info |
| | | |
| | | def set_buy_index(self, buy_single_index, buy_exec_index): |
| | | self.buy_single_index = buy_single_index |
| | | self.buy_exec_index = buy_exec_index |
| | | |
| | | def set_sell_info(self, sell_info): |
| | | self.sell_info = sell_info |
| | | |
| | | def set_trade_factor(self, m_val, safe_count, big_num_indexes): |
| | | self.m_val = m_val |
| | |
| | | |
| | | def set_kpl_blocks(self, kpl_blocks): |
| | | self.kpl_blocks = kpl_blocks |
| | | |
| | | def set_kpl_match_blocks(self, kpl_blocks): |
| | | self.kpl_match_blocks = kpl_blocks |
| | | |
| | | def to_json_str(self): |
| | | return json.dumps(vars(self)) |
| | |
| | | |
| | | |
| | | # 添加撤单信息 |
| | | def add_cancel_msg_log(code, msg): |
| | | __add_log(TYPE_CANCEL, code, {"msg": msg}) |
| | | def add_cancel_msg_log(code, real_place_order_index, msg): |
| | | __add_log(TYPE_CANCEL, code, {"msg": msg, "real_place_order_index": real_place_order_index}) |
| | | |
| | | |
| | | # 加红信息 |
| | | def add_must_buy(code, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": "加红", "msg": msg}) |
| | | |
| | | |
| | | # 加绿 |
| | | def add_green(code, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": "加绿", "msg": msg}) |
| | | |
| | | |
| | | # 加白 |
| | | def add_white_buy(code, msg=""): |
| | | __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_temp_special_codes(code, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": "新题材", "msg": msg}) |
| | | |
| | | |
| | | # 加下单耗时 |
| | | def add_place_order_use_time(code, msg): |
| | | __add_log(TYPE_ACTION, code, {"type": "下单耗时", "msg": msg}) |
| | | |
| | | |
| | | # 加白 |
| | | def add_common_msg(code, type_, msg=""): |
| | | __add_log(TYPE_ACTION, code, {"type": type_, "msg": msg}) |
| | | |
| | | |
| | | if __name__ == "__main__": |