original_docstring: 
          
          Parameters
          ----------
          order : Order
              Not yet filled.
          roll_back : bool
              if the order is canceled, or task is failed/stopped, we roll back our previous change.
  
          
docstring: Parameters
  order : Order
  Not yet filled.
  roll_back : bool
  if the order is canceled, or task is failed/stopped, we roll back our previous change.
docstring_tokens: Parameters order : Order Not yet filled . roll_back : bool if the order is canceled or task is failed / stopped we roll back our previous change .
code: def _update_trade_stat_from_order(self, order, roll_back=False):
          """
          
          Parameters
          ----------
          order : Order
              Not yet filled.
          roll_back : bool
              if the order is canceled, or task is failed/stopped, we roll back our previous change.
  
          """
          sign = 1
          if roll_back:
              sign *= -1
          
          tradestat = self._get_trade_stat(order.symbol)
          
          # if order.entrust_action == common.ORDER_ACTION.BUY:
          if common.ORDER_ACTION.is_positive(order.entrust_action):
              tradestat.buy_want_size += order.entrust_size * sign
          else:
              tradestat.sell_want_size += order.entrust_size * sign
          
          self.tradestat[self._make_trade_stat_key(order.symbol)] = tradestat
code_tokens: def _update_trade_stat_from_order ( self , order , roll_back = False ) : sign = 1 if roll_back : sign *= - 1 tradestat = self . _get_trade_stat ( order . symbol ) if common . ORDER_ACTION . is_positive ( order . entrust_action ) : tradestat . buy_want_size += order . entrust_size * sign else : tradestat . sell_want_size += order . entrust_size * sign self . tradestat [ self . _make_trade_stat_key ( order . symbol ) ] = tradestat
short_docstring: Parameters
  order : Order
  Not yet filled.
short_docstring_tokens: Parameters order : Order Not yet filled .
comment: """
          
          Parameters
          ----------
          order : Order
              Not yet filled.
          roll_back : bool
              if the order is canceled, or task is failed/stopped, we roll back our previous change.
  
          """$SEP$# if order.entrust_action == common.ORDER_ACTION.BUY: