def registerInstrument()

in tbapi/__init__.py [0:0]


    def registerInstrument(self, symbol: str) -> int:
        '''Register instrument of sending message to get instrument id. For performance reasons,
        you could specify instrument id instead of symbol and instrument type, for example:

        ```
        message = tbapi.InstrumentMessage()
        message.instrumentId = loader.registerInstrument('AAPL')
        // as alternative, you could write:
        //    message.symbol = 'AAPL'
        loader.send(message)
        ```

        Args:
            symbol (str): instrument ticker.

        Returns:
            int: id of registered instrument.
        '''
        return self.__registerInstrument(symbol)