code: def on_recv_rsp(self, rsp_str):
          
          ret, content = super(TrailingStopHandler, self).on_recv_rsp(rsp_str)
          if ret != ft.RET_OK:
              print('StockQuote error {}'.format(content))
              return ret, content
          if self.finished:
              return ret, content
          ret, data = self.quote_ctx.get_global_state()
          if ret != ft.RET_OK:
              print('获取全局状态失败')
              trading = False
          else:
              hk_trading = (data['market_hk'] == ft.MarketState.MORNING or data['market_hk'] == ft.MarketState.AFTERNOON)
              us_trading = (data['market_us'] == ft.MarketState.MORNING)
              trading = hk_trading if self.is_hk_trade else us_trading
  
          if not trading:
              print('不处在交易时间段')
              return ft.RET_OK, content
          last_price = content.iloc[0]['last_price']
  
          if self.stop is None:
              self.stop = last_price - self.drop if self.method == TrailingMethod.DROP_ABS else last_price * (1 - self.drop)
          elif (self.stop + self.drop < last_price) if self.method == TrailingMethod.DROP_ABS else (self.stop < last_price * (1 - self.drop)):
              self.stop = last_price - self.drop if self.method == TrailingMethod.DROP_ABS else last_price * (1 - self.drop)
          elif self.stop >= last_price:
              # 交易己被触发
              self.finished = True
              print('交易被触发')
  
          self.price_lst.append(last_price)
          self.stop_lst.append(self.stop)
          print('last_price is {}, stop is {}'.format(last_price, self.stop))
  
          return ft.RET_OK, content
docs: 数据接收回调函数