Administrator
5 天以前 09f84c4ecae2a71e07f6dd64e6066563599a62b6
strategy/strategy_manager.py
@@ -105,7 +105,7 @@
    """
    def __init__(self, day, script_name="strategy_script_v6.py",
                 settings=StrategyParamsSettingsManager().get_settings()):
                 settings=StrategyParamsSettingsManager().get_settings(), need_load_data = False):
        self.now_day = day
        # 买大单:{代码:[大单数据]}
        self.big_order_buy = {}
@@ -151,9 +151,10 @@
            self.scripts = scripts
        self.settings = settings
        self.data_loader = DataLoader(self.now_day, cache_path=f"{constant.get_path_prefix()}/datas")
        self.data_loader = DataLoader(self.now_day)
        self.__LowSuctionOriginDataExportManager = LowSuctionOriginDataExportManager(self.now_day)
        self.load_data()
        if need_load_data:
            self.load_data()
    def load_data(self):
        # 加载历史数据
@@ -273,6 +274,7 @@
        @param big_orders: [(代码, 买/卖, [订单号,量,金额,最后时间戳,最后价格, 初始时间戳, 初始价格])] 如:[ ('002741', 0, [475820, 91600, 1610328, 92500000, 17.58, 92500000, 17.58])]
        @return:
        """
        codes = []
        for d in big_orders:
            code = d[0]
            if d[1] == 0:
@@ -285,7 +287,11 @@
                if code not in self.big_order_sell:
                    self.big_order_sell[code] = []
                self.big_order_sell[code].append(d[2])
        # 驱动下单
                if code not in codes:
                    codes.append(code)
            # 驱动下单
        for code in codes:
            self.__run(code, self.stock_variables_dict.get(code))
    def add_ticks(self, ticks):
        """
@@ -359,6 +365,8 @@
        self.current_block_in_datas = _block_in_datas
    def __run(self, code, sv: StockVariables):
        if not sv:
            return
        # 运行代码
        # 注入大单
        sv.今日大单数据 = self.big_order_buy.get(code)