def future_position(self, symbol, contractType): FUTURE_POSITION = "/api/v1/future_position.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType } params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_POSITION, params)
def future_position_4fix(self, symbol, contractType, type1): FUTURE_POSITION_4FIX = "/api/v1/future_position_4fix.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType, 'type': type1 } params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_POSITION_4FIX, params)
def future_cancel(self, symbol, contractType, orderId): FUTURE_CANCEL = "/api/v1/future_cancel.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType, 'order_id': orderId } params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_CANCEL, params)
def future_batchTrade(self, symbol, contractType, orders_data, leverRate): FUTURE_BATCH_TRADE = "/api/v1/future_batch_trade.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType, 'orders_data': orders_data, 'lever_rate': leverRate } params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_BATCH_TRADE, params)
def future_orderinfo(self, symbol, contractType, orderId, status, currentPage, pageLength): FUTURE_ORDERINFO = "/api/v1/future_order_info.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType, 'order_id': orderId, 'status': status, 'current_page': currentPage, 'page_length': pageLength } params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_ORDERINFO, params)
def future_trade(self, symbol, contractType, price='', amount='', tradeType='', matchPrice='', leverRate=''): FUTURE_TRADE = "/api/v1/future_trade.do?" params = { 'api_key': self.__api_key, 'symbol': symbol, 'contract_type': contractType, 'amount': amount, 'type': tradeType, 'match_price': matchPrice, 'lever_rate': leverRate } if price: params['price'] = price params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_TRADE, params)
def future_userinfo(self): FUTURE_USERINFO = "/api/v1/future_userinfo.do?" params = {} params['api_key'] = self.__api_key params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_USERINFO, params)
def future_userinfo_4fix(self): FUTURE_INFO_4FIX = "/api/v1/future_userinfo_4fix.do?" params = {'api_key': self.__api_key} params['sign'] = build_sign(params, self.__secret_key) return http_post(self.__url, FUTURE_INFO_4FIX, params)