tpqoa/tpqoa.py
def stream_data(self, instrument, stop=None, ret=False):
        ''' Starts a real-time data stream.

        Parameters
        ==========
        instrument: string
            valid instrument name
        '''
        self.stream_instrument = instrument
        self.ticks = 0
        response = self.ctx_stream.pricing.stream(
            self.account_id, snapshot=True,
            instruments=instrument)
        msgs = []
        for msg_type, msg in response.parts():
            msgs.append(msg)
            # print(msg_type, msg)
            if msg_type == 'pricing.ClientPrice':
                self.ticks += 1
                self.time = msg.time
                #self.on_success(msg.time,
                 #               float(msg.bids[0].dict()['price']),
                  #              float(msg.asks[0].dict()['price']))
                if stop is not None:
                    if self.ticks >= stop:
                        if ret:
                            return msgs
                        break
            if self.stop_stream:
                if ret:
                    return msgs
                break
 Starts a real-time data stream.

        Parameters
        ==========
        instrument: string
            valid instrument name
        
Starts a real-time data stream.
Parameters

string
valid instrument name
Starts a real - time data stream . Parameters string valid instrument name
def stream_data(self, instrument, stop=None, ret=False):
        self.stream_instrument = instrument
        self.ticks = 0
        response = self.ctx_stream.pricing.stream(
            self.account_id, snapshot=True,
            instruments=instrument)
        msgs = []
        for msg_type, msg in response.parts():
            msgs.append(msg)
            if msg_type == 'pricing.ClientPrice':
                self.ticks += 1
                self.time = msg.time
                if stop is not None:
                    if self.ticks >= stop:
                        if ret:
                            return msgs
                        break
            if self.stop_stream:
                if ret:
                    return msgs
                break
def stream_data ( self , instrument , stop = None , ret = False ) : self . stream_instrument = instrument self . ticks = 0 response = self . ctx_stream . pricing . stream ( self . account_id , snapshot = True , instruments = instrument ) msgs = [ ] for msg_type , msg in response . parts ( ) : msgs . append ( msg ) if msg_type == 'pricing.ClientPrice' : self . ticks += 1 self . time = msg . time if stop is not None : if self . ticks >= stop : if ret : return msgs break if self . stop_stream : if ret : return msgs break
Starts a real-time data stream.
Starts a real - time data stream .
''' Starts a real-time data stream.

        Parameters
        ==========
        instrument: string
            valid instrument name
        ''' # print(msg_type, msg) #self.on_success(msg.time, #               float(msg.bids[0].dict()['price']), #              float(msg.asks[0].dict()['price']))
self
instrument
stop
ret