def future_trades(self, symbol, contractType): TRADES_RESOURCE = "/api/v1/future_trades.do" params = '' if symbol: params += '&symbol=' + symbol if params else 'symbol=' + symbol if contractType: params += '&contract_type=' + contractType if params else 'contract_type=' + symbol return http_get(self.__url, TRADES_RESOURCE, params)
def future_depth(self, symbol, contractType, size): DEPTH_RESOURCE = "/api/v1/future_depth.do" params = '' if symbol: params += '&symbol=' + symbol if params else 'symbol=' + symbol if contractType: params += '&contract_type=' + contractType if params else 'contract_type=' + symbol if size: params += '&size=' + size if params else 'size=' + size return http_get(self.__url, DEPTH_RESOURCE, params)
def trades(self, symbol=''): TRADES_RESOURCE = "/api/v1/trades.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return http_get(self.__url, TRADES_RESOURCE, params)
def depth(self, symbol=''): DEPTH_RESOURCE = "/api/v1/depth.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return http_get(self.__url, DEPTH_RESOURCE, params)
def ticker(self, symbol=''): TICKER_RESOURCE = "/api/v1/ticker.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return http_get(self.__url, TICKER_RESOURCE, params)
def future_estimated_price(self, symbol): ESTIMATED_PRICE = "/api/v1/estimated_price.do" params = '' if symbol: params = 'symbol=' + symbol return http_get(self.__url, ESTIMATED_PRICE, params)
def exchange_rate(self): EXCHANGE_RATE = "/api/v1/exchange_rate.do" return http_get(self.__url, EXCHANGE_RATE, '')
def future_index(self, symbol): INDEX = "/api/v1/future_index.do" params = '' if symbol: params = 'symbol=' + symbol return http_get(self.__url, INDEX, params)