btfxwss/client.py
def subscribe_to_candles(self, pair, timeframe=None, **kwargs):
        """Subscribe to the passed pair's OHLC data channel.

        :param pair: str, Symbol pair to request data for
        :param timeframe: str, {1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h,
                                1D, 7D, 14D, 1M}
        :param kwargs:
        :return:
        """

        valid_tfs = ['1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D',
                     '7D', '14D', '1M']
        if timeframe:
            if timeframe not in valid_tfs:
                raise ValueError("timeframe must be any of %s" % valid_tfs)
        else:
            timeframe = '1m'
        identifier = ('candles', pair, timeframe)
        pair = 't' + pair if not pair.startswith('t') else pair
        key = 'trade:' + timeframe + ':' + pair
        self._subscribe('candles', identifier, key=key, **kwargs)
def subscribe_to_candles(self, pair, timeframe=None, **kwargs):
        valid_tfs = ['1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D',
                     '7D', '14D', '1M']
        if timeframe:
            if timeframe not in valid_tfs:
                raise ValueError("timeframe must be any of %s" % valid_tfs)
        else:
            timeframe = '1m'
        identifier = ('candles', pair, timeframe)
        pair = 't' + pair if not pair.startswith('t') else pair
        key = 'trade:' + timeframe + ':' + pair
        self._subscribe('candles', identifier, key=key, **kwargs)
def subscribe_to_candles ( self , pair , timeframe = None , * * kwargs ) : valid_tfs = [ '1m' , '5m' , '15m' , '30m' , '1h' , '3h' , '6h' , '12h' , '1D' , '7D' , '14D' , '1M' ] if timeframe : if timeframe not in valid_tfs : raise ValueError ( "timeframe must be any of %s" % valid_tfs ) else : timeframe = '1m' identifier = ( 'candles' , pair , timeframe ) pair = 't' + pair if not pair . startswith ( 't' ) else pair key = 'trade:' + timeframe + ':' + pair self . _subscribe ( 'candles' , identifier , key = key , * * kwargs )
Subscribe to the passed pair's OHLC data channel.

        :param pair: str, Symbol pair to request data for
        :param timeframe: str, {1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h,
                                1D, 7D, 14D, 1M}
        :param kwargs:
        :return:
Subscribe to the passed pair s OHLC data channel .