fund_transfer - 资金调拨
fund_transfer 是 PTrade 中用于资金调拨的接口。
提示
live-or-trading-module-onlybroker-or-counter-dependent
原型
fund_transfer(trans_direction, occur_balance, exchange_type="1")
释义
fund_transfer 是 PTrade 中用于资金调拨的接口。
研究:不支持;回测:不支持;模拟:官方目录未明确;实盘:支持。
参数
| 参数 | 是否必填 | 官方原始定义 |
|---|---|---|
trans_direction |
是 | trans_direction |
occur_balance |
是 | occur_balance |
exchange_type |
否 | exchange_type="1" |
返回值
返回调拨是否成功True/False(bool)。
示例
def initialize(context):
g.security = '600570.SS'
set_universe(g.security)
def before_trading_start(context, data):
# 转出深A极速柜台100000元
fund_transfer('1', 100000, exchange_type='2')
def handle_data(context, data):
pass
详细说明
fund_transfer(trans_direction, occur_balance, exchange_type="1")
使用场景
该函数仅在股票交易模块可用
接口说明
用于UF20柜台与极速柜台、UF20柜台与极速柜台双中心资金调拨。
注意事项
如要使用该函数,需咨询券商当前柜台是否支持。
当前仅支持UF20柜台与ATP柜台、UF20柜台与ATP柜台双中心资金调拨。
如果是UF20与ATP柜台,exchange_type可不传。
如果是UF20与ATP柜台双中心,exchange_type为必传字段。
参数详细说明
trans_direction(str):调拨方向,0为转入极速、1为转出极速。
occur_balance(float):发生金额(单位:元,最小精度:0.01元)。
exchange_type(str):交易类别,1为上海、2为深圳。
返回值
返回调拨是否成功True/False(bool)。