Administrator
2023-08-07 20a70116b236a49d68659b451fea0a9f645a0835
trade/current_price_process_manager.py
@@ -39,9 +39,11 @@
    if True:
        _code_list = []
        _delete_list = []
        prices = []
        rates = []
        for d in prices:
            code, price = d["code"], float(d["price"])
            gpcode_manager.set_price(code, price)
            prices.append((code, price))
            # 获取收盘价
            pricePre = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code)
            if pricePre is not None:
@@ -55,7 +57,7 @@
                    # 暂存涨幅为负的代码
                    _delete_list.append((rate, code, 0))
                try:
                    __actualPriceProcessor.process_rate(code, rate, now_str)
                    rates.append((code, rate))
                except Exception as e:
                    logging.exception(e)
@@ -66,7 +68,8 @@
                                                                  decimal.Decimal(d["price"])))
                except Exception as e:
                    logging.exception(e)
        gpcode_manager.set_prices(prices)
        __actualPriceProcessor.process_rates(rates, now_str)
        # -------------------------------处理交易位置分配---------------------------------
        # 排序
        new_code_list = sorted(_code_list, key=lambda e: (e.__getitem__(2), e.__getitem__(0)), reverse=True)