def configure_environment(self, last_trade, benchmark, timezone):
        ''' Prepare benchmark loader and trading context '''

        if last_trade.tzinfo is None:
            last_trade = pytz.utc.localize(last_trade)

        # Setup the trading calendar from market informations
        self.benchmark = benchmark
        self.context = TradingEnvironment(
            bm_symbol=benchmark,
            exchange_tz=timezone,
            load=self._get_benchmark_handler(last_trade))
def configure_environment ( self , last_trade , benchmark , timezone ) : if last_trade . tzinfo is None : last_trade = pytz . utc . localize ( last_trade ) self . benchmark = benchmark self . context = TradingEnvironment ( bm_symbol = benchmark , exchange_tz = timezone , load = self . _get_benchmark_handler ( last_trade ) )
Prepare benchmark loader and trading context