Exemple #1
0
    def __init__(self, config):
        Environment._env = self
        self.config = config
        self.data_proxy = None  # type: Optional[rqalpha.data.data_proxy.DataProxy]
        self.data_source = None
        self.price_board = None
        self.event_source = None
        self.strategy_loader = None
        self.global_vars = GlobalVars()
        self.persist_provider = None
        self.persist_helper = None
        self.broker = None
        self.profile_deco = None
        self.system_log = system_log
        self.user_log = user_log
        self.user_system_log = user_system_log
        self.event_bus = EventBus()
        self.portfolio = None  # type: Optional[rqalpha.portfolio.Portfolio]
        self.calendar_dt = None  # type: Optional[datetime]
        self.trading_dt = None  # type: Optional[datetime]
        self.mod_dict = None
        self.plot_store = None
        self.user_strategy = None
        self._frontend_validators = {}
        self._transaction_cost_decider_dict = {}

        # Environment.event_bus used in StrategyUniverse()
        from rqalpha.core.strategy_universe import StrategyUniverse
        self._universe = StrategyUniverse()
Exemple #2
0
 def __init__(self, config):
     Environment._env = self
     self.config = config
     self._universe = None
     self.data_proxy = None
     self.data_source = None
     self.price_board = None
     self.event_source = None
     self.strategy_loader = None
     self.global_vars = None
     self.persist_provider = None
     self.persist_helper = None
     self.broker = None
     self.profile_deco = None
     self.system_log = system_log
     self.user_log = user_log
     self.user_detail_log = user_detail_log
     self.event_bus = EventBus()
     self.portfolio = None
     self.booking = None
     self.benchmark_portfolio = None
     self.calendar_dt = None
     self.trading_dt = None
     self.mod_dict = None
     self.plot_store = None
     self.bar_dict = None
     self._frontend_validators = []
     self._account_model_dict = {}
     self._position_model_dict = {}
     self._transaction_cost_decider_dict = {}