| | |
| | | logger_trade, logger_trade_position_api_request, logger_request_api, \ |
| | | logger_real_place_order_position, logger_device |
| | | from output import l2_output_util |
| | | from third_data import kpl_util, history_k_data_manager, huaxin_l1_data_manager, third_blocks_manager, kpl_data_manager |
| | | from third_data import kpl_util, history_k_data_manager, huaxin_l1_data_manager, third_blocks_manager, kpl_data_manager, \ |
| | | history_k_data_util |
| | | from third_data.code_plate_key_manager import KPLCodeJXBlockManager, RealTimeKplMarketData |
| | | from third_data.history_k_data_manager import HistoryKDataManager |
| | | from third_data.history_k_data_util import JueJinApi, HistoryKDatasUtils |
| | |
| | | try: |
| | | fdata = {} |
| | | try: |
| | | date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10) ,tool.get_now_date_str()) |
| | | date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10), |
| | | tool.get_now_date_str()) |
| | | if date: |
| | | fdata["juejin"] = 1 |
| | | except Exception as e: |
| | |
| | | |
| | | # 获取今日K线的更新数量 |
| | | try: |
| | | dates = HistoryKDatasUtils.get_latest_trading_date_cache(5) |
| | | latest_trading_date = None |
| | | if dates: |
| | | latest_trading_date = dates[0] |
| | | if latest_trading_date is None: |
| | | raise Exception("没有获取到上一个交易日的日期") |
| | | # 4点之后改为获取今日的数据 |
| | | if tool.get_now_time_as_int()>160000: |
| | | latest_trading_date = tool.get_now_date_str() |
| | | latest_trading_date = history_k_data_util.get_k_bar_dead_date() |
| | | codes = HistoryKDataManager().get_history_bars_codes(latest_trading_date) |
| | | count = len(codes) |
| | | logger_debug.info(f"K线代码数量:{count}") |
| | |
| | | data = { |
| | | "radical_buy": {"price": (constant.MIN_CODE_RADICAL_BUY_PRICE, constant.MAX_CODE_RADICAL_BUY_PRICE), |
| | | "zyltgb": constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES, |
| | | "top_block_count_by_market_strong":constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG, |
| | | "top_block_count_by_market_strong": constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG, |
| | | "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL |
| | | }} |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | |
| | | constant.MAX_CODE_RADICAL_BUY_PRICE = radical_buy["price"][1] |
| | | constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES = radical_buy["zyltgb"] |
| | | if radical_buy.get("top_block_count_by_market_strong"): |
| | | constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG = radical_buy.get("top_block_count_by_market_strong") |
| | | constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG = radical_buy.get( |
| | | "top_block_count_by_market_strong") |
| | | if radical_buy.get("special_codes_max_block_in_rank"): |
| | | constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL = radical_buy.get( |
| | | "special_codes_max_block_in_rank") |
| | |
| | | fblocks, before_fblocks = RadicalBuyBlockManager.get_code_blocks(code) |
| | | # 获取板块历史涨停 |
| | | for b in fblocks: |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(b) |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(b) |
| | | if codes: |
| | | if code not in block_codes: |
| | | block_codes[code] = {} |