code: def subscribe_to_markets(self, market_filter, market_data_filter, initial_clk=None, clk=None,
                               conflate_ms=None, heartbeat_ms=None, segmentation_enabled=True):
          
          unique_id = self.new_unique_id()
          message = {
              'op': 'marketSubscription',
              'id': unique_id,
              'marketFilter': market_filter,
              'marketDataFilter': market_data_filter,
              'initialClk': initial_clk,
              'clk': clk,
              'conflateMs': conflate_ms,
              'heartbeatMs': heartbeat_ms,
              'segmentationEnabled': segmentation_enabled,
          }
          if initial_clk and clk:
              # if resubscribe only update unique_id
              self.listener.stream_unique_id = unique_id
          else:
              self.listener.register_stream(unique_id, 'marketSubscription')
          self._send(message)
          return unique_id
docs: Market subscription request.
  
          :param dict market_filter: Market filter
          :param dict market_data_filter: Market data filter
          :param str initial_clk: Sequence token for reconnect
          :param str clk: Sequence token for reconnect
          :param int conflate_ms: conflation rate (bounds are 0 to 120000)
          :param int heartbeat_ms: heartbeat rate (500 to 5000)
          :param bool segmentation_enabled: allow the server to send large sets of data
          in segments, instead of a single block