期货多头空头持仓量-期货多头空头持仓量怎么算

2023-03-06 22:29:15 技术指标 0次阅读 投稿:admin

关于期货多头空头持仓量内容导航:

1、期货多头空头持仓量


def get_future_position_data(self, symbol, exchange):
"""
获取期货持仓量数据
:param symbol: 合约代码
:param exchange: 交易所
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange
}
url = self.__url + '/api/futures/v3/position'
return http_get_request(url, params)

# 获取期货指数信息
def get_future_index(self, symbol):
"""
获取期货指数信息
:param symbol: 合约代码
:return:
"""
params = {'symbol': symbol}
url = self.__url + '/api/futures/v3/instruments/index'
return http_get_request(url, params)

# 获取美元人民币汇率
def get_exchange_rate(self):
"""
获取美元人民币汇率
:return:
"""
url = self.__url + '/api/futures/v3/rate'
return http_get_request(url, {})

# 获取当前可用合约总持仓量
def get_contract_open_interest(self, symbol, exchange):
"""
获取当前可用合约总持仓量
:param symbol: 合约代码
:param exchange: 交易所
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange
}
url = self.__url + '/api/futures/v3/open_interest'
return http_get_request(url, params)

# 获取行情深度
def get_contract_depth(self, symbol, exchange, type):
"""
获取行情深度
:param symbol: 合约代码
:param exchange: 交易所
:param type: Depth 类型 step0, step1, step2, step3, step4, step5(合并深度0-5);step0时,不合并深度
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange,
'type': type
}
url = self.__url + '/api/futures/v3/depth'
return http_get_request(url, params)

# 获取K线数据
def get_contract_kline(self, symbol, exchange, period, size):
"""
获取K线数据
:param symbol: 合约代码
:param exchange: 交易所
:param period: K线类型,1min, 5min, 15min, 30min, 60min, 1day, 1mon, 1week, 1year
:param size: 获取数量,最大为1440
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange,
'period': period,
'size': size
}
url = self.__url + '/api/futures/v3/kline'
return http_get_request(url, params)

# 获取聚合行情
def get_contract_market_merged(self, symbol):
"""
获取聚合行情
:param symbol: 合约代码
:return:
"""
params = {'symbol': symbol}
url = self.__url + '/api/futures/v3/instruments/ticker'
return http_get_request(url, params)

# 获取市场最近成交记录
def get_contract_trade(self, symbol, exchange):
"""
获取市场最近成交记录
:param symbol: 合约代码
:param exchange: 交易所
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange
}
url = self.__url + '/api/futures/v3/trades'
return http_get_request(url, params)

# 批量获取最近的交易记录
def get_contract_batch_trade(self, symbol, exchange):
"""
批量获取最近的交易记录
:param symbol: 合约代码
:param exchange: 交易所
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange
}
url = self.__url + '/api/futures/v3/batch_trades'
return http_get_request(url, params)

# 获取期货合约的历史分钟线
def get_contract_history_kline(self, symbol, exchange, period, size, since):
"""
获取期货合约的历史分钟线
:param symbol: 合约代码
:param exchange: 交易所
:param period: K线类型,1min, 5min, 15min, 30min, 60min, 1day, 1mon, 1week, 1year
:param size: 获取数量,最大为1440
:param since: 时间戳(eg:1417536000000)
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange,
'period': period,
'size': size,
'since': since
}
url = self.__url + '/api/futures/v3/history/kline'
return http_get_request(url, params)

# 获取期货合约的历史成交记录
def get_contract_history_trade(self, symbol, exchange, size, since):
"""
获取期货合约的历史成交记录
:param symbol: 合约代码
:param exchange: 交易所
:param size: 获取数量,最大为2000
:param since: 时间戳(eg:1417536000000)
:return:
"""
params = {
'symbol': symbol,
'exchange': exchange,
'size': size,
'since': since
}
url = self.__url + '/api/futures/v3/history/trade'
return http_get_request(url, params)

# 获取期货合约的历史分钟线

2、期货多头空头持仓量不相等

期货是一对一的,有1手多单必有一手空单。你卖空10手,必有做多的人接10手,此时持仓量就是10手。到期后自动交割,不过有额外手续费。所以尽量在到期日前,自行交割到下个月。所谓对冲,比如屋报茶你是棉花1201 空单10手的,到时你买进10手1201,卖出10手1205.就是自主交割。


期货多头空头持仓量不相等

3、期货多头空头持仓量怎么算

声明:稳得一批是理财投资基础知识平台! 并不指导专业性投资! 投资有风险,入市需谨慎!