示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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)
示例#8
0
 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)