资金划转¶
资金划转、CTP 转入转出、跨市场划转(期权↔期货)等。
需要认证
资金划转方法需要在创建客户端时传入 api_key 参数。
资金划转客户端方法集合,对应 /api/fund/* 端点。
fund_transfer(transfer_direction: int, amount: float, account_id: str = '') -> dict
¶
执行资金划转。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
transfer_direction
|
int
|
划转方向 — 0=转入, 1=转出 |
必需 |
amount
|
float
|
划转金额(元) |
必需 |
account_id
|
str
|
交易账户 ID |
''
|
返回:
| 类型 | 描述 |
|---|---|
dict
|
划转结果 |
ctp_transfer_option_to_future(opt_account_id: str, ft_account_id: str, balance: float) -> dict
¶
从期权账户划转资金到期货账户(跨市场划转)。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
opt_account_id
|
str
|
期权账户 ID |
必需 |
ft_account_id
|
str
|
期货账户 ID |
必需 |
balance
|
float
|
划转金额(元) |
必需 |
返回:
| 类型 | 描述 |
|---|---|
dict
|
划转结果 |
ctp_transfer_future_to_option(opt_account_id: str, ft_account_id: str, balance: float) -> dict
¶
从期货账户划转资金到期权账户(跨市场划转)。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
opt_account_id
|
str
|
期权账户 ID |
必需 |
ft_account_id
|
str
|
期货账户 ID |
必需 |
balance
|
float
|
划转金额(元) |
必需 |
返回:
| 类型 | 描述 |
|---|---|
dict
|
划转结果 |
secu_transfer(transfer_direction: int, stock_code: str, volume: int, transfer_type: int, account_id: str = '') -> dict
¶
证券划转。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
transfer_direction
|
int
|
划转方向 |
必需 |
stock_code
|
str
|
股票代码 |
必需 |
volume
|
int
|
划转数量 |
必需 |
transfer_type
|
int
|
划转类型 |
必需 |
account_id
|
str
|
交易账户 ID |
''
|
返回:
| 类型 | 描述 |
|---|---|
dict
|
划转结果 |