| | |
| | | CancelRateHumanSettingManager().set_l_down(code, rate) |
| | | # L后重新囊括 |
| | | # if rate < old_rate: |
| | | # 改小才能重新囊括 |
| | | # 改小才能重新囊括 |
| | | trade_record_log_util.add_common_msg(code, "L后重新囊括", msg=f"修改撤单比例: {old_rate}->{rate}") |
| | | LCancelBigNumComputer().re_compute_l_down_watch_indexes(code, is_force=True) |
| | | |
| | |
| | | self.send_response({"code": 0, "data": {}}, |
| | | client_id, |
| | | request_id) |
| | | |
| | | elif ctype == "set_code_today_ex_rights": |
| | | # 代码今日除权,需要更新K线 |
| | | code = data.get("code") |
| | | volumes_data = history_k_data_manager.update_history_k_bars_of_code(code, force=True) |
| | | if not volumes_data: |
| | | result = {"code": 1, "msg": "拉取K线失败"} |
| | | else: |
| | | # 更新昨日收盘价数据 |
| | | CodePrePriceManager.set_price_pre(code, volumes_data[0]['close'], force=True) |
| | | gpcode_manager.clear_limit_up_price_cache(code) |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | # 更新K线特征数据 |
| | | k_format = code_nature_analyse.get_k_format(code, limit_up_price, volumes_data) |
| | | code_nature_analyse.CodeNatureRecordManager().save_k_format(code, k_format) |
| | | result = {"code": 0, "msg": "设置成功"} |
| | | self.send_response(result, |
| | | client_id, |
| | | request_id) |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | logger_debug.exception(e) |
| | |
| | | __limit_up_price_dict[code] = limit_up_price |
| | | return limit_up_price |
| | | |
| | | def clear_limit_up_price_cache(code): |
| | | if code in __limit_up_price_dict: |
| | | __limit_up_price_dict.pop(code) |
| | | |
| | | |
| | | def get_limit_up_price_as_num(code): |
| | | limit_up_price = get_limit_up_price(code) |
| | |
| | | L2_DATA_IS_LOADED = False |
| | | |
| | | # 可买入的金额 |
| | | AVAILABLE_BUY_MONEYS = [25000, 30000, 35000, 45000, 50000] |
| | | AVAILABLE_BUY_MONEYS = [25000, 50000, 55000, 60000, 65000, 70000] |
| | | |
| | | # 板上放量是否可扫入 |
| | | CAN_RADICAL_BUY_AT_LIMIT_UP = False |
| | |
| | | from utils import tool, init_data_util |
| | | |
| | | |
| | | def update_history_k_bars_of_code(code, force=True): |
| | | try: |
| | | datas = init_data_util.get_volumns_by_code(code, 150) |
| | | if datas: |
| | | HistoryKDataManager().save_history_bars(code, datas[0]['bob'].strftime("%Y-%m-%d"), datas, |
| | | force=force) |
| | | return datas |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | |
| | | |
| | | def update_history_k_bars(force=False): |
| | | """ |
| | | 更新历史K线 |