PTrade账户、持仓与对账
fund_transfer
用于UF20柜台与极速柜台、UF20柜台与极速柜台双中心资金调拨。
原型
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)。
示例
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